NOTE: This post now lives (and kept up to date) on my blog: http://hakunin.com/rails3-load-paths
Do nothing. All files in this dir are eager loaded in production and lazy loaded in development by default.
| # `git merge-log` shows the commits that were introduced in a given merge | |
| # `git merge-diff` shows the actual changes that were introduced by a given merge | |
| # Both commands accept an optional commitish; if ommitted, the last merge commit is used | |
| merge-span = "!f() { echo $(git log -1 $2 --merges --pretty=format:%P | cut -d' ' -f1)$1$(git log -1 $2 --merges --pretty=format:%P | cut -d' ' -f2); }; f" | |
| merge-log = "!git log `git merge-span .. $1`" | |
| merge-diff = "!git diff `git merge-span ... $1`" | |
| merge-difftool = "!git difftool `git merge-span ... $1`" |
| # Support for Rspec / Capybara subdomain integration testing | |
| # Make sure this file is required by spec_helper.rb | |
| # (e.g. save as spec/support/subdomains.rb) | |
| def switch_to_subdomain(subdomain) | |
| # lvh.me always resolves to 127.0.0.1 | |
| hostname = subdomain ? "#{subdomain}.lvh.me" : "lvh.me" | |
| Capybara.app_host = "http://#{hostname}" | |
| end |
| $ rake test | |
| /opt/rubies/2.0.0-p0/bin/ruby -I"lib:test" -w -I"/Users/steve/.gem/ruby/2.0.0/gems/rake-10.0.4/lib" "/Users/steve/.gem/ruby/2.0.0/gems/rake-10.0.4/lib/rake/rake_test_loader.rb" "test/map_stream_test.rb" "test/map_test.rb" "test/merge_test.rb" "test/mvp_test.rb" "test/on_value_test.rb" "test/select_test.rb" | |
| /Users/steve/.gem/ruby/2.0.0/gems/simplecov-html-0.7.1/lib/simplecov-html.rb:57: warning: assigned but unused variable - title_id | |
| /Users/steve/.gem/ruby/2.0.0/gems/coveralls-0.6.7/lib/coveralls.rb:66: warning: `&' interpreted as argument prefix | |
| /Users/steve/.gem/ruby/2.0.0/gems/coveralls-0.6.7/lib/coveralls.rb:72: warning: `&' interpreted as argument prefix | |
| /Users/steve/.gem/ruby/2.0.0/gems/rest-client-1.6.7/lib/restclient/exceptions.rb:157: warning: assigned but unused variable - message | |
| /Users/steve/.gem/ruby/2.0.0/gems/rest-client-1.6.7/lib/restclient/exceptions.rb:167: warning: assigned but unused variable - message | |
| /Users/steve/.gem/ruby/2.0.0/gems/rest-client-1.6.7/lib/restclient/response. |
| #!/usr/bin/env python | |
| import random | |
| for i in range(0, 100): | |
| if not i % 15: | |
| random.seed(1178741599) | |
| print [i+1, "Fizz", "Buzz", "FizzBuzz"][random.randint(0,3)] |
NOTE: This post now lives (and kept up to date) on my blog: http://hakunin.com/rails3-load-paths
Do nothing. All files in this dir are eager loaded in production and lazy loaded in development by default.
| #!/bin/bash | |
| set -exo pipefail | |
| BUILD_ENV=$1 | |
| if [ `uname` == 'Darwin' ]; then | |
| OSX=1 | |
| JSCOMPRESSOR="yuicompressor --type js" | |
| else | |
| OSX= |
| # You will need the pygments and xclip packages | |
| # This example highlights some Bash source code | |
| # '-O noclasses=true' tells pygments to embed colors inline in the source | |
| # the '-t text/html' option tells xclip what "target" to specify for the selection | |
| pygmentize -l bash -f html -O noclasses=true mysource.sh | xclip -selection clipboard -t text/html |
| (ns om-data.core | |
| (:require [om.core :as om :include-macros true] | |
| [om.dom :as dom :include-macros true] | |
| [datascript :as d])) | |
| (enable-console-print!) | |
| (def schema {}) | |
| (def conn (d/create-conn schema)) | |
| #!/usr/bin/env bash | |
| main() { | |
| if [ ! -p .test-commands ]; then | |
| mkfifo .test-commands | |
| fi | |
| while true; do | |
| cmd=$(cat .test-commands) | |
| if [[ $cmd == "" ]]; then |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.