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
rvm use --create 1.9.3@foo | |
which bundle > /dev/null || gem install bundler --no-ri --no-rdoc | |
bundle check || bundle install |
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
notify () { | |
~/.rvm/gems/ruby-1.9.3-p484/bin/terminal-notifier -title "$1" -message "$2" | |
} |
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
;; Color configuration | |
(set-face-attribute 'mode-line | |
nil | |
:foreground "light green" | |
:background "firebrick1" | |
:box '(:line-width 1 :style released-button)) | |
(set-face-attribute 'mode-line-inactive | |
nil | |
:foreground "maroon4" |
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
(defun resque-web () | |
"Launch resque-web locally on the default port" | |
(interactive) | |
(shell-command "open http://0.0.0.0:5678/")) |
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
extension Array { | |
func each(iterator: (T) -> Void) -> Array { | |
for item in self { | |
iterator(item) | |
} | |
return self | |
} | |
} |
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
extension Array { | |
func partition(iterator: (T) -> Bool) -> (Array<T>, Array<T>) { | |
var ifTrue = Array<T>() | |
var ifFalse = Array<T>() | |
self.each { | |
if iterator($0) == true { | |
ifTrue.append($0) | |
} else { | |
ifFalse.append($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
// accumulator function | |
func accumulator(initial: Int, incrementBy: Int) -> () -> Int { | |
var value = initial | |
func accum() -> Int { | |
value += incrementBy | |
return value | |
} | |
return accum | |
} |
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 'yaml' | |
module BetterYaml | |
def self.write_yaml_file(file, data) | |
self.with_syck_engine do | |
File.open(File.expand_path(file), "w", :encoding => "utf-8") {|f| YAML.dump(data, f) } | |
end | |
end | |
def self.load_yaml_file(file) |
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 "http://rubygems.org/" | |
ruby "2.1.1" | |
gem 'docx', '~> 0.2.03' |
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
#!/usr/bin/env escript | |
%% -*- erlang -*- | |
%%! -smp enable -sname convert_binary_ring -mnesia debug verbose | |
main([RingFile, OutFile]) -> | |
try | |
{ok, Binary} = file:read_file(RingFile), | |
Ring = binary_to_term(Binary), | |
try | |
file:write_file(OutFile, io_lib:format("~p.~n", [Ring])), |
OlderNewer