Skip to content

Instantly share code, notes, and snippets.

View redsquirrel's full-sized avatar
🐿️

Dave Hoover redsquirrel

🐿️
  • Flexa, Inc.
  • Evanston, IL
  • 22:59 (UTC -05:00)
  • X @davehoover
View GitHub Profile
@redsquirrel
redsquirrel / cs-man-of-the-year.txt
Created February 18, 2015 04:17
The first ever Computer Science "Man of the Year"
The first ever Computer Science "Man of the Year"...
...had a PhD in mathematics from Yale, and was a professor of math.
...joined the Navy at age 37 to help with World War II.
...learned to program as one of the original programmers of the Mark 1 at Harvard, which was instrumental in
completing the Manhatten project.
...became the Head of Software at the first computer-focused tech startup, which created the first popular
@redsquirrel
redsquirrel / linkedin_api_search.rb
Created April 30, 2014 17:49
Trying (and failing) to use the LinkedIn Search API
require 'rubygems'
require 'linkedin'
client = LinkedIn::Client.new('75abcxm123himom', 'NDwtffWomglylolV')
request_token = client.request_token({}, :scope => "r_network")
rtoken = request_token.token
rsecret = request_token.secret
a = [1,2,3,4,4]
def mode(a)
h = {()} # what are these parentheses?
a.length.times do |i|
# Code block?
end
end
# some Ruby code here
def method_being_worked_on
# awesome code
end
@redsquirrel
redsquirrel / setup.md
Last active December 12, 2015 12:09
Laptop setup for Fundamentals of Web Development: a day with Dev Bootcamp Chicago

Do you have Ruby installed?

Do you have SQLite installed?

@redsquirrel
redsquirrel / 2013_chicago_devbootcamp_mascots.txt
Last active December 12, 2015 08:19
Every @devbootcamp cohort is named after an indigenous animal from that location's state. Here are the mascots for Chicago in 2013.
Squirrels 04/22
Foxes 05/13
Otters 06/03
Grasshoppers 06/24
Dragonflies 07/15
Nighthawks 08/05
Fireflies 08/26
Coyotes 09/16
Salamanders 10/07
def fib_recursive(i, m = 0, n = 1, count = 0)
return m if count == i
fib_recursive(i, n, m+n, count+1)
end
def fib_iterative(i)
m, n = 0, 1
i.times do
m, n = n, m+n
end
@redsquirrel
redsquirrel / _trending.html.erb
Created August 7, 2012 18:20 — forked from tjarmain/_trending.html.erb
Trying to set up rendering of partials within tabs using AJAX
array.each_with_index do |line, index|
if line.match(/^<s>/i)
start = index
splits = line.scan(/<(?:s|c)>\s*/i).map(&:size)
end
# detect a line that's all dashes and spaces
if line.match(/^[\- ]+$/)
start = index
# scan for dashes followed by a space
@redsquirrel
redsquirrel / bowling_score.rb
Created July 15, 2012 00:43
In which I realize that the scoring logic for strikes and spares are the same. (3 consecutive balls)
require 'test/unit'
def score(*frames)
score = roll_count = 0
rolls = frames.flatten
frames.each do |frame|
if sum(frame) == 10
score += sum(next_three(rolls, roll_count))
else
score += sum(frame)