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.
| class DashboardController < ApplicationController | |
| def index | |
| end | |
| def status | |
| failed = rand(100) | |
| processed = rand(100) + 500 | |
| render json: { | |
| Total: failed + processed, |
| #!/bin/sh | |
| ### BEGIN INIT INFO | |
| # Provides: nginx | |
| # Required-Start: $local_fs $remote_fs $network $syslog $named | |
| # Required-Stop: $local_fs $remote_fs $network $syslog $named | |
| # Default-Start: 2 3 4 5 | |
| # Default-Stop: 0 1 6 | |
| # Short-Description: starts the nginx web server | |
| # Description: starts nginx using start-stop-daemon |
| require 'benchmark/ips' | |
| require 'open-uri' | |
| require 'cgi' | |
| require 'erb' | |
| require 'rack' | |
| puts "===== Short String =====\n\n" | |
| Benchmark.ips do |x| |
| if defined?(Kaminari) | |
| class Array | |
| # This would be helpful when handling an Array object that | |
| # has a different count value from actual count. | |
| # | |
| # Example: | |
| # arr = ['a', 'b', 'c', 'd', 'e'] | |
| # | |
| # paged = arr.paginate(total_count: 200).page(2) #-> ['a', 'b', 'c', 'd', 'e'] | |
| # paged.total_count #-> 200 |
| require 'rack' | |
| require 'rack/handler/webrick' | |
| require 'net/http' | |
| # The code for this is inspired by Capybara's server: | |
| # http://github.com/jnicklas/capybara/blob/0.3.9/lib/capybara/server.rb | |
| class LocalhostServer | |
| READY_MESSAGE = "Server ready" | |
| class Identify |
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.
| # First install tmux | |
| brew install tmux | |
| # For mouse support (for switching panes and windows) | |
| # Only needed if you are using Terminal.app (iTerm has mouse support) | |
| Install http://www.culater.net/software/SIMBL/SIMBL.php | |
| Then install https://bitheap.org/mouseterm/ | |
| # More on mouse support http://floriancrouzat.net/2010/07/run-tmux-with-mouse-support-in-mac-os-x-terminal-app/ |
| body{ | |
| background: #222 !important; | |
| color: #999 !important; | |
| } | |
| code{ | |
| background: #111; | |
| border-radius: 3px; | |
| border-color: #555 !important; | |
| } |
| bind K_4 PLAYCALL4 | |
| bind K_3 PLAYCALL3 | |
| bind K_2 PLAYCALL2 | |
| bind K_1 PLAYCALL1 | |
| bind K_DOWN DOWN | |
| bind K_UP UP | |
| bind K_LEFT LEFT | |
| bind K_RIGHT RIGHT | |
| bind K_Z BACKDOWN | |
| bind K_C CROSSOVER |