Skip to content

Instantly share code, notes, and snippets.

View craftninja's full-sized avatar
ensorcelling

Emily Platzer craftninja

ensorcelling
  • Boulder, Colorado
View GitHub Profile
@craftninja
craftninja / coderwall.md
Last active August 29, 2015 14:08
Coderwall setup
@craftninja
craftninja / gSchool June 2014 Demo.md
Last active August 29, 2015 14:02
A list of apps demoed on June 3, 2014 by the Boulder class of gSchool
@craftninja
craftninja / battle_of_the_games_contestants.md
Last active August 29, 2015 14:01
Quickleft's Battle of the Games Hackfest 2014
   ____        _      _    _       __ _   _        
  / __ \      (_)    | |  | |     / _| | ( )       
 | |  | |_   _ _  ___| | _| | ___| |_| |_|/ ___    
 | |  | | | | | |/ __| |/ | |/ _ |  _| __| / __|   
 | |__| | |_| | | (__|   <| |  __| | | |_  \__ \   
  \___\_\\__,_|_|\___|_|\_|_|\___|_|  \__| |___/   
 |  _ \      | | | | | |             / _|          
 | |_) | __ _| |_| |_| | ___    ___ | |_           
 |  _ < / _` | __| __| |/ _ \  / _ \|  _|          
 | |_) | (_| | |_| |_| |  __/ | (_) | |            
data = [1,2,3,2,2,1,4,5,4,3]
result = data.reduce(Hash.new {|hash, key| hash[key] = []}) do |hash, number|
hash[number] << number
hash
end
result = {}
data.each do |number|
result[number] ||= []
@craftninja
craftninja / http_response.rb
Created May 6, 2014 19:42
Warmups - parsing http - first pomodoro (finishup)
require 'faraday'
require 'json'
class HttpResponse
def initialize(url)
@response = Faraday.get url
end
def headers
@response.body
class Dogs
POOR = (0..5).to_a.sample
AVERAGE = (6..10).to_a.sample
EXCELLENT = (11..15).to_a.sample
def initialize
joe = {
:name => {:first => "Joe", :last => "Smith"},
:owner_quality => EXCELLENT
}
@craftninja
craftninja / Warmups-iterating-arrays-of-hashes-01
Created May 1, 2014 15:21
Dogs warmup - no using each methods
class Dogs
POOR = (0..5).to_a.sample
AVERAGE = (6..10).to_a.sample
EXCELLENT = (11..15).to_a.sample
def initialize
joe = {
:name => {:first => "Joe", :last=> "Smith"},
:owner_quality => EXCELLENT
}
class Dogs
POOR = (0..5).to_a.sample
AVERAGE = (6..10).to_a.sample
EXCELLENT = (11..15).to_a.sample
def initialize
joe = {
:name => {:first => "Joe", :last=> "Smith"},
:owner_quality => EXCELLENT
}