Skip to content

Instantly share code, notes, and snippets.

View wyattdanger's full-sized avatar

Stephen Bush wyattdanger

View GitHub Profile
@wyattdanger
wyattdanger / cleaner.sh
Created January 11, 2012 16:24
blows away files with the bad perl shebang
for item in /opt/**/*
do
if [ -f $item ]; then
head -n1 $item | grep -q '^#!/opt/local/bin/perl'
if [ $? -eq 0 ]; then
rm $item;
fi
fi
done
// bring in required modules
var fs = require('fs'),
util = require('util'),
jsdom = require('jsdom');
var output = "", texts;
// read sitemap.xml into string
fs.readFile('sitemap.xml', 'utf8', function(err, data) {
if (err) throw err;
==> Downloading https://github.com/petdance/ack/tarball/1.96
File already downloaded in /Users/stephenwyattbush/Library/Caches/Homebrew
/usr/bin/tar xf /Users/stephenwyattbush/Library/Caches/Homebrew/ack-1.96.tgz
==> pod2man ack ack.1
pod2man ack ack.1
==> Exit Status: 2
http://github.com/mxcl/homebrew/blob/master/Library/Formula/ack.rb#L9
==> Environment
HOMEBREW_VERSION: 0.8.1
HEAD: 15fadc11fe6a899b83e587d67a3dc339767180ad
==> Downloading http://ftpmirror.gnu.org/wget/wget-1.13.4.tar.bz2
File already downloaded in /Users/stephenwyattbush/Library/Caches/Homebrew
/usr/bin/tar xf /Users/stephenwyattbush/Library/Caches/Homebrew/wget-1.13.4.tar.bz2
==> ./configure --disable-debug --prefix=/usr/local/Cellar/wget/1.13.4 --with-ssl=openssl --disable-iri
./configure --disable-debug --prefix=/usr/local/Cellar/wget/1.13.4 --with-ssl=openssl --disable-iri
configure: configuring for GNU Wget 1.13.4
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... build-aux/install-sh -c -d
checking for gawk... gawk
@wyattdanger
wyattdanger / webmetrics-example.rb
Created December 21, 2011 21:20
webmetrics.rb
require 'webmetrics'
@wm = Webmetrics::API.new :api_key => 'foo', :username => 'bar'
@wm.request :method => 'maintenance.getServices', :format => :json do |response|
# do stuff with response
end
# Set Apple Terminal.app resume directory
if [[ $TERM_PROGRAM == "Apple_Terminal" ]] && [[ -z "$INSIDE_EMACS" ]] {
function chpwd {
local SEARCH=' '
local REPLACE='%20'
local PWD_URL="file://$HOSTNAME${PWD//$SEARCH/$REPLACE}"
printf '\e]7;%s\a' "$PWD_URL"
}
chpwd
#unbind C-b
set-option -g prefix C-w
bind-key C-w last-window
set -g base-index 1
set-option -g default-terminal "screen-256color"
# act like vim
setw -g mode-keys vi
bind h select-pane -L
bind j select-pane -D
@wyattdanger
wyattdanger / config.ru
Created December 15, 2011 16:10
basic
class App
def call(env)
[
200,
{'Content-Type' => 'text/html'},
[ env['PATH_INFO'] ]
]
end
end
/*
* Simple Pub/Sub Implementation for jQuery
*
* Inspired by work from Peter Higgins (https://github.com/phiggins42/bloody-jquery-plugins/blob/master/pubsub.js)
*
* This is about the simplest way to write a pubsub JavaScript implementation for use with jQuery.
*/
(function($) {
// Cache of all topics
(function() {
var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
$(function() {
var Map, NomsApp, infoBox, nom, textBox;
if (!navigator.geolocation) {
alert('bro you need geolocation');
}
textBox = $('#text');
infoBox = $("#infoBox");
Map = (function() {