Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
| connection = Faraday::Connection.new('http://example.com') do |builder| | |
| builder.request :url_encoded # for POST/PUT params | |
| builder.adapter :net_http | |
| end | |
| # same as above, short form: | |
| connection = Faraday.new 'http://example.com' | |
| # GET | |
| connection.get '/posts' |
Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
| [david: compare]$ # at this point we have a stock rails app with no minitest tests and one pending rspec example | |
| [david: compare]$ | |
| [david: compare]$ time rake test | |
| Run options: | |
| # Running tests: | |
| Finished tests in 0.030419s, 0.0000 tests/s, 0.0000 assertions/s. |
#Mac OS X
I use tmux splits (panes). Inside one of these panes there's a Vim process, and it has its own splits (windows).
In Vim I have key bindings C-h/j/k/l set to switch windows in the given direction. (Vim default mappings for windows switching are the same, but prefixed with C-W.) I'd like to use the same keystrokes for switching tmux panes.
An extra goal that I've solved with a dirty hack is to toggle between last active panes with C-\.
Here's how it should work:
| # Add this to your .bash_profile, .bashrc, .zshrc or wherever you keep your bash functions and aliases. | |
| del() { | |
| RED="\e[31m" | |
| YELLOW="\e[33m" | |
| WHITE="\e[97m" | |
| if [[ $# -eq 0 ]] ; then | |
| echo -e "Sorry dude, I can't do anything with that. Nothing specified." | |
| else |
| # Without this fix, downgrading from Rails 4 to Rails 3 causes session cookies to blow up. | |
| # | |
| # The way the flash is stored in the session changed in a backwards-incompatible way. | |
| if Rails::VERSION::MAJOR == 3 | |
| module ActionDispatch | |
| class Flash | |
| def call(env) | |
| if (session = env['rack.session']) && (flash = session['flash']) |
CloudFlare is an awesome reverse cache proxy and CDN that provides DNS, free HTTPS (TLS) support, best-in-class performance settings (gzip, SDCH, HTTP/2, sane Cache-Control and E-Tag headers, etc.), minification, etc.