Skip to content

Instantly share code, notes, and snippets.

(rdb:1) pp csv.parts.all(:completed => false)
[#<CSVPart
full = true,
content_length = 0,
updated_at = #<DateTime: 35351787367/14400,-7/24,2299161>,
index = 0,
created_at = #<DateTime: 35351787367/14400,-7/24,2299161>,
completed = false,
csv_meta_id = 5,
id = 6>]
# chef solo failure.
# notes:
# - this machine does not have a 'domain' assigned by ohai (hostname -f has no dots in it)
# - ubuntu 9.04, fresh installation
# sudo chef-solo -c ~/solo.rb -j ~/bootstrap.json -r http://s3.amazonaws.com/chef-solo/bootstrap-latest.tar.gz
[Wed, 19 Aug 2009 23:05:17 +0000] INFO: Starting Chef Solo Run
/usr/lib/ruby/gems/1.8/gems/chef-0.7.8/lib/chef/node/attribute.rb:372:in `method_missing': Attribute domain is not defined! (ArgumentError)
from /usr/lib/ruby/gems/1.8/gems/chef-0.7.8/lib/chef/node.rb:236:in `send'
from /usr/lib/ruby/gems/1.8/gems/chef-0.7.8/lib/chef/node.rb:236:in `method_missing'
#!/usr/bin/env ruby
require 'rubygems'
require 'thor'
require 'chef'
require 'chef/node'
require 'chef/rest'
# Please see the readme for overview documentation.
#
@bpo
bpo / gist:183456
Created September 9, 2009 03:39 — forked from mtodd/gist:180398
Surround a heredoc with quotes and you can continue the code on the same line:
render :status => 404, :text => <<-'EOH' and return unless setup
article not found<br/>
I, as a server, have failed<br/>
https?
EOH
Quotes also give you more freedom/creativity with the terminal ID:
>> @unit1.updated_at.to_s
=> "2009-09-25T15:44:55-07:00"
>> @unit1.updated_at = 3.days.ago
=> Tue Sep 22 15:45:14 -0700 2009
>> @unit1.updated_at.to_s
=> "2009-09-22T15:45:14-07:00"
>> @unit1.save
=> true
>> @unit1.updated_at.to_s
=> "2009-09-25T15:45:27-07:00"
irb(main):073:0> $redis.lrange "1069", 0, 1000
=> ["2275153", "2275153", "2275153"]
irb(main):074:0> $redis.del "1069"
=> false
irb(main):075:0> $redis.lrange "1069", 0, 1000
=> 0
irb(main):076:0> $redis.lrange "1068", 0, 1000
=> []
irb(main):077:0> $redis.lrange "1069", 0, 1000
=> []
# /bin/bash
# Initialize a new completely empty branch.
if [ $# -lt 1 ]; then
echo "Usage: $0 <NEW_BRANCH>"
exit 1
fi
if [ -a $1 ]; then
echo "Error: file $1 exists locally."
# vim: sw=4 sts=4 et si filetype=gitconfig
[user]
name = Brian P O'Rourke
email = bpo@somnambulance.net
[color]
status = auto
diff = auto
branch = auto
interactive = auto
#! /usr/bin/env ruby -w
o = ['!','@','#','$','%','&','*',(0..9),('a'..'z'),('A'..'Z')].map{|i| i.to_a}.flatten;
puts (0..50).map{ o[rand(o.length)] }.join;
@bpo
bpo / job.md
Created January 18, 2010 20:32 — forked from tysonmote/job.md

#Backend engineer

Dolores Labs is funded, growing, and, frankly, where the action is at in San Francisco. However, we have a bit of a problem: Ruby doesn't scale. We need someone to rewrite our entire application in Java. JUST KIDDING. But our system and user base have both been growing by leaps and bounds. We need a creative, smart and resourceful engineer to help our systems meet the growing demands of our users.

##Skills that are a must

Startup: You're able to learn quickly, design creative solutions, and work independently.

People: We have an API which is used by many clients and customers. In addition to building and improving this API, you'll help our customers understand and use it in ways that support their business.