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
package main | |
import ( | |
"fmt" | |
"net" | |
"os" | |
"bufio" | |
) | |
func printBanner() { |
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
# in .bash_profile | |
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function* | |
# in .bashrc | |
PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting |
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
require 'spec_helper' | |
module Gimme | |
class ChairFactory | |
def self.build | |
raise RuntimeError.new "unimplemented feature" | |
end | |
def self.destroy |
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
# Taken from a comment on http://www.mikeperham.com/2012/03/03/the-perils-of-rescue-exception/ | |
module RescuableException | |
def self.===(exception) | |
case exception | |
# Catch when the user hits ^C (Interrupt < SignalException), and assume | |
# that they just wanted to stop the in-progress command (just like bash etc.) | |
when Interrupt | |
true | |
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
source 'https://rubygems.org' | |
gem 'json' | |
gem 'resque', '1.19.0' |
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
source 'https://rubygems.org' | |
gem 'sidekiq' |
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
(use 'clojure.contrib.combinatorics) | |
(def small-numbers [ 1 2 3 4 6 ]) | |
(def large-numbers [ 3 4 9 14 15 19 28 37 47 50 54 56 59 61 70 73 78 81 92 95 97 99 ]) | |
(defn largest-sum-of-rest? | |
[ col ] | |
(let [ [ largest & others ] (reverse (sort col)) ] | |
(= largest (reduce + others)))) |
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
$ GOPATH=$HOME/go go get github.com/burke/zeus/go/cmd/zeus | |
../../../go/src/github.com/burke/zeus/go/cmd/zeus/zeus.go:14:2: no Go source files in /Users/james/go/src/github.com/burke/zeus/go/zeusversion |
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
require File.expand_path('../../utilities', __FILE__) | |
require 'openssl' | |
# Set to true to see debug output | |
DEBUG = false | |
def debug_puts(s=nil); puts(s) if DEBUG; end | |
def debug_print(s=nil); print(s) if DEBUG; end | |
# Encrypt data using given `mode`, `key_b`, `iv_b` and `data_b`, all as byte arrays | |
# Only uses padding in CBC mode |