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
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. ##
@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)
@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 / 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 / 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 / _.md
Created October 6, 2012 21:36
just another inlet to tributary
@huynguyen
huynguyen / index.html
Created December 5, 2012 08:08 — forked from jeffthink/index.html
Simple d3 Radar Chart
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Simple Radar Chart</title>
<link rel="stylesheet" href="style.css"/>
<script src="http://mbostock.github.com/d3/d3.js?2.5.0"></script>
<script src="radar.js"></script>
</head><body><h1>Simple Radar Chart</h1>
<div id="viz">
</div>
@huynguyen
huynguyen / README.md
Created December 5, 2012 08:36 — forked from mbostock/.block
Stacked Radial Area

This plot might be suitable for showing cyclical trends, though I'm not sure it’s a great idea as the radial display has a number of limitations:

  • The underlying data goes from Sunday to Saturday, but the chart shows continuity from Saturday through to the previous Sunday. Time does not flow backwards, so you might instead prefer to plot two values for Sunday; this would show a discontinuity on opposite sides of the Sunday axis.

  • Displaying the discontinuity requires an open interpolator, rather than cardinal-closed as used here. However, this causes the tangents of the incoming and outgoing lines to no longer be orthogonal to the axis. To display the discontinuity properly, you’d need to write a custom interpolator to generate the correct tangents.

  • Due to the interpolation taking place in Cartesian (rather than polar) coordinates, the intermediate values of the lines do not have the correct radial values: if you tried to measure t

@huynguyen
huynguyen / config.json
Created December 17, 2012 09:53
d3radarplay
{"description":"d3radarplay","endpoint":"","display":"svg","public":true,"require":[],"fileconfigs":{"inlet.js":{"default":true,"vim":false,"emacs":false,"fontSize":12},"traits.csv":{"default":true,"vim":false,"emacs":false,"fontSize":12},"config.json":{"default":true,"vim":false,"emacs":false,"fontSize":12}},"tab":"edit","display_percent":0.6053571428571428,"play":false,"loop":false,"restart":false,"autoinit":true,"pause":true,"loop_type":"period","bv":false,"nclones":15,"clone_opacity":0.4,"duration":3000,"ease":"linear","dt":0.01,"hidepanel":false}
ActiveSupport::Notifications.subscribe "sql.active_record" do |name, start, finish, id, payload|
Rails.logger.debug "=============================================="
Rails.logger.debug "SQL: #{payload[:sql]}"
Rails.logger.debug "=============================================="
Rails.logger.debug caller.join("\n")
Rails.logger.debug "=============================================="
end