Skip to content

Instantly share code, notes, and snippets.

View jackieiscool's full-sized avatar

Jacqueline Herrlin jackieiscool

View GitHub Profile
@jackieiscool
jackieiscool / ActiveRecord Cheat Sheet v1
Created July 17, 2012 22:30 — forked from jessieay/ActiveRecord Cheat Sheet v1
Active Record cheat sheet with examples of queries I've needed most so far
ActiveRecord cheat sheet / EXAMPLES
INSTALL
=======
$ gem install activerecord
in GEMFILE: gem ‘activerecord’
REQUIRE
=======
require ‘active_record’
@jackieiscool
jackieiscool / rake_task.rake
Created August 14, 2012 19:24
Trying out rake tasks
namespace :populate do
congresspeople = Sunlight::legislator.all_where(:gender => "M")
task :get_info do
congresspeople.each do |rep|
:firstname = rep.firstname
:lastname = rep.lastname
:bioguide_id = rep.bioguide_id
create_rep(firstname, lastname, bioguide_id)
end
@jackieiscool
jackieiscool / 0_reuse_code.js
Created September 30, 2013 20:39
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console

Exercise - Instructor

Shirt Search Code Along

###Part 1: Review Time 20 min

def roulette(bet, total)
unless total < bet
total -= bet
color = choose_color
if color == "black"
return bet * 2 + total
else
return roulette(bet * 2, total)
end
end