Skip to content

Instantly share code, notes, and snippets.

View manafire's full-sized avatar

Brad Carson manafire

View GitHub Profile
@manafire
manafire / factorybot_faker_demo.md
Created November 16, 2023 04:28 — forked from jfangonilo/factorybot_faker_demo.md
FactoryBot/Faker Demo

FactoryBot/Faker Demo

For Turing BE Mod2 - MiniShop

https://github.com/turingschool-examples/mini_shop

Are you sick of writing fake data for tests? If you are, then your test files probably look something like this. This is what your index spec probably looks like for a project like MiniShop. You create 3 merchants and 3 items for each merchant and make sure those items show up on your index page...

#index_spec.rb
require "rails_helper"
@manafire
manafire / gist:c385b40031309af1c9d6
Last active August 29, 2015 14:01
Ubuntu + rbenv + github + Rails + Ruby + nginx + passenger + ec2
# IN AMAZON EC2 SERVER #
########################
sudo su
apt-get -y update && apt-get -y upgrade
apt-get install vim git-core curl openssh-server openssh-client python-software-properties build-essential zlib1g-dev libssl-dev libreadline-gplv2-dev libcurl4-openssl-dev aptitude
/usr/sbin/groupadd wheel
/usr/sbin/visudo
(paste bottom)
%wheel ALL=(ALL) ALL
(function () {
var scriptName = "embed.js"; //name of this script, used to get reference to own tag
var jQuery; //noconflict reference to jquery
var jqueryPath = "http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js";
var jqueryVersion = "1.8.3";
var scriptTag; //reference to the html script tag
/******** Get reference to self (scriptTag) *********/
var allScripts = document.getElementsByTagName('script');
@manafire
manafire / jquery.plugin-template.js
Created November 13, 2012 22:48 — forked from Air-Craft/jquery.plugin-template.js
jQuery Plugin Design Pattern/Template Improved!
// if (!window.L) { window.L = function () { console.log(arguments);} } // optional EZ quick logging for debugging
/**
* A modified (improved?) version of the jQuery plugin design pattern
* See http://docs.jquery.com/Plugins/Authoring (near the bottom) for details.
*
* ADVANTAGES OF EITHER FRAMEWORK:
* - Encapsulates additional plugin action methods without polluting the jQuery.fn namespace
* - Ensures ability to use '$' even in compat modes
*