Skip to content

Instantly share code, notes, and snippets.

View jacqui's full-sized avatar

Jacqui Lough jacqui

View GitHub Profile
{"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",
{
"Blocks": [
{
"Id": "2",
"Type": "tofile",
"Rule": {
"Filename": "doc.json"
},
"Position": {
"X": 409.991455078125,
@jacqui
jacqui / Rails MongoMapper Template.rb
Created December 10, 2009 02:35 — forked from banker/Rails MongoMapper Template.rb
Removed the application layout file as it kept barfing on it
# mongo_template.rb
# fork of Ben Scofield's Rails MongoMapper Template (http://gist.github.com/181842)
#
# To use:
# rails project_name -m http://gist.github.com/253067.txt
# remove unneeded defaults
run "rm public/index.html"
run "rm public/images/rails.png"
run "rm public/javascripts/controls.js"
<%= f.select(:role_id, options_from_collection_for_select(@roles, "id", "to_s"), {:include_blank => true, :selected => nil}) %>
>> m = {:fn=>"Mark Wunsch", :title=>["Front End Engineer at Scripps Networks"], :n=>{:family_name=>["Wunsch"], :given_name=>["Mark"]}, :adr=>[{:locality=>["Greater New York City Area"]}]}
# => {:fn=>"Mark Wunsch", :adr=>[{:locality=>["Greater New York City Area"]}], :n=>{:family_name=>["Wunsch"], :given_name=>["Mark"]}, :title=>["Front End Engineer at Scripps Networks"]}
>> m.class
# => Hash
>> m.to_yaml
# => "--- \n:fn: Mark Wunsch\n:adr: \n- :locality: \n - Greater New York City Area\n:n: \n :family_name: \n - Wunsch\n :given_name: \n - Mark\n:title: \n- Front End Engineer at Scripps Networks\n"
$ ruby -v
We couldn’t find that file to show.
$(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'),
@jacqui
jacqui / gist:573815
Created September 10, 2010 15:17 — forked from dwillis/gist:573813
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
@jacqui
jacqui / .profile
Created December 15, 2011 19:52 — forked from tysone/snippet.sh
Display current rvm gemset and git branch in your prompt (bash).
# 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
@jacqui
jacqui / git-clog
Created October 25, 2012 12:13 — forked from rstacruz/git-clog
Git changelog helper
#!/usr/bin/env ruby
# Usage:
# git clog # prints
# git clog -w # writes
#
# https://gist.github.com/2880525
module Clog
extend self