Skip to content

Instantly share code, notes, and snippets.

View janester's full-sized avatar

Jane Sternbach janester

  • New York, NY
View GitHub Profile
@janester
janester / parsing.rb
Created June 27, 2013 18:25
Parsing Exercise for WDI2-SF: you will not be able to run the file unless you have all the gems listed at the top installed!
require "pry"
require "pry-debugger"
require "soundcloud"
require "nokogiri"
require "open-uri"
#1. Parse through the wdi2 hash and make a function that returns a hash where the
#keys are each persons name and the value is their favorite movies
wdi2 = {:instructors => [{:name => "jane", :gender => "female", :favorite_movies => ["the dark knight rises", "the dark knight", "batman begins"], :favorite_foods =>["tacos", "tamales", "enchiladas"]}, {:name => "sumeet", :gender => "male", :favorite_movies => ["x-men", "x2", "x3: the last stand", "x-men: first class"], :favorite_foods=>["pizza", "pasta", "cheese"]}, {:name => "dwayne", :gender => "male", :favorite_movies=>["harry potter 1", "harry potter 2", "harry potter 3", "harry potter 4"]}], :students => [{:name => "tom", :favorite_movie => "the hunger games"},{:name => "christina", :favorite_movie=>"my fair lady"},{:name=>"baylee", :favorite_movie=>"mary poppins"}, {:name =>"jason", :favorite_movie =>"the sound of music"}, {:name => "zara", :favorite_movie => "
@janester
janester / quickly.rb
Last active December 19, 2015 11:59 — forked from BrainScraps/quickly.rb
#This is a script that I made for quickly creating a new directory, GitHub repository,
#local respository, and linking the two up - all with one command!
#Dependencies:
#git
#github account & credentials
#the 'octokit' gem (gem install octokit)
#Usage:
#First, edit the script to include your GitHub username and password.
@janester
janester / binary_tree.rb
Created August 7, 2013 00:28
binary tree example for WDI-SF-MAY
require "pry"
require "pry-debugger"
require "pry-stack_explorer"
class Node
attr_accessor :data, :nxt, :prv
def initialize(data)
self.data = data
@janester
janester / gist:eb16ba51b8e269b1945f
Created September 16, 2014 21:23
Benchmark Results For Keeping the Files in Memory as IO Streams
##################### ORIGINAL #####################################
user system total real
transform only 200x200> 0.120000 0.020000 2.050000 ( 2.146060)
transform only 200x200> 0.010000 0.020000 1.940000 ( 2.010794)
transform only 200x200> 0.130000 0.030000 2.050000 ( 2.114612)
transform only 200x200> 0.000000 0.020000 1.920000 ( 2.013042)
transform only 200x200> 0.130000 0.030000 2.040000 ( 2.124130)
transform only 200x200> 0.010000 0.020000 1.950000 ( 2.026902)
transform only 200x200> 0.120000 0.030000 2.030000 ( 2.105908)
transform only 200x200> 0.010000 0.030000 1.970000 ( 2.037373)