Skip to content

Instantly share code, notes, and snippets.

View iCasablanca's full-sized avatar

Love in Casablanca iCasablanca

View GitHub Profile
@iCasablanca
iCasablanca / xterm-256color.md
Created October 16, 2018 03:57 — forked from shawnbot/xterm-256color.md
Make OS X Terminal respect 256 colors in screen

1. Ensure that Terminal declares itself as "xterm-256color"

Under Terminal > Preferences... > (Profile) > Advanced, "Declare terminal as:" should be set to xterm-256color.

2. Build a version of screen that supports 256 colors

This is easy with homebrew:

brew tap homebrew/dupes
@iCasablanca
iCasablanca / .vimrc
Last active October 16, 2018 02:52
vimrc
" Vundle Enable vimrc
set nocompatible " not compatible with the old-fashion vi mode
filetype off " required!
" Setting up Vundle - the vim plugin bundler
let iCanHazVundle=1
let vundle_readme=expand('~/.vim/bundle/Vundle.Vim/README.md')
if !filereadable(vundle_readme)
echo "Installing Vundle.."
echo ""
@iCasablanca
iCasablanca / pow
Created November 23, 2011 02:17 — forked from ches/pow
A quick script to switch between running Pow and Apache on OS X
#!/bin/sh -e
#/ Usage: pow [on|off]
#/ Toggle between running Pow (http://pow.cx) and Apache on Mac OS X.
# Show Usage
function usage {
grep '^#/' "$0" | cut -c4-
exit 2
}
[ -z "$1" -o "$1" = "--help" ] && usage
@iCasablanca
iCasablanca / pow
Created August 31, 2011 03:43 — forked from ches/pow
A quick script to switch between running Pow and Apache on OS X
#!/bin/sh -e
#/ Usage: pow [on|off]
#/ Toggle between running Pow (http://pow.cx) and Apache on Mac OS X.
# Show Usage
function usage {
grep '^#/' "$0" | cut -c4-
exit 2
}
[ -z "$1" -o "$1" = "--help" ] && usage
@iCasablanca
iCasablanca / gist:1153141
Created August 18, 2011 02:16 — forked from hbrandl/gist:547170
.irbrc for rails3 (based on tech-angels.fr)
#making .irbrc posted at http://www.tech-angels.fr/post/963080350/improve-irb-and-fix-it-on-mac-os-x
#work with rails3
require 'rubygems'
#rails3: be sure to include wirble and hirb in your Gemfile
require 'wirble'
require 'hirb'
Wirble.init
Wirble.colorize
# hirb (active record output format in table)
@iCasablanca
iCasablanca / gist:1150914
Created August 17, 2011 06:11 — forked from xdite/gist:758319
Ruby / Rails Convention of Techbang

Rails 開發注意要點

About Ruby Syntax

  • 編輯器設定 soft tab (space=2),以 2 格空白符號做為程式內縮距離(不分語言)。
  • 函式如果只有一個參數,就不強制打()
  • 函式如果有二個以上的參數,通通都要有 ()
    • (避免發生奇怪的paser bug跟保持專案一致性)
  • 字串限定用雙引號包覆
  • 善用 "#{str1} #{str3} " 等字串改寫技巧取代不需要的字串加法。
@iCasablanca
iCasablanca / install_homebrew.rb
Created July 26, 2011 15:19 — forked from mxcl/install_homebrew.markdown
Installs Homebrew to /usr/local so you don't need sudo to `brew install`
#!/usr/bin/ruby
#
# This script installs to /usr/local only. To install elsewhere you can just
# untar https://github.com/mxcl/homebrew/tarball/master anywhere you like.
#
#
# 30th March 2010:
# Added a check to make sure user is in the staff group. This was a problem
# for me, and I think it was due to me migrating my account over several
# versions of OS X. I cannot verify that for sure, and it was tested on