Skip to content

Instantly share code, notes, and snippets.

View jackieiscool's full-sized avatar

Jacqueline Herrlin jackieiscool

View GitHub Profile
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

Exercise - Instructor

Shirt Search Code Along

###Part 1: Review Time 20 min

@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
@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 / 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’
class EightBall
def response
response_array = ["Signs point to yes",
"Signs point to no",
"AHAHAHAHA!",
"Outlook is positive",
"No way Jose!"]
response_num = rand(response_array.length)
puts response_output = response_array[response_num]
@jackieiscool
jackieiscool / TWITTER SOME MORE
Created June 26, 2012 01:47
TWITTER SOME MORE
require 'jumpstart_auth'
class JSTwitter
attr_reader :client
def initialize
puts "Initializing"
@client = JumpstartAuth.twitter
end
@jackieiscool
jackieiscool / GAH!
Created June 26, 2012 01:44
Sudoku...started
class Sudoku
def initialize(puzzle) # puzzle == String
@puzzle = puzzle
@cell = Cell.new(puzzle)
@rows = Row.new(puzzle)
@column = Column.new(puzzle)
@three_by_three = ThreeByThree.new(puzzle)
end
end
@jackieiscool
jackieiscool / gist:2958223
Created June 20, 2012 05:06
TWITTER RECURSION CONT...
require 'jumpstart_auth'
class JSTwitter
attr_reader :client
def initialize
puts "Initializing"
@client = JumpstartAuth.twitter
end
@jackieiscool
jackieiscool / Twitter Recursion
Created June 19, 2012 03:09
Twitter Recursion
require 'jumpstart_auth'
class JSTwitter
attr_reader :client
def initialize
puts "Initializing"
@client = JumpstartAuth.twitter
end