Skip to content

Instantly share code, notes, and snippets.

@phongnh
phongnh / tmux.md
Created April 3, 2014 10:53 — forked from andreyvit/tmux.md

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

# Mac OS X Lion introduced a new, iOS-like context menu when you press and hold a key
# that enables you to choose a character from a menu of options. If you are on Lion
# try it by pressing and holding down 'e' in any app that uses the default NSTextField
# for input.
#
# It's a nice feature and continues the blending of Mac OS X and iOS features. However,
# it's a nightmare to deal with in Sublime Text if you're running Vintage (Vim) mode,
# as it means you cannot press and hold h/j/k/l to move through your file. You have
# to repeatedly press the keys to navigate.
require 'rubygems'
require 'hmac-sha1'
require 'net/https'
require 'base64'
s3_access='S3_ACCESS_KEY'
s3_secret='S3_SECRET_KEY'
cf_distribution='CLOUDFRONT_DISTRIBUTION_ID'
if ARGV.length < 1
require 'rubygems'
require 'hmac-sha1'
require 'net/https'
require 'base64'
AWS_KEY = '...'
AWS_SECRET = '...'
CLOUDFRONT_DISTRIBUTION_ID = '...'
date = Time.now.utc
# for more info: https://gist.github.com/1120938
<dict>
<key>name</key>
<string>Git Modified Line</string>
<key>scope</key>
<string>git.changes.x</string>
<key>settings</key>
<dict>
<key>background</key>
<string>#272852</string>
</dict>
@phongnh
phongnh / Installing RVM Ruby Rails Passenger nginx on CentOS
Created October 8, 2012 11:52 — forked from utf/Installing RVM Ruby Rails Passenger nginx on CentOS
Installing RVM + Ruby + Rails + Passenger + nginx on CentOS
#Steps to install RVM + Ruby 1.9.3 + Rails + nginx + Passenger on CentOS (tested on v5.5)
# Todo get up to date repo's
# Install git and curl, if not already installed
sudo yum install git
sudo yum install curl-devel
# Create the rvm group and add any users who will be using rvm to the group
sudo su -
@phongnh
phongnh / optparse-template.rb
Created October 7, 2012 18:28 — forked from rtomayko/optparse-template.rb
Ruby optparse template
#!/usr/bin/env ruby
#/ Usage: <progname> [options]...
#/ How does this script make my life easier?
# ** Tip: use #/ lines to define the --help usage message.
$stderr.sync = true
require 'optparse'
# default options
flag = false
option = "default value"
@phongnh
phongnh / cap staging deploy
Created August 2, 2012 11:57
cap staging deploy
$ cap staging deploy
* executing `staging'
triggering start callbacks for `deploy'
* executing `multistage:ensure'
* executing `deploy'
triggering before callbacks for `deploy'
* executing "sudo /etc/init.d/hw-cache-agent stop && sleep 5"
servers: ["staging.hubworks.com.au"]
[staging.hubworks.com.au] executing command
command finished in 6510ms
@phongnh
phongnh / gist:3179691
Created July 26, 2012 01:11
cap staging deploy
08:04:31 phongnh@phongnh:/home/phongnh/Working/hubworks [staging_er13 *] []
$ cap staging deploy
* executing `staging'
triggering start callbacks for `deploy'
* executing `multistage:ensure'
* executing `deploy'
triggering before callbacks for `deploy'
* executing "sudo /etc/init.d/hw-cache-agent stop && sleep 5"
servers: ["staging.hubworks.com.au"]
[staging.hubworks.com.au] executing command