This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Array | |
( | |
[0] => a | |
[1] => b | |
[2] => c | |
) | |
Array | |
( | |
[0] => a | |
[2] => c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ bzr unshelve | |
Unshelving changes with id "1". | |
bzr: ERROR: exceptions.NotImplementedError: <property object at 0x97b370c> | |
Traceback (most recent call last): | |
File "/usr/lib/python2.6/site-packages/bzrlib/commands.py", line 842, in exception_to_return_code | |
return the_callable(*args, **kwargs) | |
File "/usr/lib/python2.6/site-packages/bzrlib/commands.py", line 1037, in run_bzr | |
ret = run(*run_argv) | |
File "/usr/lib/python2.6/site-packages/bzrlib/commands.py", line 654, in run_argv_aliases |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Feature: Dashboard | |
In order to not explode from frustration | |
a developer | |
does not want rspec stubs to leak between scenarios | |
Scenario: Create a stub | |
When I stub nap time to "When I Get Cranky" | |
Then nap time should be "When I Get Cranky" | |
Scenario: Check to see if the stub leaked |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# given these specs for a should_hide?(options={}) method | |
describe 'utility methods' do | |
describe 'should_hide?' do | |
describe 'individual options' do | |
describe 'show_when' # ... | |
describe 'show_unless' # ... | |
describe 'hide_when' # ... | |
describe 'hide_unless' # ... | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
h = { | |
:one => 1, | |
:two => 2, | |
:three => 3 | |
} | |
puts "-- *args" | |
h.inject({}) do |*args| | |
puts args.inspect | |
break |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sh: line 1: 7573 Segmentation fault bzr update /home/user/.cerberus/work/project_name/sources 2>&1 | |
'import site' failed; use -v for traceback | |
Traceback (most recent call last): | |
File "/usr/local/bin/bzr", line 21, in <module> | |
import os | |
File "/usr/local/lib/python2.5/os.py", line 44, in <module> | |
from posix import * | |
ImportError: from-import-* object has no __dict__ and no __all__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') | |
describe MyModel do | |
before do | |
MyModel.create!(:name => 'foo') | |
end | |
it 'this passes' do | |
MyModel.should be_exist(:name => 'foo') | |
end | |
it 'this also passes' do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$arr = array( | |
'members' => array( | |
'someQuestion', | |
'q2', | |
'lastThing' | |
) | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$arr = array( | |
'members' => array( | |
'someQuestion', | |
'q2', | |
'lastThing' | |
) | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cache.store(:key) { ExpensiveOperation.all } # lazy: pay cost on get | |
cache.store!(:key) { ExpensiveOperation.all } # pay cost now | |
# ---- OR ---- | |
cache.store(:key) { ExpensiveOperation.all } # pay cost now | |
cache.lazy_store(:key) { ExpensiveOperation.all } # lazy: pay cost on get |