Skip to content

Instantly share code, notes, and snippets.

View hc5duke's full-sized avatar

Hwan-Joon Choi hc5duke

View GitHub Profile
@hc5duke
hc5duke / nokogiri
Created September 21, 2011 18:31 — forked from softprops/nokogiri
# using rvm with ruby-1.8.7-p249
# latest version 2.7.7 2010-06-17
brew install libxml2
# installing libxslt from source code
wget ftp://xmlsoft.org/libxml2/libxslt-1.1.26.tar.gz
tar xvfz libxslt-1.1.26.tar.gz
cd libxslt-1.1.26
./configure --prefix=/usr/local/Cellar/libxslt/1.1.26 --with-libxml-prefix=/usr/local/Cellar/libxml2/2.7.7
@hc5duke
hc5duke / homework.rb
Created June 30, 2009 07:15 — forked from visnup/homework.rb
I copied visnup!
require 'rubygems'
require 'open-uri'
require 'json'
url = 'http://twitter.com/statuses/user_timeline.json?id=hc5duke&count=3200'
dates = open(url) { |f| JSON.parse f.read }.map { |e| Time.parse e['created_at'] }
sum = dates.inject(Hash.new(0)) { |s, t| s[t.strftime('%Y-%m-%d')] += 1; s }
total = 0
sum.keys.sort.each { |k| puts "#{k}\t#{sum[k]}\t#{total += sum[k]}" }