Skip to content

Instantly share code, notes, and snippets.

5 class ExampleGroupProxy
6
7 def initialize(example_group) # :nodoc:
8 @description = example_group.description
9 @nested_descriptions = example_group.nested_descriptions
10 @examples = example_group.example_proxies
11 @location = example_group.location
12 @backtrace = example_group.location # deprecated - see the backtrace method below
13 @options = example_group.options.dup
14 @options.delete(:location)
@kke
kke / gist:5821571
Last active December 18, 2015 17:49
/usr/local/rvm/gems/ruby-1.8.7-p371/gems/rspec-1.3.2/lib/spec/example/example_group_proxy.rb:8:in `description':
wrong number of arguments (0 for 1) (ArgumentError)
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/rspec-1.3.2/lib/spec/example/example_group_proxy.rb:8:in `initialize'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/rspec-1.3.2/lib/spec/example/example_group_methods.rb:115:in `new'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/rspec-1.3.2/lib/spec/example/example_group_methods.rb:115:in `notify'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/rspec-1.3.2/lib/spec/example/example_group_methods.rb:96:in `run'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/rspec-1.3.2/lib/spec/runner/example_group_runner.rb:23:in `run'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/rspec-1.3.2/lib/spec/runner/example_group_runner.rb:22:in `each'
from /usr/local/rvm/gems/ruby-1.8.7-p371/gems/rspec-1.3.2/lib/spec/runner/example_group_runner.rb:22:in `run'
from /u
@kke
kke / gist:6592421
Last active December 23, 2015 06:09
What's going on here?
begin
puts foo.inspect # This raises an exception
rescue
puts $!.message
end
if false
foo = 100
else
puts foo.inspect # This raises nothing (even without the above begin..rescue block)
@kke
kke / gist:6760592
Created September 30, 2013 07:53
cleaner way for this?
@actions = Action
@actions = @actions.where("created_at >= ?", params[:start_time]) if params[:start_time].present?
@actions = @actions.where("created_at <= ?", params[:end_time]) if params[:end_time].present?
@actions = @actions.where(user_id: params[:user_id]) if params[:user_id].present?
oot@gitlab-ci:~# curl -L https://get.rvm.io | bash
100 15779 100 15779 0 0 12939 0 0:00:01 0:00:01 --:--:-- 12939
Last login: Thu Oct 10 12:55:04 2013 from m04.vms
root@gitlab-ci:~# /usr/local/rvm/scripts/functions/utility_gems
-bash: /usr/local/rvm/scripts/functions/utility_gems: No such file or directory
root@gitlab-ci:~# curl -L https://get.rvm.io | bash
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 184 100 184 0 0 190 0 --:--:-- --:--:-- --:--:-- 238
100 15779 100 15779 0 0 13545 0 0:00:01 0:00:01 --:--:-- 13545
@kke
kke / xorg.conf
Last active January 1, 2016 18:09 — forked from perryh/xorg.conf
Section "ServerLayout"
Identifier "aticonfig Layout"
Screen 0 "aticonfig-Screen[0]-0" 0 0
Screen "aticonfig-Screen[1]-0" RightOf "aticonfig-Screen[0]-0"
EndSection
Section "Module"
EndSection
Section "Monitor"
@kke
kke / somepool.json
Created January 3, 2014 22:27
How to use includes for your cgminer conf's to keep gpu settings in one place instead of copypasting them to each config file
# foocoin.conf:
{
"pools" : [
{
"quota" : "4;stratum+tcp://eu.multipool.us:3349",
"user" : "user.miner1",
"pass" : "x"
},
{
"quota" : "2;stratum+tcp://foo.dedicatedpool.com:3345",
listen=1
daemon=1
server=1
rpcuser=username
rpcpassword=password
rpcport=15800
gen=1
rpcallowip=127.0.0.1
rpcallowip=192.168.*
rpcallowip=10.*
static inline bool should_roll(struct work *work)
{
struct timeval now;
time_t expiry;
if (work->pool != current_pool() && pool_strategy != POOL_LOADBALANCE && pool_strategy != POOL_BALANCE)
return false;
if (work->rolltime > opt_scantime)
expiry = work->rolltime;
Benchmark.bm do |x|
hash = {:foo => "foo"}
class Item
def initialize
@foo = "foo"
end
def foo
@foo
end
end