This file contains 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
module OAuth | |
module RequestProxy | |
# RequestProxy for Hashes to facilitate simpler signature creation. | |
# Usage: | |
# request = OAuth::RequestProxy.proxy \ | |
# "method" => "iq", | |
# "uri" => [from, to] * "&", | |
# "parameters" => { | |
# "oauth_consumer_key" => oauth_consumer_key, | |
# "oauth_token" => oauth_token, |
This file contains 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 | |
require '/Users/mattb/Work/Dopplr/code/dopplr/config/environment' | |
require 'fire_hydrant' | |
config = YAML.load(File.read("fire_hydrant.yml")) | |
hydrant = FireHydrant.new(config, false) | |
hydrant.jack!(OAuthPubSubJack) | |
hydrant.on_startup do | |
defer :subscribed, 0 do |
This file contains 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
<html> | |
<head> | |
<title>Flickr WOE ID Alpha Shape viewer</title> | |
</head> | |
<body> | |
<style type="text/css"> | |
#ymap{ | |
width:100%; | |
height:100%; | |
left:0px: |
This file contains 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 | |
require 'rexml/document' | |
require 'open-uri' | |
def load_results(url = "http://d.yimg.com/b/data/us/news/xml/elections/2008a/pres.xml") | |
doc = REXML::Document.new(open(url)) | |
nodes = doc.elements.collect("//state") { |node| [node.attributes["name"].downcase, node.elements.collect("cand") { |cand| [cand.attributes["name"].downcase, cand.attributes["PopPct"].to_f, cand.attributes["PopVote"].to_i] }] } | |
votes = {} |
This file contains 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
# even simpler colorization for everything (assuming you're not using a lesspipe.sh already) | |
# (add to your .bashrc) | |
export LESS="-r" | |
export LESSOPEN="|pygmentize %s" |
This file contains 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 'RMagick' | |
get "/" do | |
content_type "image/png" | |
status 200 | |
body RMagick::Image.read("something.png").to_blob | |
end |
This file contains 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
<?xml version="1.0" encoding="utf-8"?> | |
<rsp stat="fail"> | |
<err code="11" msg="Something bad happened" /> | |
</rsp> | |
This file contains 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/php -q | |
<?php | |
/** | |
* Cron job to update the comics plan. | |
*/ | |
/* includes */ | |
$_base = dirname(__FILE__) . '/../'; | |
require_once($_base . 'config.php'); | |
require_once($_base . 'lib/Planworld.php'); |
This file contains 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 | |
require "oauth" | |
require 'oauth/helper' | |
require 'oauth/client/helper' | |
require 'oauth/request_proxy/net_http' | |
require "yaml" | |
require 'oauth_monkey_patches' | |
url = "http://query.yahooapis.com/v1/yql?q=show%20tables&format=xml" |
This file contains 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
#!/bin/bash | |
# | |
# git-svn-diff originally by (http://mojodna.net/2009/02/24/my-work-git-workflow.html) | |
# modified by [email protected] | |
# modified by aconway@[redacted] - handle diffs that introduce new files | |
# | |
# Generate an SVN-compatible diff against the tip of the tracking branch | |
# Get the tracking branch (if we're on a branch) | |
TRACKING_BRANCH=`git svn info | grep URL | sed -e 's/.*\/branches\///'` |
OlderNewer