Skip to content

Instantly share code, notes, and snippets.

View ryan-allen's full-sized avatar
🐢
Turtles

Ryan Allen ryan-allen

🐢
Turtles
View GitHub Profile
@ryan-allen
ryan-allen / gist:100415
Created April 23, 2009 09:07
.vimrc, .gvimrc, .bash_profile
export EDITOR=vi
export HISTFILESIZE=1000000
alias ls="ls -laGh"
alias mysql="mysql5 -u root $1"
PS1="\w $ "
set -o vi
alias vim=vi
class Withdrawal
workflow do
state :new do
event :request_amount, :transitions_to => :awaiting_payment
event :request_max, :transitions_to => :pending_end_of_month
end
state :awaiting_payment do
event :pay, :transitions_to => :paid
# install the mysql gem on os x, when you have apple's ruby but macport's mysql:
sudo env ARCHFLAGS="-arch i386" gem install mysql -- \
--with-mysql-dir=/opt/local --with-mysql-lib=/opt/local/lib/mysql5/mysql \
--with-mysql-include=/opt/local/include/mysql5/mysql
Instead of every person in the extended family buying a present for every person
in the extended family, which is like, totally crap, this year we played The
Present Game.
The game works by each participant buying some random gift, to the tune of a
budget (ours was $20 AUD), and they are wrapped and all put in a pile.
Every participants name is put in a bowl and someone draws and names the person
drawn. That person goes and picks a present, unwraps it in front of everyone
and shows them what it is.
// i was wondering...
var stu = {name:'stu'}
var ry = {name:'ry'}
var namer = function () {
print("wtf is this? it's " + this.name + "!!!")
}
stu.wtf = namer
// just how my cute lua test thingo worked, without setup and
// teardown and nesting :) in javascript!
var testrunner = {
run: function(tests) {
for (var test in tests) {
if (tests[test].call()) {
print(test + " passed.")
} else {
print(test + " FAILED!")
gnome-terminal --geometry="120x60"
dr nic! dr nic!
his custom codes are really shwick!
laziness he gives the flick!
dr nic! dir nic!
dr nic! coding boom!
queenslander presence in the room!
he'll move to tassie some day soon
dr nic! coding boom!
#!/usr/bin/env ruby
%w(rubygems hpricot).each { |lib| require(lib) }
if ARGV.length < 2
puts "Usage: './backup-databases /path/to/backups label databases,to,ignore'"
puts "Example: './backup-databases /tmp/db-backups weekly mysql,information_schema,test'"
else
class Object
def if
yield if self
end
def else
yield if not self
end
end