This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
It has been aptly said that programming is the art of managing | |
complexity. | |
A large software project, in the best possible case, is understood as a | |
researcher understands a library. You may have read a number of the | |
books, and might even know a few of them intimately. If you want to find | |
a book – even one you've never seen before – it's usually easy as long | |
as you know the ISBN, the exact name, or at least the author. | |
You'll spend most of your time reading though, trying to find a clue or |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http://zguide.zeromq.org/page:all | |
http://zeromq.org/bindings:ruby-ffi | |
http://blog.paracode.com/2012/12/28/zeromq-and-ruby-a-practical-example/ | |
http://techno-weenie.net/2011/6/17/zeromq-pub-sub/ | |
https://gist.github.com/technoweenie/1031540 | |
http://www.igvita.com/2010/11/17/routing-with-ruby-zeromq-devices/ | |
http://www.rubyinside.com/why-rubyists-should-care-about-messaging-a-high-level-intro-5017.html # bork? | |
http://en.wikipedia.org/wiki/%C3%98MQ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
DEFAULT_VERSION='1.9.3-p194' | |
if [ -z "$1" ] ; | |
then | |
echo "Usage: ruby VERSION" | |
echo "Example: ruby $DEFAULT_VERSION" | |
echo "or, just wait a sec and we'll install $DEFAULT_VERSION" | |
sleep 2.5 | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; This buffer is for notes you don't want to save, and for Lisp | |
;; evaluation. If you want to create a file, visit that file with C-x | |
;; C-f, then enter the text in that file's own buffer. | |
MNEM | |
An object database which stores and manipulates simple structures of | |
data (hashes, arrays, strings, and numbers), knows how to talk JSON, | |
keeps a copy of everything that has ever been entered, and implements | |
updates as pull requests. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Quickfind | |
module ClassMethods | |
def quick_finder(field) | |
metaclass = class << self; self; end | |
klass = self | |
class_eval do | |
@@quickfinder = field | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exportgems() { | |
export GEMPATH=`gem env gempath | sed 's/:.*$//'`/gems | |
} | |
exportgems; | |
# completion fuction for compdef: just lists the gems folders | |
_gems() { compadd `cd $GEMPATH; echo *` } | |
compdef _gems gcd ; gcd() { cd $GEMPATH/$1 } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
begin | |
require 'term/ansicolor' | |
rescue LoadError | |
end | |
module Kernel | |
def autoloads(lib_dir) | |
base_dir = File.expand_path File.join(Rails.root, lib_dir) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Array | |
def columns(padding=1) | |
col_sizes = inject([]) do |sizes, row| | |
row.each_with_index.each do |col, i| | |
sizes[i] = [sizes[i], col.to_s.length].compact.max | |
end | |
sizes | |
end | |
out = [] | |
each do |row| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# simple, DRY autoloading | |
require 'active_support' | |
class Module | |
def const_missing_with_mojo mod | |
# HACK ALERT eject if activesupport voodoo is interfering | |
targ = caller.reject {|x| x =~ /active_?support/ }[0].split(':').first | |
autoload_path targ | |
if const_defined? mod | |
const_get mod |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Spec | |
module Example | |
module ExampleGroupMethods | |
def slow_specs &bl | |
bl.call() if run_slow_specs? | |
end | |
def run_slow_specs? | |
ENV['SLOW_SPECS'] |
NewerOlder