start new:
tmux
start new with session name:
tmux new -s myname
| ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}%{$fg[cyan]%}[" | |
| ZSH_THEME_GIT_PROMPT_SUFFIX="]%{$reset_color%}" | |
| ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}*%{$reset_color%}" | |
| ZSH_THEME_GIT_PROMPT_CLEAN="" | |
| #Customized git status, oh-my-zsh currently does not allow render dirty status before branch | |
| git_custom_status() { | |
| local cb=$(current_branch) | |
| if [ -n "$cb" ]; then | |
| echo "$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_PREFIX$(current_branch)$ZSH_THEME_GIT_PROMPT_SUFFIX" |
| # Will remove all .mp3 files starting in current directory and will search in each folder | |
| find . -name '._*' -exec rm -f {} \; |
| class CPF | |
| def self.generate | |
| digits = [] | |
| 9.times { digits << rand(9) } | |
| 2.times { digits << self.verification_digit_for(digits) } | |
| digits.join | |
| end | |
| private |
| #!/usr/bin/env bash | |
| uninstall() { | |
| list=`gem list --no-versions` | |
| for gem in $list; do | |
| gem uninstall $gem -aIx | |
| done | |
| gem list | |
| gem install bundler | |
| } |
| // | |
| // CRUD API for RESTful services with URLs similar 'http://services.mysite.com/classes/Book'. | |
| // | |
| // e.g. parse.get( | |
| // "Book", | |
| // 123, | |
| // function(response){ console.log(response.toString());} | |
| // ); | |
| // | |
| services.factory('parse', function($rootScope, $http) { |
This guide enables you to install (ruby-build) and use (rbenv) multiple versions of ruby, isolate project gems (gemsets and/or bundler), and automatically use appropriate combinations of rubies and gems.
# Ensure system is in ship-shape.
aptitude install git zsh libssl-dev zlib1g-dev libreadline-dev libyaml-dev
| require 'net/ftp' | |
| CONTENT_SERVER_DOMAIN_NAME = "one-of-the-ftp-server.thought-sauce.com.hk" | |
| CONTENT_SERVER_FTP_LOGIN = "saucy-ftp-server-login" | |
| CONTENT_SERVER_FTP_PASSWORD = "saucy-ftp-server-password" | |
| # LOGIN and LIST available files at default home directory | |
| Net::FTP.open(CONTENT_SERVER_DOMAIN_NAME, CONTENT_SERVER_FTP_LOGIN, CONTENT_SERVER_FTP_PASSWORD) do |ftp| | |
| files = ftp.list |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>Box Shadow</title> | |
| <style> | |
| .box { | |
| height: 150px; | |
| width: 300px; | |
| margin: 20px; |