Skip to content

Instantly share code, notes, and snippets.

@panfu
panfu / bash_alias.sh
Created December 15, 2009 06:20
alias me
# ls ..
alias ls='ls -G'
alias ll='ls -hla'
# ror script
alias sc="./script/console"
alias ss="./script/server"
# git alias
alias gmm="git merge master"
@panfu
panfu / Git上删除乱码文件的方法.sh
Created December 15, 2009 07:05
Git上删除乱码文件的方法
# 1. 更改git转码设置
git config core.quotepath false
# 2. 第一步完成后, git status 还是看不到正确编码的话, 修改命令行窗口的编码格式, 一般修改为gb2312即可
# 3. 还是不行的话, 自己找解决办法, 找到后告诉我在此补充!
@panfu
panfu / 关于encode的那些事儿.rb
Created December 17, 2009 04:07
关于encode的那些事儿
require 'cgi'
require 'uri'
r =<<JS
{
"max_character_length": '140',
"mouseover_active": false,
"hovering_delay": 1000,
"translations": {
"button_change": "Change",
@panfu
panfu / oo.js
Created December 20, 2009 16:37
OO.js
function obj(a) {
this.a = a;
this.b = getB();
function getB() {
this.c = 'this is c';
return 'this is b';
}
}
@panfu
panfu / chef-install-snow-leopard.sh
Created January 6, 2010 06:01 — forked from gnip/chef-install-snow-leopard.sh
snow-leopard 安装宝典
# chef-server as ssh tunnel (reverse-proxy) for Mac OS X 10.6 SL
# Based loosely on Readme.rdoc - http://github.com/opscode/chef/
# port install CouchDB (may be broken on Snow Leopard)
sudo port install couchdb-devel
sudo launchctl load -w /Library/LaunchDaemons/org.apache.couchdb.plist
sudo launchctl unload -w /Library/LaunchDaemons/org.apache.couchdb.plist
# check for Trace/BPT trap error
couchdb
CTRL ^C
@panfu
panfu / .emacs
Created July 11, 2010 12:34
我的emacs配置简略
(global-set-key "\C-c\C-d" "\C-a\C- \C-n\M-w\C-y")
;; (menu-bar-mode 0)
(tool-bar-mode 0)
(define-key global-map [menu-bar tools] nil)
(add-to-list 'load-path "~/emacs")
(require 'my_config)
@panfu
panfu / new_git.sh
Created November 14, 2010 12:02
新生成一个git项目
Global setup:
Download and install Git
git config --global user.name "panfu"
git config --global user.email [email protected]
Next steps:
mkdir mochiweb_example
cd mochiweb_example
git init
touch README
# Textmate essential bundles
cd ~/Library/Application\ Support/TextMate/Pristine\ Copy/Bundles
# mkdir -p cd /Applications/TextMate.app/Contents/SharedSupport/Bundles
git clone git://github.com/protocool/ack-tmbundle.git Ack.tmbundle
git clone git://github.com/textmate/ruby-haml.tmbundle.git
git clone git://github.com/seaofclouds/sass-textmate-bundle.git "Ruby Saas.tmbundle"
git clone git://github.com/bmabey/cucumber-tmbundle.git Cucumber.tmbundle
git clone git://github.com/karnowski/blue-ridge-tmbundle.git JavaScript\ Blue\ Ridge.tmbundle
git clone git://github.com/johnmuhl/nginx-tmbundle.git nginx.tmbundle
# This is probably because you have a too recent version of bundler installed. Integrity v22 is not compatible with bundler > 0.9, but relies on functionality that was in removed in the subsequent version. In my case I installed bundler 0.9 before I ran bundle install:
gem install bundler --version=0.9
url\(\"(.*?)/(\w+.png)\"\) #=> url("../images/$2")