Skip to content

Instantly share code, notes, and snippets.

View IanVaughan's full-sized avatar
👯‍♀️
OMG

Ian Vaughan IanVaughan

👯‍♀️
OMG
View GitHub Profile
@IanVaughan
IanVaughan / flickr gem 1.0.2.rb
Created February 22, 2011 22:47
flickr gem 1.0.2 installed from default server does not work too well!
ruby-1.9.2-p0 :001 > require 'rubygems' # required?
=> true
ruby-1.9.2-p0 :002 > require 'flickr'
=> true
ruby-1.9.2-p0 :003 > f = Flickr.new('xxxxxxxxxxxxxxxxxxxxxxxxxxxxx')
=> #<Flickr:0xa713dc4 @api_key="xxxxxxxxxxxxxxxxxxxxxxxxxxxxx", @host="http://flickr.com", @api="/services/rest">
ruby-1.9.2-p0 :004 > u = f.users('Ian Vaughan')
ArgumentError: File does not exist: .
from /home/ian/.rvm/gems/ruby-1.9.2-p0/gems/xml-simple-1.0.14/lib/xmlsimple.rb:983:in `find_xml_file'
@IanVaughan
IanVaughan / KillValgrind.sh
Created April 15, 2011 08:25
Bash command line to kill one-by-one any valgrind processes running
kill `ps aux | grep [v]algrind | awk '{print $2}' | tail -n1`
@IanVaughan
IanVaughan / TopMine.sh
Created April 15, 2011 08:26
Shows via 'top' only the processes of a given name
#!/bin/bash
PIDS=`ps aux | grep "[n]ame" | awk '{print $2}'`
if [ $PIDS = "" ]; then
exit
fi
PID_LIST=
for pid in $PIDS; do
PID_LIST="-p$pid $PID_LIST"
done
top ${PID_LIST}
@IanVaughan
IanVaughan / record.sh
Created September 17, 2011 22:31
Linux Bash script to record the audio stream for a period of time
#!/bin/bash
FILENAME=$1
HOURS=$2
SECONDS=$((3600 * ${HOURS}))
echo "Recording ${FILENAME} for ${SECONDS} seconds..."
rec -c 2 ${FILENAME}.ogg trim 0 ${SECONDS} #7200
@IanVaughan
IanVaughan / gist:1325768
Created October 30, 2011 10:34
git alias
# http://gitready.com/intermediate/2009/02/06/helpful-command-aliases.html
git config --global alias.rb rebase
git config --global alias.st status
git config --global alias.ci commit
git config --global alias.br branch
git config --global alias.co checkout
git config --global alias.df df
git config --global alias.lg log -p
@IanVaughan
IanVaughan / monitor.sh
Created January 3, 2012 18:53
Bash script that monitors a directory of source files for changes, then does something (like build) if changed.
#!/bin/bash
# Bash script that monitors a directory of source files for changes, then does something (like build) if changed.
# It does this via creating a SHA of the ls tree of the folder in question, and if changed, triggers the action.
# The "action" is just the variable $command, normally make.
# Usage :
# ./monitor.sh
# Then save a file, and it gets built! Magic!
command="make"
params=""
@IanVaughan
IanVaughan / monitor2.sh
Created January 3, 2012 18:57
Update to monitor.sh, this time its serious! This monitors a group of directories, and if a file in one of them changes it only actions that directory command.
#!/bin/bash
# Update to monitor.sh, this time its serious!
# This monitors a group of directories for source file changes, and if a file in one of them changes it only actions that directory command.
# It does this via creating a SHA of the ls tree of the folder in question, and if changed, triggers the action.
# The "action" is just the variable $command, normally make.
# Usage :
# ./monitor.sh
# Then save a file, and it gets built! Magic!
@IanVaughan
IanVaughan / output
Created February 28, 2012 12:10
brew install gpg
$ brew doctor
Your system is raring to brew.
$ brew update
Already up-to-date.
$ brew install -v gpg
==> Downloading ftp://ftp.gnupg.org/gcrypt/gnupg/gnupg-1.4.12.tar.bz2
File already downloaded in /Users/ivaughan/Library/Caches/Homebrew
/usr/bin/tar xf /Users/ivaughan/Library/Caches/Homebrew/gnupg-1.4.12.tar.bz2
@IanVaughan
IanVaughan / git-up-all.rb
Created March 26, 2012 16:01
Update all repos in one shot
# with git-up (gem install git-up)
`ls`.split.each { |f| `cd #{f}; git up` }
@IanVaughan
IanVaughan / output
Created May 7, 2012 09:58
Can't require local installed gem
$ gem install /Users/ivaughan/dev/ianvaughan/ruby_kml/ruby_kml-0.0.1.gem ✹ ✭master ‹1.9.3-p125›
Successfully installed ruby_kml-0.0.1
1 gem installed
$ gem list ruby_kml ✹ ✭master ‹1.9.3-p125›
*** LOCAL GEMS ***
ruby_kml (0.0.1)
$ gem contents ruby_kml ✹ ✭master ‹1.9.3-p125›
/Users/ivaughan/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/ruby_kml-0.0.1/CHANGELOG