This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc | |
| . ~/.bashrc | |
| mkdir ~/local | |
| mkdir ~/node-latest-install | |
| cd ~/node-latest-install | |
| curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1 | |
| ./configure --prefix=~/local | |
| make install # ok, fine, this step probably takes more than 30 seconds... | |
| curl http://npmjs.org/install.sh | sh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'rubygems' | |
| require 'sinatra' | |
| helpers do | |
| def request_headers | |
| env.inject({}){|acc, (k,v)| acc[$1.downcase] = v if k =~ /^http_(.*)/i; acc} | |
| end | |
| end | |
| get '/headers' do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Choose a ticket class: <select id="tickets"></select> | |
| <p id="ticketOutput"></p> | |
| <script id="ticketTemplate" type="text/x-jquery-tmpl"> | |
| {{if chosenTicket}} | |
| You have chosen <b>${ chosenTicket().name }</b> | |
| ($${ chosenTicket().price }) | |
| <button data-bind="click: resetTicket">Clear</button> | |
| {{/if}} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| =begin | |
| Usage: /bin/hbase shell cellcounter.rb | |
| =end | |
| import java.text.SimpleDateFormat | |
| import java.text.ParsePosition | |
| import java.util.Date | |
| import org.apache.hadoop.hbase.client.HTable | |
| import org.apache.hadoop.hbase.client.Scan |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| =begin | |
| Usage: /bin/hbase shell rowdeleter.rb | |
| =end | |
| import java.text.SimpleDateFormat | |
| import java.text.ParsePosition | |
| import java.util.Date | |
| import org.apache.hadoop.hbase.client.Delete | |
| import org.apache.hadoop.hbase.client.HTable |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| all: json2bson | |
| clean: | |
| rm -f json2bson | |
| json2bson: json2bson.c | |
| ${CC} $(shell pkg-config --cflags json libmongo-client glib-2.0) -Wall -O0 -ggdb3 -std=c99 ${CFLAGS} \ | |
| $(shell pkg-config --libs json libmongo-client glib-2.0) -o $@ $^ | |
| check: all | |
| ./json2bson <test.json >test.bson |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <script type="text/javascript" src="http://mbostock.github.com/d3/d3.js?1.27.1"></script> | |
| <style type="text/css"> | |
| div.tooltip { | |
| position: absolute; | |
| text-align: center; | |
| width: 60px; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'rubygems' | |
| require 'mechanize' | |
| require 'nokogiri' | |
| class NokogiriParser < Mechanize::Page | |
| attr_reader :noko | |
| def initialize uri = nil, response = nil, body = nil, code = nil | |
| @noko = Nokogiri. | |
| super uri, response, body, code | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'sinatra' | |
| require 'mongoid' | |
| require 'json' | |
| require 'jsonp' | |
| require 'rack/throttle' | |
| require 'dalli' | |
| set :cache, Dalli::Client.new("localhost:11211") | |
| set :short_ttl, 400 | |
| set :long_ttl, 4600 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var area_graph = { | |
| margin: [40, 40, 40, 100], | |
| width: 1160, | |
| height: 460, | |
| div_id: '#areagraph', | |
| json: '', | |
| draw: function() { | |
| var computed_height = this.height - this.margin[1] - this.margin[3]; | |
| var computed_width = this.width - this.margin[0] - this.margin[2]; |