Skip to content

Instantly share code, notes, and snippets.

View warthurton's full-sized avatar

Wayne Arthurton warthurton

View GitHub Profile
@warthurton
warthurton / inputrc
Created November 9, 2010 01:37
Commented inputrc
cat > /etc/inputrc << "EOF"
# Begin /etc/inputrc
# Modified by Chris Lynn <roryo@roryo.dynup.net>
# Allow the command prompt to wrap to the next line
set horizontal-scroll-mode Off
# Enable 8bit input
set meta-flag On
set input-meta On
#!/bin/bash
inputfile=$1
outfile=$2
temp1=$$.wav
exitcode=0
if [ ${inputfile: -4} == ".mp3" ]
then
lame -S --decode $inputfile $temp1
else
@warthurton
warthurton / myip
Created August 4, 2011 19:40
TextExpander Local IP
#!/bin/bash
active_interface=`netstat -rn | grep 'default' | awk '{print $6}'`
ifconfig | grep -A 1 $active_interface | grep 'inet ' | awk '{printf $2}'
@warthurton
warthurton / pubip
Created August 4, 2011 19:55
TextExpander Public IP
#!/bin/bash
curl -s http://automation.whatismyip.com/n09230945.asp
@warthurton
warthurton / gist:1256497
Created October 1, 2011 18:59
Postgres Fail
==> Downloading http://ftp9.us.postgresql.org/pub/mirrors/postgresql/source/v9.0
File already downloaded in /Users/warthurton/Library/Caches/Homebrew
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/fileutils.rb:243: command not found: uuid-config --cflags
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/fileutils.rb:243: command not found: uuid-config --ldflags
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/fileutils.rb:243: command not found: uuid-config --libs
==> ./configure --disable-debug --prefix=/usr/local/Cellar/postgresql/9.0.4 --en
checking build system type... x86_64-apple-darwin11.1.0
checking host system type... x86_64-apple-darwin11.1.0
checking which template to use... darwin
checking whether to build with 64-bit integer date/time support... yes
@warthurton
warthurton / pinboard-full.js
Created December 13, 2011 01:39 — forked from BenWard/pinboard-full.js
A smarter bookmarklet for Pinboard.in; wraps selected text in <blockquote> tags, keeps variables out of the global scope, supports filling tags from rel="tag" markup in the page, and titles from hAtom entry titles.
(function() {
// Change `silent` to true to invoke the promptless, self-closing
// version of the bookmarklet.
var silent = false;
var url = location.href;
var title = document.title;
// Look for a single hAtom entry on the page, and iff one is found, extract
// the entry-title in place of the document title:
@warthurton
warthurton / config.rb
Created February 23, 2012 04:04
Octopress config.rb
# Require any additional compass plugins here.
project_type = :stand_alone
# Publishing paths
http_path = "/"
http_images_path = "http://cdn.warthurton.com/images"
http_fonts_path = "http://cdn.warthurton.com/fonts"
css_dir = "http://cdn.warthurton.com/public/stylesheets"
# Local development paths
@warthurton
warthurton / tmux.conf
Created March 2, 2012 17:56
TMUX config
# Make it use C-a, similar to screen..
unbind C-b
unbind l
set -g prefix C-a
bind-key C-a last-window
bind-key a send-prefix
set -g base-index 1
# Reload key
@warthurton
warthurton / gist:2294351
Created April 3, 2012 18:16
Booleans are cool
public boolean isBooleanFalse(boolean value) {
boolean response = false;
if (value == true) {
response = false;
} else {
response = true;
}
return response;
}
(?:^|,)(\\\"(?:[^\\\"]+|\\\"\\\")*\\\"|[^,]*)