Skip to content

Instantly share code, notes, and snippets.

before 'deploy', 'deploy:good_luck'
before 'deploy:migration', 'deploy:good_luck'
task :good_luck, roles: :app, except: { no_release: true } do
if Time.now.wday == 5
logger.debug('')
logger.debug('┓┏┓┏┓┃')
logger.debug('┛┗┛┗┛┃\○/')
logger.debug('┓┏┓┏┓┃ / Friday')
logger.debug('┛┗┛┗┛┃ノ)')
@valakirka
valakirka / jazzfonica.rb
Created June 14, 2011 13:51 — forked from christos/jazzfonica.rb
jazzfonica
#!/usr/bin/env ruby
# jazzfonica.rb for Mac OS X
# Scans the visible networks for JAZZTEL_XXXX or WLAN_XXXX and calculates the password
# Ported from PHP example at http://kz.ath.cx/wlan/codigo.txt
# Download and execute with ruby (e.g. ruby jazzfonica.rb) from a Terminal
require 'digest/md5'
messages = []
unless !File.exists?('/System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Resources/airport')
require 'rubygems'
require 'benchmark'
require 'almodovar' # http://github.com/bebanjo/almodovar
auth = Almodovar::DigestAuth.new("Sequence", "api_user", "secret")
sequence = Almodovar::Resource("http://sequence.local/api", auth)
sequence.work_areas.first.name
# "Bebanjo TV"
@valakirka
valakirka / gist:265225
Created December 29, 2009 09:13 — forked from rails/gist:264500
Rails 3
products = Product.where("price = 100").limit(5) # No query executed yet
products = products.order("created_at DESC") # Adding to the query, still no execution
products.each { |product| puts product.price } # That's when the SQL query is actually fired
class Product < ActiveRecord::Base
named_scope :pricey, where("price > 100")
named_scope :latest, order("created_at DESC").limit(10)
end