Skip to content

Instantly share code, notes, and snippets.

View rguerrettaz's full-sized avatar

Ryan Guerrettaz rguerrettaz

  • HealthSherpa
  • San Francisco Bay Area
View GitHub Profile
@rguerrettaz
rguerrettaz / gist:5380457
Created April 13, 2013 22:53
Rspec example
require 'rspec'
require_relative '../assessment_week2'
describe Vehicle do
subject { Vehicle.new(Hash[color: "black", wheels: 2]) }
it { should be_instance_of Vehicle }
its (:wheels) { should == 2 }
@rguerrettaz
rguerrettaz / fortune_teller.rb
Last active December 17, 2015 06:19
Method to predict your experience in Phase 3 of Dev Bootcamp
def tell_fortune( previous_rails_knowledge=nil, prep=nil )
good_luck = "Gloomy, your future looks. Pain and suffering, you will experience."
return good_luck if prep.nil? && previous_rails_knowledge.nil?
"The force is strong in you. Succeed, you will."
end
# Tests
@rguerrettaz
rguerrettaz / csv_parser.rb
Last active December 17, 2015 14:38
csv parser. takes 2 csv files and combines them together to make one without duplicates
require 'csv'
# Handles csv's with varrying total columns
# Does not handle headers yet
# This method serves as initialize method; calls all other methods
# Takes 2 csv files as arguments
# First csv should be original file
# Second should be the updated file
def update_csv(orig_file, new_file)
@rguerrettaz
rguerrettaz / jquery_update.js
Created March 10, 2014 16:49
Use newest version of jQuery in Crowdflower job
require(['jquery-noconflict', 'bootstrap-modal', 'bootstrap-tooltip', 'bootstrap-popover', 'bootstrap-tab', 'jquery-cookie'], function (_, modal, jQuery) {
//Ensure MooTools is where it must be
Window.implement('$', function (el, nc) {
return document.id(el, nc, this.document);
});
// set jQuery object
var jQuery1_7 = window.jQuery;
// Load latest version of jquery
@rguerrettaz
rguerrettaz / errors.txt
Created August 13, 2015 17:40
Fuck you flower ai
sandbox u=!make $> bundle
--- ERROR REPORT TEMPLATE -------------------------------------------------------
- What did you do?
I ran the command `/Users/ryan/.rbenv/versions/2.1.6/bin/bundle `
- What did you expect to happen?
I expected Bundler to...