sudo apt-get update
sudo apt-get upgrade
sudo apt-get install curl git-core python-software-properties
- hbin.github.io
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
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 |
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
body{ | |
background: #222 !important; | |
color: #999 !important; | |
} | |
code{ | |
background: #111; | |
border-radius: 3px; | |
border-color: #555 !important; | |
} |
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
# 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/ |
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.
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 '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 |
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
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 |
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 'benchmark/ips' | |
require 'open-uri' | |
require 'cgi' | |
require 'erb' | |
require 'rack' | |
puts "===== Short String =====\n\n" | |
Benchmark.ips do |x| |
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
#!/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 |
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 DashboardController < ApplicationController | |
def index | |
end | |
def status | |
failed = rand(100) | |
processed = rand(100) + 500 | |
render json: { | |
Total: failed + processed, |
OlderNewer