Skip to content

Instantly share code, notes, and snippets.

View DouweM's full-sized avatar

Douwe Maan DouweM

View GitHub Profile
% irb
ruby-1.9.3-p327 :001 > ++
ruby-1.9.3-p327 :002 > ++
ruby-1.9.3-p327 :003 > ++
ruby-1.9.3-p327 :004 > 5
=> 5
ruby-1.9.3-p327 :005 > x = 3
=> 3
ruby-1.9.3-p327 :006 > x++
ruby-1.9.3-p327 :007 > 2
queues = Hash.new { |h, k| h[k] = [] }
Resque.working.each do |x|
queues[x.job["queue"]] << x.job["run_at"]
end
queues = Hash.new { |h, k| h[k] = [] }
Resque.working.each do |x|
queues[x.job["queue"]] << x.job["run_at"]
end
queue_names = "aggregations,xml_generation,profile_generation,trip,billing,flume,end,snap,profile_analysis,etl,report_api,events,pipeline_entry,profile_aggregation,geocoder".split(",")
queues = {}
queue_names.each do |name|
queues[name] = []
end
Resque.working.each do |x|
name = x.job["queue"]
queue = queues[name]
@DouweM
DouweM / C# File.sublime-build
Created March 21, 2014 14:00
Sublime C# build file
{
"cmd": ["mcs", "$file", "-r:System.Windows.Forms.dll", "-r:System.Drawing.dll"],
"file_regex": "^(.*?)\\(([0-9]+),([0-9]+)\\): (.*)$",
"selector": "source.csharp"
}
@DouweM
DouweM / 21r.rb
Created April 12, 2014 23:56 — forked from Osagiede/21r.rb
# define global variables here
# define methods here
# for human
user_cards = 0
card_one = rand(1..11)
card_two = rand(1..11)
# for computer
cpu_cards = rand(1..11)