Skip to content

Instantly share code, notes, and snippets.

View trobrock's full-sized avatar

Trae Robrock trobrock

View GitHub Profile
@trobrock
trobrock / gist:1077018
Created July 11, 2011 23:12
Groovy script for running commands
def proc = ["which", "git"].execute()
proc.waitFor()
println "stdout: ${proc.in.text}"
@trobrock
trobrock / async-thrift-dojo.js
Created July 11, 2011 22:48
Async thrift with dojo
var url = "/txn_store_api";
var t = new Thrift.Transport();
var p = new Thrift.Protocol(t);
var client = new TxnStore.TxnStoreClient(p);
var d = dojo.xhrPost({
url: url,
handleAs: "json",
postData: client.send_getTxns("110237153", []),
load: function(res){
@trobrock
trobrock / glitchy.rb
Created June 21, 2011 04:25
Glitchy gem initializer configuration
GlitchyGem.configure do |config|
config.api_key = "YOUR_API_KEY"
end
Showing app/views/shared/_search_user_form.html.haml where line #1 raised:
negative argument
Extracted source (around line #1):
1: - form_tag(users_path, :method => 'get') do
2: %div
3: -# Email: #{text_field_tag "email"}
4: %div
location / {
if (-f $document_root/system/maintenance.html) {
return 503;
}
try_files $uri $uri/index.html @proxy;
}
error_page 503 @503;
@trobrock
trobrock / mootools-crossfade.js
Created March 15, 2011 22:04
A simple mootools image crossfader
var Crossfade = new Class({
Implements: [Options, Chain],
options: {
duration: 1000
},
initialize: function(element, options) {
this.setOptions(options);
this.element = element;
this.currentIndex = 0;
bundle install --deployment --quiet --without development test
/usr/local/lib/ruby/site_ruby/1.8/rubygems/package/tar_output.rb:65:in `add_gem_contents': uninitialized constant Gem::Package::TarOutput::Zlib (NameError)
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/package/tar_writer.rb:113:in `add_file'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/package/tar_output.rb:63:in `add_gem_contents'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/package/tar_output.rb:31:in `open'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/package.rb:68:in `open'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/builder.rb:77:in `write_package'
from /usr/local/lib/ruby/1.8/open-uri.rb:32:in `open_uri_original_open'
from /usr/local/lib/ruby/1.8/open-uri.rb:32:in `open'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/builder.rb:76:in `write_package'
sudo gem update --system --backtrace
Updating rubygems-update
ERROR: While executing gem ... (NameError)
uninitialized constant Gem::Package::TarInput::Zlib
/usr/local/lib/ruby/site_ruby/1.8/rubygems/package/tar_input.rb:49:in `initialize'
/usr/local/lib/ruby/site_ruby/1.8/rubygems/package/tar_reader.rb:64:in `each'
/usr/local/lib/ruby/site_ruby/1.8/rubygems/package/tar_reader.rb:55:in `loop'
/usr/local/lib/ruby/site_ruby/1.8/rubygems/package/tar_reader.rb:55:in `each'
/usr/local/lib/ruby/site_ruby/1.8/rubygems/package/tar_input.rb:32:in `initialize'
/usr/local/lib/ruby/site_ruby/1.8/rubygems/package/tar_input.rb:17:in `new'
var paramify = function(hash){
var attrs = [];
for (var k in hash) {
attrs.push(k + "=" + hash[k]);
}
attrs = attrs.sort();
return attrs.join('&');
var pnlChart = {
INCOME: [
{ interval: "Jan 2011", value: 100, name: null },
{ interval: "Feb 2011", value: 200, name: null },
{ interval: "Mar 2011", value: 300, name: null }
],
EXPENSE: [
{ interval: "Jan 2011", value: 100, name: null },
{ interval: "Feb 2011", value: 200, name: null },
{ interval: "Mar 2011", value: 300, name: null }