Skip to content

Instantly share code, notes, and snippets.

View huynguyen's full-sized avatar
😇
Is this the BAD PLACE?

Huy Nguyen huynguyen

😇
Is this the BAD PLACE?
View GitHub Profile
@huynguyen
huynguyen / huy.rb
Created January 5, 2012 08:29
Joe's Problem
#!/usr/bin/env ruby
require 'csv'
# Real men use ruby1.9 thus not needing rubygems require and FasterCSV was
# folded into std-lib csv. Plus I had all these lines to waste on snarky
# comments. :P
puts CSV.read("joe.csv").flatten!.inject(Hash.new(0)) {|h,x| h[x] += 1; h}
# hnguyen@taengoo:~ ಠ_ಠ >> ./huy.rb
@huynguyen
huynguyen / gist:1329273
Created October 31, 2011 22:42
ruby-1.9.3-p0 ruby-debug and rvm
#Need the latest version so it knows where to get ruby-1.9.3
rvm get head
curl -O https://github.com/ruby/ruby/pull/56.diff
rvm install ruby-1.9.3-p0 --patch 56.diff
cd ~/.rvm/src/ruby-1.9.3-p0
# Need to recompile because rvm doesn't force autoconf?
@huynguyen
huynguyen / bash_output.log
Created June 9, 2011 22:53
edge rails and rbx 2.0.0pre
hnguyen@hnguyen:~/github/showme_rbx$ gem install rails --pre --no-ri --no-rdoc
Fetching: multi_json-1.0.3.gem (100%)
Fetching: activesupport-3.1.0.rc3.gem (100%)
Fetching: builder-3.0.0.gem (100%)
Fetching: i18n-0.6.0.gem (100%)
Fetching: bcrypt-ruby-2.1.4.gem (100%)
Building native extensions. This could take a while...
Fetching: activemodel-3.1.0.rc3.gem (100%)
Fetching: rack-1.3.0.gem (100%)
Fetching: rack-cache-1.0.2.gem (100%)
@huynguyen
huynguyen / irb.rb
Created June 8, 2011 22:58
rails console
ree-1.8.7-2011.03 :024 > hb788.document.path
=> "/home/hnguyen/github/opengovernment/public/system/bill_documents/000/021/611/original/streamdocument.asp"
ree-1.8.7-2011.03 :025 > Docsplit.extract_text(hb788.document.path, :ocr => false, :pages => 'all', :output => 'public/')
Docsplit::ExtractionFailed: Exception in thread "main" org.artofsolving.jodconverter.office.OfficeException: could not load document: streamdocument.asp
at org.artofsolving.jodconverter.AbstractConversionTask.loadDocument(AbstractConversionTask.java:101)
at org.artofsolving.jodconverter.AbstractConversionTask.execute(AbstractConversionTask.java:62)
at org.artofsolving.jodconverter.office.PooledOfficeManager$2.run(PooledOfficeManager.java:81)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by nitrogen configure 1.5.1, which was
generated by GNU Autoconf 2.65. Invocation command line was
$ ./configure --enable-debug
## --------- ##
## Platform. ##