Skip to content

Instantly share code, notes, and snippets.

Thread 6 (Thread 0xb6413b70 (LWP 18115)):
#0 0xb7706424 in __kernel_vsyscall ()
#1 0xb74e8931 in select () from /lib/libc.so.6
#2 0x081833c7 in rubinius::QueryAgent::perform (this=0x935adf0)
at vm/agent.cpp:227
#3 0x081bf4f2 in thread::Thread::trampoline (arg=0x935adf0)
at vm/util/thread.hpp:91
#4 0xb76cc41f in start_thread () from /lib/libpthread.so.0
#5 0xb74ef79e in clone () from /lib/libc.so.6
1)
An exception occurred during: after :each
Process.kill sends the given signal to the specified process FAILED
Expected nil
to equal 99
/expectations.rb:15
{ } in main.__script__ at spec/ruby/core/process/kill_spec.rb:133
Kernel(Object)#instance_eval at kernel/common/eval.rb:164
{ } in Enumerable(Array)#all? at kernel/common/enumerable.rb:205
(cut: lots of passing specs)
1)
Class#dup retains the correct ancestor chain for the singleton class ERROR
NoMethodError: undefined method `message' on #<Class:0x21148> (Class)
 Kernel(Class)#message (method_missing) at kernel/delta/kernel.rb:85
{ } in main.__script__ at spec/ruby/core/class/dup_spec.rb:36
 Kernel(Object)#instance_eval at kernel/common/eval.rb:164
 { } in Enumerable(Array)#all? at kernel/common/enumerable.rb:205
 Array#each at kernel/bootstrap/array.rb:71
Creating gist failed: 200 OK
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<title>nyarly's gist: &mdash; Gist</title>
@nyarly
nyarly / .bashrc
Created October 15, 2011 20:31
Change PATH based on Gemfile
source "/home/judson/bin/bundler_ps1.sh"
if [[ ! $PROMPT_COMMAND =~ __bundler_prompt_command ]]; then
export PROMPT_COMMAND="${PROMPT_COMMAND:-:} ; __bundler_prompt_command"
fi
PS1="\[\033[01;31m\]\$(__bundler_ps1)\[\033[01;34m\] $PS1"
@nyarly
nyarly / gist:1792699
Created February 10, 2012 20:41
Change Rake exception handling behavior
Put this at the top of your Rakefile
class Rake::Application
def display_error_message(ex)
$stderr.puts "#{name} aborted!"
$stderr.puts "#{ex.class}: #{ex.message}"
$stderr.puts rakefile_location(ex.backtrace)
$stderr.puts "Tasks: #{ex.chain}" if has_chain?(ex)
$stderr.puts ex.backtrace.join("\n")
end
@nyarly
nyarly / gist:1852503
Created February 17, 2012 10:27
Reinventing a wheel? (ActiveRecord)
def self.build_pairs(rel)
require 'pp'
records = connection.select_all(sanitize_sql(rel.to_sql), "#{name} Load Pairs", [])
records.map do |record|
split = record.to_a.map do |key,value|
key.split(".",2) + [value]
end.group_by do |list|
list.first
end.values.map do |record|
instantiate(Hash[record.map{|triple| triple[1..2]}])
@nyarly
nyarly / tmux-locate
Created March 23, 2012 00:40
Vim + TMux work
#!/bin/bash
if [ $# -lt 1 ]; then
echo "Usage: $0 <cmd>"
exit 17
fi
session_idx=$(tmux display -p "#S")
window_idx=$(tmux display -p "#I")
pane_idx=$(tmux display -p "#P")
@nyarly
nyarly / bundle_setup
Created May 15, 2012 05:32
Gemsets? Why?
#!/bin/sh
BUNDLE_BASE=~/ruby/bundle-paths/rails3
if [ -f .bundle/config ]; then
echo "Bundle config file already exists"
bundle install
else
projname=$(basename $(pwd))
BUNDLE_PATH="$BUNDLE_BASE/lib"
@nyarly
nyarly / BM results
Created May 31, 2012 20:18
Dynamic method def: eval strings vs define_method with a block
Adding 1 10x10 times: 100
Adding 1 10x10 times: 100
user system total real
evald 15.760000 0.000000 15.760000 ( 15.772606)
block 15.920000 0.000000 15.920000 ( 15.926385)
user system total real
eval_string 10.070000 0.110000 10.180000 ( 10.184233)
define_with_block 1.120000 0.020000 1.140000 ( 1.143636)