An implementation of Conway's Game of Life in 140 characters of Ruby.
Created by Simon Ernst (@sier).
namespace :bundler do | |
task :install, :roles => :app, :except => { :no_release => true } do | |
run("gem install bundler --source=http://gemcutter.org") | |
end | |
task :symlink_vendor, :roles => :app, :except => { :no_release => true } do | |
shared_gems = File.join(shared_path, 'vendor/gems/ruby/1.8') | |
release_gems = "#{release_path}/vendor/gems/ruby/1.8" | |
# if you don't commit your cache, add cache to this list | |
%w(gems specifications).each do |sub_dir| |
def pbcopy(string) | |
pasteBoard = NSPasteboard.generalPasteboard | |
pasteBoard.declareTypes([NSStringPboardType], owner: nil) | |
pasteBoard.setString(string, forType: NSStringPboardType) | |
end |
#!/usr/bin/env zsh | |
if [[ -s "${TM_PROJECT_DIRECTORY}/.rvmrc" ]] | |
then | |
source "${TM_PROJECT_DIRECTORY}/.rvmrc" | |
fi | |
`which ruby` $* |
# sudo gem install bson | |
# sudo gem install bson_ext | |
# sudo gem install yajl-ruby | |
# sudo gem install json | |
# sudo gem install msgpack | |
require 'rubygems' | |
require 'benchmark' | |
require 'yaml' | |
require 'bson' |
#!/usr/bin/env ruby | |
#/ Usage: <progname> [options]... | |
#/ How does this script make my life easier? | |
# ** Tip: use #/ lines to define the --help usage message. | |
$stderr.sync = true | |
require 'optparse' | |
# default options | |
flag = false | |
option = "default value" |
#!/bin/bash | |
set -o errexit | |
# Author: David Underhill | |
# Script to permanently delete files/folders from your git repository. To use | |
# it, cd to your repository's root and then run the script with a list of paths | |
# you want to delete, e.g., git-delete-history path1 path2 | |
if [ $# -eq 0 ]; then | |
exit 0 |
An implementation of Conway's Game of Life in 140 characters of Ruby.
Created by Simon Ernst (@sier).
#!/usr/bin/env ruby | |
puts "Please Enter Your MAC Address: " | |
mac = gets | |
mac = mac.strip | |
`sudo /bin/bash -lc "sudo /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -z && sudo ifconfig en0 ether #{mac}"` | |
puts "Congratulations you now have #{mac} as your MAC address" |
class MyClass | |
def value | |
"VALUE!" | |
end | |
def do_something | |
puts value # Outputs "VALUE!" | |
if false | |
value = nil # Should not execute | |
end |