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> | |
<meta charset="utf-8"> | |
<style> | |
body { | |
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; | |
width: 960px; | |
height: 500px; | |
position: relative; | |
} |
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
{ | |
"Blocks": [ | |
{ | |
"Id": "2", | |
"Type": "tofile", | |
"Rule": { | |
"Filename": "doc.json" | |
}, | |
"Position": { | |
"X": 409.991455078125, |
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
{"Blocks":[{"Id":"1","Type":"webRequest","Rule":{"BodyPath":".","Headers":{"Content-Type":"'application/json'"},"Method":"GET","Url":"http://api.crisis.net/item?apikey=YOUR_API_KEY&text=Ebola","UrlPath":""},"Position":{"X":337,"Y":197}},{"Id":"20","Type":"unpack","Rule":{"Path":".body.data"},"Position":{"X":369,"Y":273}},{"Id":"16","Type":"histogram","Rule":{"Path":".name","Window":"1h40m0s"},"Position":{"X":493,"Y":533}},{"Id":"5","Type":"bang","Rule":null,"Position":{"X":306,"Y":120}},{"Id":"8","Type":"tolog","Rule":null,"Position":{"X":320,"Y":511}},{"Id":"23","Type":"unpack","Rule":{"Path":".tags"},"Position":{"X":452,"Y":434}},{"Id":"26","Type":"filter","Rule":{"Filter":"$exists(., 'tags')"},"Position":{"X":407,"Y":346}}],"Connections":[{"Id":"11","FromId":"5","ToId":"1","ToRoute":"in"},{"Id":"21","FromId":"1","ToId":"20","ToRoute":"in"},{"Id":"27","FromId":"20","ToId":"26","ToRoute":"in"},{"Id":"28","FromId":"26","ToId":"23","ToRoute":"in"},{"Id":"29","FromId":"23","ToId":"8","ToRoute":"in"},{"Id":"30", |
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 'sanitize' | |
TO_REMOVE = ["", " ", " "] | |
get '/' do | |
<<-HTML | |
<form method="post" action="sanitize"> | |
<textarea name="dirty" style="width:100%;height:800px;"></textarea> | |
<input type="submit" value="Submit"> |
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
#!/usr/bin/env ruby | |
# Usage: | |
# git clog # prints | |
# git clog -w # writes | |
# | |
# https://gist.github.com/2880525 | |
module Clog | |
extend self |
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
# Adapted from: http://ariejan.net/2010/04/25/ruby-version-and-gemset-in-your-bash-prompt-yes-sir | |
function rvm_version { | |
local gemset=$(echo $GEM_HOME | awk -F'@' '{print $2}') | |
[ "$gemset" != "" ] && echo "@$gemset" | |
} | |
# https://github.com/git/git/blob/master/contrib/completion/git-completion.bash | |
# defines '__git_ps1' current git branch function | |
source ~/.git-completion.bash |
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
# Optimized for writes, sort on read | |
# LVC | |
redis.hset("bonds|1", "bid_price", 96.01) | |
redis.hset("bonds|1", "ask_price", 97.53) | |
redis.hset("bonds|2", "bid_price", 95.50) | |
redis.hset("bonds|2", "ask_price", 98.25) | |
redis.sadd("bond_ids", 1) | |
redis.sadd("bond_ids", 2) |
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
def detail | |
return unless check_format | |
@request = request | |
@version = params[:version] | |
@cycle = params[:cycle].to_i | |
raise ActiveRecord::RecordNotFound if @cycle < 2000 | |
@format = params[:format] | |
@base_uri = base_uri(@request, @cycle, @version) | |
@fec_candidate = FecCandidate.find_with_cycle_and_committee(@cycle.to_i,params[:id]) | |
if not @fec_candidate |
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
$(document).ready(function() { | |
$('.async').live('click', function() { | |
var current = $(this).text(); | |
if ( current == 'show' ) { | |
$(this).text('hide'); | |
} else if (current == 'hide') { | |
$(this).text('show'); | |
} | |
$.getJSON($(this).attr('href'), |
NewerOlder