Skip to content

Instantly share code, notes, and snippets.

View dsturnbull's full-sized avatar

David Turnbull dsturnbull

View GitHub Profile
scope 'merb-gen' do
# do merb-gen stuff here
end
scope 'monkey' do
# do monkey stuff here
end
[ew[
@dsturnbull
dsturnbull / grapple.rb
Created August 26, 2008 06:10 — forked from atnan/grapple.rb
more elite version
require 'rubygems' rescue nil
require 'gosu'
require 'chipmunk'
class Array
# e.g. [1,2,3].each_link yields [1,2], [2,3]
def each_link
prev = first
self[1, size].each do |item|
yield prev, item
Nov 1 09:45:51 fleet scsi: [ID 107833 kern.warning] WARNING: /pci@0,0/pci1002,597b@5/pci1095,7132@0/disk@1,0 (sd5):
Nov 1 09:45:51 fleet Error for Command: read(10) Error Level: Retryable
Nov 1 09:45:51 fleet scsi: [ID 107833 kern.notice] Requested Block: 1804505446 Error Block: 1804505509
Nov 1 09:45:51 fleet scsi: [ID 107833 kern.notice] Vendor: ATA Serial Number:
Nov 1 09:45:51 fleet scsi: [ID 107833 kern.notice] Sense Key: Media_Error
Nov 1 09:45:51 fleet scsi: [ID 107833 kern.notice] ASC: 0x11 (unrecovered read error), ASCQ: 0x0, FRU: 0x0
Nov 1 09:45:54 fleet scsi: [ID 107833 kern.warning] WARNING: /pci@0,0/pci1002,597b@5/pci1095,7132@0/disk@1,0 (sd5):
Nov 1 09:45:54 fleet Error for Command: read(10) Error Level: Retryable
Nov 1 09:45:54 fleet scsi: [ID 107833 kern.notice] Requested Block: 1804505446 Error Block: 1804505509
Nov 1 09:45:54 fleet scsi: [ID 10783
# formats - array of MediaFormat objects
# :width - desired width
# :height - desired height
# :fuzz - number of pixels it's ok to be off by
# :constrain - scale image client-side to specified :width and :height, using image best matching specified :width and :height
# :include_cropped - include cropped images
def image_helper(formats, options={})
options[:constrain] = true unless options[:constrain].blank?
options[:fuzz] ||= 0
#!/bin/bash
commit=$(git rev-parse $1)
branch=$2
if [[ -z "$branch" ]]; then
branch=HEAD
fi
while true; do
commit=$(git rev-list --children $branch --not $commit^@ | \
#!/bin/sh
git cherry -v HEAD $1 | grep ^+ | while read line; do
hash=`git rev-parse --short $( echo "$line" | cut -d' ' -f2 )`
description=$( echo "$line" | cut -d' ' -f3- | cut -c 1-64 )
conflict=$( git cherry-pick -n $hash 2> /dev/null | grep 'CONFLICT' )
status=$( git status )
if ! current_git_status=$( echo "$status" | grep 'working directory clean' ); then
if [ "$conflict" ]; then
num_conflicting_files=$( echo "$status" | grep 'unmerged: ' | wc -l | sed 's/ //g' )
#!/bin/sh
# changed to only work on clean repos
# after each revision is tried, if it's still dirty, nuke all untracked files. they represent the situation in which a patch is applied to a file that was added in an unmerged patch
git cherry -v HEAD $1 | grep ^+ | while read line; do
status=$( git status )
if current_git_status=$( echo "$status" | grep 'working directory clean' ); then
hash=`git rev-parse --short $( echo "$line" | cut -d' ' -f2 )`
description=$( echo "$line" | cut -d' ' -f3- | cut -c 1-64 )
02:28 PM dave@vmonster/0 [~/src/disco] erl -rsh ssh -sname testmaster
Erlang (BEAM) emulator version 5.6.3 [source] [64-bit] [smp:4] [async-threads:0] [kernel-poll:false]
Eshell V5.6.3 (abort with ^G)
(testmaster@vmonster)1> slave:start(localhost, "testnode").
{ok,testnode@localhost}
(testmaster@vmonster)2> net_adm:ping(testnode@localhost).
pong
(testmaster@vmonster)3>
mysql> BEGIN;
Query OK, 0 rows affected (0.00 sec)
mysql> CREATE TABLE a (a text);
Query OK, 0 rows affected (0.00 sec)
mysql> ROLLBACK;
Query OK, 0 rows affected (0.00 sec)
mysql> describe a;
Feb 26 08:27:55 darkstar dovecot: Time just moved backwards by 217 seconds. This might cause a lot of problems, so I'll just kill myself