Skip to content

Instantly share code, notes, and snippets.

View warthurton's full-sized avatar

Wayne Arthurton warthurton

View GitHub Profile

Keybase proof

I hereby claim:

  • I am warthurton on github.
  • I am warthurton (https://keybase.io/warthurton) on keybase.
  • I have a public key whose fingerprint is 0F35 F2F2 5C98 E9E9 D515 EC3F 605F BC68 E81F 6532

To claim this, I am signing this object:

Code to make a markdown version of the twitter embed code. See result picture from DayOne at http://note.io/1iXW8Xl

on alfred_script(q)
tell application "System Events"
set numChrome to count (every process whose name is "Google Chrome")
if numChrome > 0 then
tell process "Google Chrome"
click menu item "pbrl" of menu "Bookmarks" of menu bar 1
end tell
end if
end tell
@warthurton
warthurton / play_all_voices.sh
Last active August 29, 2015 14:26 — forked from ttscoff/play_all_voices.sh
A quick Bash loop to play all available voices for OS X say command
#!/bin/bash
# Arguments can include a quoted string to define the test string to be repeated
# If an argument is numbers only, it changes the rate at which to speak (words per minute, default 200)
play_all_voices() {
local voice
local rate=200
local test_string="How are you?"
for arg in $@; do
if [[ $arg =~ ^[0-9]+$ ]]; then
@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: