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
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('┛┗┛┗┛┃ノ)') |
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 | |
# 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') |
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
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" |
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
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 |