Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
def do_work | |
Resque::Scheduler.handle_delayed_items | |
Resque.queues.sort.each do |queue| | |
if job = Resque::Job.reserve(queue) | |
job.perform | |
end | |
end | |
end |
Before do | |
module Resque | |
def self.enqueue(klass, *args) | |
klass.perform(*args) | |
end | |
end | |
end |
RSpec.configure do |config| | |
config.before(:suite) do | |
ActiveRecord::Base.establish_connection database['one'] | |
DatabaseCleaner.strategy = :deletion | |
ActiveRecord::Base.establish_connection config.database['two'] | |
DatabaseCleaner.strategy = :deletion | |
end | |
config.before(:each) do |
Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
require 'csv' | |
module Exporter | |
DEFAULT_EXPORT_TABLES = [ Invoice, InvoiceItem, Item, Merchant, Transaction, User ] | |
DESTINATION_FOLDER = "tmp/" | |
def self.included(klass) | |
klass.extend ClassLevelMethods | |
end |
require "net/http" | |
class ProxyApp | |
def call(env) | |
begin | |
request = Rack::Request.new(env) | |
headers = {} | |
env.each do |key, value| | |
if key =~ /^http_(.*)/i | |
headers[$1] = value |
[{"group": "A", "number": "1", "time": "Thu Jun/12/14 17:00","local": "Brazil", "visitor": "Croatia", "city": "Arena de São Paulo, São Paulo", "timezone": "UTC-3"}, | |
{"group": "A", "number": "2", "time": "Fri Jun/13/14 13:00","local": "Mexico", "visitor": "Cameroon", "city": "Estádio das Dunas, Natal", "timezone": "UTC-3"}, | |
{"group": "A", "number": "17", "time": "Tue Jun/17/14 16:00","local": "Brazil", "visitor": "Mexico", "city": "Estádio Castelão, Fortaleza", "timezone": "UTC-3"}, | |
{"group": "A", "number": "18", "time": "Wed Jun/18/14 18:00","local": "Cameroon", "visitor": "Croatia", "city": "Arena Amazônia, Manaus", "timezone": "UTC-4"}, | |
{"group": "A", "number": "33", "time": "Mon Jun/23/14 17:00","local": "Cameroon", "visitor": "Brazil", "city": "Brasília", "timezone": "UTC-3"}, | |
{"group": "A", "number": "34", "time": "Mon Jun/23/14 17:00","local": "Croatia", "visitor": "Mexico", "city": "Recife", "timezone": "UTC-3"}, | |
{"group": "B", "number": "3", "time": "Fri Jun/13/14 16:00","local": "Spain", "visitor": " |
@binkmail.com | |
@bobmail.info | |
@chammy.info | |
@devnullmail.com | |
@letthemeatspam.com | |
@mailinater.com | |
@mailinator.net | |
@mailinator2.com | |
@notmailinator.com | |
@reallymymail.com |
When developing a program in Ruby, you may sometimes encounter a memory leak. For a while now, Ruby has a facility to gather information about what objects are laying around: ObjectSpace.
There are several approaches one can take to debug a leak. This discusses a time-based approach, where a full memory dump is generated every, say, 5 minutes, during a time that the memory leak is showing up. Afterwards, one can look at all the objects, and find out which ones are staying around, causing the
/server chat.freenode.net