Skip to content

Instantly share code, notes, and snippets.

View LeipeLeon's full-sized avatar
🕳️

Leon Berenschot LeipeLeon

🕳️
View GitHub Profile
set(:branch) do
if :production == stage
branch = Capistrano::CLI.ui.ask("#{`git branch`}\n\nWhich branch do you want to deploy?: ")
raise "Error: The master branch cannot be deployed to production." if 'master' == branch
else
`git branch | grep ^* | sed s/\\*\\ //`.chomp # use current active branche
end
end
@LeipeLeon
LeipeLeon / YodaSpeak.rb
Created February 11, 2009 23:12
Speak like Yoda
# port of http://www.perlmonks.org/?node_id=162190
#
# Please refactor this if necessary
# leonb -at- beriedata -dot- nl
#
class String
def yoda
word = %w{is be will show do try are teach have}.select { |word| self =~ /\b#{word}\b/ }[0]
if word
x = (self =~ /\b#{word}\b/) + word.size
@LeipeLeon
LeipeLeon / WakoopaGrowl.rb
Created January 27, 2009 15:31
Send a growl message with latest updates in your wakoopa feed
#!/usr/bin/env ruby
#
# Send a growl message with latest updates in your feed
#
# edit your crontab (crontab -e) and add this line
# (this checks your feed every 30 minutes)
# */30 * * * * ~/bin/WakoopaGrowl.rb > /dev/null
#
# create a yaml file (mate ~/.wakoopa_growl) within your homedirectory
# username: your_username