This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def thing(params = {}) | |
params ||= {} | |
# ... | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
ports = `port installed | grep -v active`.split("\n")[1..-1] | |
ports.each do |port| | |
system('sudo', 'port', 'uninstall', *port.split) | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def address(separator) | |
"#{billing_address1}#{separator}#{billing_address2}#{separator}#{billing_city}#{separator}#{billing_state} #{billing_zip}#{separator}#{billing_phone}" | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11:04 <aniero> suss: case statements on class? | |
11:05 <aniero> aww | |
11:06 <Defiler> those are handy | |
11:06 <Defiler> unless you mean case foo.class in which case that is dumb | |
11:06 <Defiler> but if you mean case foo;when String;when Array... those are nice |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
state_machine :initial => :unpaid do | |
event :pay do | |
transition :unpaid => :paid | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Blah | |
def blah | |
puts 'hey' | |
extend Feh | |
blah | |
puts 'x' | |
end | |
end | |
module Feh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gist_ql() | |
{ | |
GIST=$1 | |
TMPFILE=~/tmp/gist_$GIST | |
gist $GIST > ~/tmp/gist_$GIST | |
qlmanage -c public.plain-text -p $TMPFILE >& /dev/null | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Visit | |
# has date, place | |
def check_something(blah) | |
# do stuff, very similar to Place#check_something | |
# and in fact using my own date instead of the argument | |
end | |
end | |
class Place |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
$:.unshift(File.expand_path('~/dev/projects/others/cinch/lib/')) | |
require 'cinch' | |
bot = Cinch::Base.new | |
bot.options.server = 'irc.freenode.org' | |
bot.options.nick = 'cardroid' | |
bot.options.channels = %w[#namaste_bitches] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tell application "iTunes" | |
set x to {user playlist "motown", user playlist "blues"} | |
set y to {} | |
repeat with t in x | |
copy name of t as string to end of y | |
end repeat | |
-- set y to name of every item of x | |
y | |
end tell |