Skip to content

Instantly share code, notes, and snippets.

@phinze
phinze / Gemfile
Created September 18, 2011 16:58
bundler bug when shelling out to homebrew
source "http://rubygems.org"
gem "rake"
class BuildAllCommand
def initialize(cli_options = {})
@cli_options = cli_options
end
def run
threads = []
Dir["#{HOME}/config/*.yml"].each do |fn|
fn =~ %r{#{HOME}/config/(.*).yml}
application_name = $1
// ==UserScript==
// @name Move mingle comments
// @namespace http://userscripts.org/users/135958
// @description Moves comments in mingle from the sidebar to a more prominant place
// @include *mingle*
// ==/UserScript==
var cah = document.getElementById('comments-and-history');
cah.parentNode.removeChild(cah);
var cc = document.getElementById('card-contents');
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
<?php
$arr = array(
'members' => array(
'someQuestion',
'q2',
'lastThing'
)
);
<?php
$arr = array(
'members' => array(
'someQuestion',
'q2',
'lastThing'
)
);
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
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__
h = {
:one => 1,
:two => 2,
:three => 3
}
puts "-- *args"
h.inject({}) do |*args|
puts args.inspect
break
# 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