Skip to content

Instantly share code, notes, and snippets.

View halida's full-sized avatar

Halida halida

View GitHub Profile
@halida
halida / gist:3130364
Created July 17, 2012 16:14
resque bug
class Outbox
@queue='v_redis'
def self.perform(userid,msgid)
$v_redis.set('ok',msgid+"*******")
get(userid,msgid)
end
def get(msg,msgid)
end
@halida
halida / gist:2729866
Created May 19, 2012 07:25
ruby class machanism example 1
class Sth
def present
raise NotImplementedError
end
def log s
puts s
end
end
@halida
halida / gist:2373297
Created April 13, 2012 03:07
rubinius test
$ make
time ruby test.rb
4999999950000000
5.20user 0.04system 0:05.25elapsed 99%CPU (0avgtext+0avgdata 119920maxresident)k
0inputs+0outputs (0major+12315minor)pagefaults 0swaps
rbx compile test.rb -o t.rbc
time rbx -e "Rubinius::CodeLoader.require_compiled 't'"
4999999950000000
5.20user 0.00system 0:05.22elapsed 99%CPU (0avgtext+0avgdata 121152maxresident)k
0inputs+0outputs (0major+12387minor)pagefaults 0swaps
@halida
halida / gist:2290229
Created April 3, 2012 07:45
test map speed
def timeit name
begins = Time.now
yield
ends = Time.now
puts "running: #{name}, spend time: #{ends - begins}"
end
class MyData
def initialize(value)
@value = value
@halida
halida / gist:2019392
Created March 12, 2012 02:44
my gemfile
source 'http://rubygems.org'
gem 'rails', '3.2.2'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
group :assets do
# gem 'sass-rails', " ~> 3.1.0"
gem 'sass-rails', git: "https://github.com/rails/sass-rails.git", :branch => '3-2-stable'
gem 'coffee-rails', " ~> 3.2.0"