Skip to content

Instantly share code, notes, and snippets.

View smerritt's full-sized avatar

Sam Merritt smerritt

View GitHub Profile
dm_version = '=0.10.3'
gem 'dm-core', dm_version, :git => 'git://github.com/datamapper/dm-core'
gem "data_objects", '=0.10'
gem "do_sqlite3", '=0.10'
only :test do
gem 'rspec', :require_as => 'spec'
end
sam@workvm:~$ irb
irb(main):001:0> 2.6.floor
=> 26
irb(main):002:0> (2.6).floor
=> 26
irb(main):003:0> 2.6
=> 26.0
irb(main):004:0> 2.2
=> 22.0
irb(main):005:0> 2.2 - 1.1
@smerritt
smerritt / before_migrate.rb
Created April 19, 2010 22:04
An EY Cloud deploy hook to install your bundled gems (goes in config/before_migrate.rb)
run "cd #{release_path} && bundle install"
ey deploy choosing an object to deploy without a configured default branch
- defaults to the checked-out local branch (PENDING: Not Yet Implemented)
- deploys whatever argument it's given (PENDING: Not Yet Implemented)
ey deploy choosing an object to deploy with a configured default branch
- complains about a non-default branch without --force (PENDING: Not Yet Implemented)
- deploys a non-default branch with --force (PENDING: Not Yet Implemented)
#!/bin/sh
unset SSH_AUTH_SOCK
ssh -o StrictHostKeyChecking no -i ~/.ssh/some-particular-key $*
@smerritt
smerritt / git-bulkpick
Created June 10, 2010 23:10
git bulkpick
#!/bin/sh
# Author: Sam Merritt <[email protected]>
#
# Usage: git bulkpick BRANCH
#
# Cherry-pick all the changes that are on BRANCH. This sets you as the
# committer.
BRANCH=$1
def bundle
sudo "#{$0} _#{VERSION}_ install_bundler 1.0.0.rc.3"
run "cd #{config.release_path} && bundle _1.0.0.rc.3_ install --deployment --path #{config.shared_path}/bundled_gems"
end
ssh-dss AAAAB3NzaC1kc3MAAACBAOpTvNnhAZzl/LT7L2Oj2EQ3I4JMP0cwSwu+80zrNiWpChXcyIbLHDBQ76Vc2mFj4zNkV2s9WPSWZ4Pwbuq6FxfldI1tXJkRNFBJxnV8T3Wzxv/lCDXObveArhlMjlUw84juTFv5oQwE1Z3dPYTsytoKKeRlJLtNCic2Trjj6D97AAAAFQDLwRE+7tOTWha2rG5f036+6pYsNwAAAIBXsaU2a606eQxfwWojwiPui3eEM/1OAxOf09Ol1BhaSOSbVgjKrCN6ALfU+vE99oMSTXh1+xYlVXjm/1uyoQTZcj/Tn6r3nsnpdSy4BZHK7GmdLGGXG1SvOPRZShDlKvTKbRbaLojFMJlBWcquWexRrk2RqqtczSOeizESgpEI5AAAAIEApLlM2Hhw49hwydqKIU0yYh3gx30/fgjckwnS21n35sMnFvRIKY83PKBatr3q6t+DWP+b5BAlMDpq4yAl6wR/2x6+NnFqrCliqfXBnSOPqhejaGoGK1CWDcMBT5pOGFtce+QuhvuEn6oZQJID4pGIPL6bMBV22fKFLH38gQwS61c= spam@octavius
#!/usr/bin/env ruby
require 'rubygems'
require 'fog'
connection = Fog::Storage.new(
:provider => 'AWS',
:aws_access_key_id => ENV["AWS_ACCESS_KEY_ID"],
:aws_secret_access_key => ENV["AWS_SECRET_ACCESS_KEY"]
)
;; Take all the windows in the current frame and shift them over one.
;;
;; With 2 windows, effectively switches their positions.
;;
;; With 1 window, this is a no-op.
(defun rotate-windows ()
(interactive)
(let ((buffers (mapcar 'window-buffer (window-list))))
(mapcar* 'set-window-buffer
(window-list)