Skip to content

Instantly share code, notes, and snippets.

Black Lives Matter

Owajigbanam Ogbuluijah igbanam

Black Lives Matter
View GitHub Profile
aserafin / resque.rake
Created Oct 10, 2013
clear all resque tasks from redis
View resque.rake
desc "Clear pending tasks"
task "resque:clear" => :environment do
queues = Resque.queues
queues.each do |queue_name|
puts "Clearing #{queue_name}..."
Resque.redis.del "queue:#{queue_name}"
puts "Clearing delayed..." # in case of scheduler - doesn't break if no scheduler module is installed
Resque.redis.keys("delayed:*").each do |key|
andkerosine / raskell.rb
Created Aug 15, 2012
Haskell-like list comprehensions in Ruby
View raskell.rb
$stack, $draws = [], {}
def method_missing *args
return if args[0][/^to_/]
$stack << { |a| a or $stack.pop }
$draws[$stack.pop(2)[0][0]] = args[1] if args[0] == :<
class Array
def +@