Skip to content

Instantly share code, notes, and snippets.

View jdhuntington's full-sized avatar
🏎️
-><-

JD Huntington jdhuntington

🏎️
-><-
View GitHub Profile
my_user = {
:user => {
:name => {
:first => 'JD'
}
},
:object => nil
}

Keybase proof

I hereby claim:

  • I am jdhuntington on github.
  • I am jdhuntington (https://keybase.io/jdhuntington) on keybase.
  • I have a public key whose fingerprint is BCEA 5F12 DA19 9B1B 5F28 9FE0 9892 4E15 31ED EF0E

To claim this, I am signing this object:

@jdhuntington
jdhuntington / template.json
Created July 2, 2015 19:44
provisioningtemplate
This is a test
#!/usr/bin/env ruby
require 'rubygems'
require 'mechanize'
require 'digest/md5'
BASE_URL = 'http://www.instapaper.com'
LOGIN_URL = 'http://www.instapaper.com/user/login'
USERNAME = ARGV.first
token: fedcba9876543210aabbccddeeff112233445566 # Token from lighthouse
account: mycompany # part of http://mycompany.projectdx.com/projects/1234-project-name/
status: fixed # status tickets should have when they're fixed
project: 1234 # part of http://mycompany.projectdx.com/projects/1234-project-name/
$ bugflow start 123
# now working on branch 'bf123-fix-a-serious-bug'
{ ... do some work ... }
$ git add <files>
$ bugflow fixed "Commit message here" # Or just 'bugflow fixed' to edit message in EDITOR
# committed revision abcdef "Commit message here [#123 state:verify assign:none]"
{ ... merge branch and push ... }
#!/usr/bin/env ruby
# Add books from http://sivers.org/book to a couch db
# todo - parse author out of 'title' field
require 'rubygems'
require 'couchrest'
require 'nokogiri'
require 'open-uri'
require 'clip'
import Data.List
triangulate x = x * ( 1 + x ) / 2
pentagulate x = x * ( 3 * x - 1 ) / 2
hexagulate x = x * ( 2 * x - 1 )
triangles = [ triangulate x | x <- [1..] ]
pentagons = [ pentagulate x | x <- [1..] ]
memberOfIncreasingSequence x = (==x).head.dropWhile(<x)
@jdhuntington
jdhuntington / each_or_inject.rb
Created February 15, 2011 19:00
Testing whether or not Enumerable#inject works well with a Hash.
require 'rubygems'
require 'ruby-prof'
require 'digest/md5'
$x = (1..100_000).to_a.map { |x| Digest::MD5.hexdigest(x.to_s) }
abort "Usage: #{__FILE__} (time|allocations) (inject|each)" if ARGV.length != 2
if ARGV[0] == 'time'
RubyProf.measure_mode = RubyProf::PROCESS_TIME
@jdhuntington
jdhuntington / gist:1847126
Created February 16, 2012 19:22
PDX Lunch