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 'em-http' | |
EM.run do | |
def dispatch(uri, retries = 0) | |
h = EM::HttpRequest.new(uri).get | |
h.callback { |rep| [:success, rep.response]; EM.stop } | |
h.errback do |rep| | |
p [:fail, rep] |
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
nnoremap <C-k> mz:m-2<CR>`z== | |
inoremap <C-j> <Esc>:m+<CR>==gi | |
inoremap <C-k> <Esc>:m-2<CR>==gi | |
vnoremap <C-j> :m'>+<CR>gv=`<my`>mzgv`yo`z | |
nnoremap <C-j> mz:m+<CR>`z== | |
vnoremap <C-k> :m'<-2<CR>gv=`>my`<mzgv`yo`z |
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
mkdir -p ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/CoffeeScript | |
cd ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/CoffeeScript | |
curl -O https://raw.github.com/jashkenas/coffee-script-tmbundle/master/Syntaxes/CoffeeScript.tmLanguage | |
curl -O https://raw.github.com/jashkenas/coffee-script-tmbundle/master/Preferences/CoffeeScript.tmPreferences |
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
#base | |
First = lambda {|a, b| a} | |
Last = lambda {|a, b| b} | |
#conditional | |
True = First | |
False = Last | |
Not = lambda {|boolean| boolean[False, True]} | |
And = lambda {|boolean_a, boolean_b| boolean_a[boolean_b, False]} | |
Or = lambda {|boolean_a, boolean_b| boolean_a[True, boolean_b]} |
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
# add these aliases to your BASH profile ~/.profile | |
alias mongodb-start="mongod run --config /usr/local/etc/mongod.conf" | |
alias redis-start="redis-server /usr/local/etc/redis.conf" | |
# TODO add stop commands |
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
a | |
about | |
above | |
across | |
after | |
afterwards | |
again | |
against | |
all | |
almost |
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 Hash | |
def dig(*path) | |
path.inject(self) do |location, key| | |
location.is_a?(Hash) ? location[key] : nil | |
end | |
end | |
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
# Global GIT ignored files | |
# Ignore X-code files | |
build/ | |
*~.nib | |
*.so | |
*.pbxuser | |
*.mode* | |
*.perspective* | |
# Xcode 4 |
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
def utc_iso8601_milli(time) | |
time.utc.strftime '%FT%T.%LZ' | |
end | |
utc_iso8601_milli Time.now | |
# => "2016-09-02T07:06:18.134Z" | |
utc_iso8601_milli Time.new(2002, 10, 31, 2, 2, 2, "+05:00") | |
# => "2002-10-30T21:02:02.000Z" |
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 Dockerfile is intended to build a production-ready app image. | |
# | |
# This is not required for development environments | |
FROM sagittaros/rails-base:latest | |
MAINTAINER Felix Tioh <felix.tioh@crowdo.com> | |
COPY . /app | |
WORKDIR /app | |
EXPOSE 5000 |
OlderNewer