Skip to content

Instantly share code, notes, and snippets.

@gogojimmy
gogojimmy / .gitconfig
Created January 12, 2012 02:58
My gitconfig file
[user]
name = gogojimmy
email = jimmy@gogojimmy.net
[alias]
co = checkout
st = status
br = branch
ci = commit
di = diff
dc = diff --cached
@gogojimmy
gogojimmy / hack.sh
Created March 31, 2012 13:40 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# 以下實用的指令是從下面連結取用的:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#

#Coding style:

  • 使用兩個半型空白作為縮排。
  • 在 property 宣告中的 : 後面皆一個半型空白。
  • { 的宣告前面加上一個半型空白。

範例:

.styleguide-format {
 border: 1px solid #0f0;
require 'capistrano/ext/multistage'
require 'bundler/capistrano'
require 'capistrano_colors'
#$:.unshift(File.expand_path('./lib', ENV['rvm_path']))
require "rvm/capistrano"
set :rvm_ruby_string, ENV['GEM_HOME'].gsub(/.*\//,"")
set :rvm_install_type, :stable
set :rvm_type, :system
Jimmy at gogojimmy in ~/Projects/Personal/babysworld on develop?
$ cap deploy:cold
triggering start callbacks for `deploy:cold'
* 08:05:28 == Currently executing `multistage:ensure'
*** Defaulting to `staging'
* 08:05:28 == Currently executing `staging'
* 08:05:28 == Currently executing `deploy:cold'
* 08:05:28 == Currently executing `deploy:update'
** transaction: start
* 08:05:28 == Currently executing `deploy:update_code'
@gogojimmy
gogojimmy / HPX NPO WordPress 設定及外掛參考.md
Created September 10, 2012 15:30
HPX NPO WordPress 設定及外掛參考

#設定 WordPress

#善用第三方工具

@gogojimmy
gogojimmy / Capistrano-Deployment-Recipe.rb
Created October 11, 2012 01:05 — forked from mrrooijen/Capistrano-Deployment-Recipe.rb
a "base" Capistrano Rails Deployment Recipe. Use it to deploy your Rails application. It is also easily expandable. So feel free to grab this Recipe and add your own tasks/customization!
# Guide
# Configure the essential configurations below and do the following:
#
# Repository Creation:
# cap deploy:repository:create
# git add .
# git commit -am "initial commit"
# git push origin master
#
# Initial Deployment:

Contract Killer 3

Revised date: 07/11/2012

Between us [company name] and you [customer name]

Summary:

We’ll always do our best to fulfil your needs and meet your expectations, but it’s important to have things written down so that we both know what’s what, who should do what and when, and what will happen if something goes wrong. In this contract you won’t find any complicated legal terms or long passages of unreadable text. We’ve no desire to trick you into signing something that you might later regret. What we do want is what’s best for both parties, now and in the future.

#!/usr/bin/env bash
apt-get -y update
apt-get -y install build-essential zlib1g-dev libssl-dev libreadline6-dev libyaml-dev gcc
cd /tmp
wget ftp://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p0.tar.gz
tar -xvzf ruby-2.0.0-p0.tar.gz
cd ruby-2.0.0-p0/
./configure --prefix=/usr/local
make
make install
#!/usr/bin/env bash
# Pre-requisites
sudo apt-get -y update
sudo apt-get --no-install-recommends -y install build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev libgdbm-dev ncurses-dev automake libtool bison subversion pkg-config libffi-dev vim
# Download and compile Ruby 2.0.0-p0
cd /tmp
wget ftp://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p0.tar.gz
tar -xvzf ruby-2.0.0-p0.tar.gz