Skip to content

Instantly share code, notes, and snippets.

View aaronmoodie's full-sized avatar
Coffee

Aaron Moodie aaronmoodie

Coffee
View GitHub Profile
@andrewharvey
andrewharvey / bom-radar-fetch.pl
Created November 5, 2011 00:48
Fetches BOM.gov.au radar images giving us a local mirror, including historical data.
#!/usr/bin/perl -w
# Fetches BOM.gov.au radar images giving us a local mirror, including historical
# data.
#
# Radar images are updated every 10 minutes, but the BOM only keep the last
# hour and 10 minutes worth of radar images on their FTP server. With this in
# mind I would recommend running this script anywhere from minutely to hourly.
#
# This script is licensed CC0 by Andrew Harvey <andrew.harvey4@gmail.com>
@hackable
hackable / expressjs-base64-image.js
Created October 18, 2011 05:21
Node.js base64 encode a downloaded image for use in data URI
express = require("express")
request = require("request")
BufferList = require("bufferlist").BufferList
app = express.createServer(express.logger(), express.bodyParser())
app.get "/", (req, res) ->
if req.param("url")
url = unescape(req.param("url"))
request
uri: url
encoding: 'binary'
@igrigorik
igrigorik / webapp.rb
Created November 13, 2010 21:28
Inspired by @JEG2's talk at Rubyconf... Any ruby object, as a webapp! 'Cause we can. :-)
require 'rubygems'
require 'rack'
class Object
def webapp
class << self
define_method :call do |env|
func, *attrs = env['PATH_INFO'].split('/').reject(&:empty?)
[200, {}, send(func, *attrs)]
end
@jeffrafter
jeffrafter / server.js
Created August 28, 2010 21:37
Twitter OAuth with node-oauth for node.js+express
var express = require('express');
var sys = require('sys');
var oauth = require('oauth');
var app = express.createServer();
var _twitterConsumerKey = "YOURTWITTERCONSUMERKEY";
var _twitterConsumerSecret = "YOURTWITTERCONSUMERSECRET";
function consumer() {
@phatduckk
phatduckk / Gistson.php
Created December 7, 2009 08:54
Embed a Gist in Wordpress
<?php
/*
Plugin Name: Gistson - Embedded Gist WP Plugin
Plugin URI: http://arin.me/blog/tag/gistson
Description: Use a shortcode [gist id="12345"] to embed A Gist from http://gist.github.com into your blog
Version: 0.1
Author: Arin Sarkissian
Author URI: http://arin.me
Copyright 2009 Arin Sarkissian