Skip to content

Instantly share code, notes, and snippets.

View ouyangzhiping's full-sized avatar

Zhiping Yang ouyangzhiping

View GitHub Profile
source 'http://rubygems.org'
# --------------------
# 最新修订日期:2011-10-14
# --------------------
# 0. Rails
# --------------------
gem 'rack', '1.3.3' #修正rake报错<http://stackoverflow.com/question/7624661/>
gem 'rails', '3.1.3'
# Gems used only for assets and not required
# in production environments by default.
@ouyangzhiping
ouyangzhiping / etcinit.dphp-fastcgi
Created September 6, 2011 09:26
etc-init.d-php-fastcgi
#!/bin/bash
PHP_SCRIPT=/usr/bin/php-fastcgi
FASTCGI_USER=www-data
FASTCGI_GROUP=www-data
PID_DIR=/var/run/php-fastcgi
PID_FILE=/var/run/php-fastcgi/php-fastcgi.pid
RET_VAL=0
case "$1" in
@ouyangzhiping
ouyangzhiping / php-fastcgi
Created September 6, 2011 09:23
php-fastcgi
#!/bin/bash
FASTCGI_USER=www-data
FASTCGI_GROUP=www-data
ADDRESS=127.0.0.1
PORT=9000
PIDFILE=/var/run/php-fastcgi/php-fastcgi.pid
CHILDREN=6
PHP5=/usr/bin/php5-cgi
@ouyangzhiping
ouyangzhiping / copsy.org.config
Created September 6, 2011 09:09
nginx配置php站点示范
server {
server_name localhost www.copsy.org copsy.org;
access_log /srv/www/copsy.org/logs/access.log;
error_log /srv/www/copsy.org/logs/error.log;
root /srv/www/copsy.org/public_html;
location / {
index index.html index.htm index.php;
if (-f $request_filename/index.html){
rewrite (.*) $1/index.html break;
@ouyangzhiping
ouyangzhiping / nginx.sh
Created September 6, 2011 08:47 — forked from marshluca/nginx.sh
/etc/init.d/nginx
# /etc/init.d/nginx
#! /bin/sh
### BEGIN INIT INFO
# Provides: nginx
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
@ouyangzhiping
ouyangzhiping / .bash_login
Created July 11, 2011 15:58
My .bash_login file with git+brew support+textmate
# PATH ------------------------------------------------------------
export PATH="/usr/local/bin:/usr/local/Cellar/ruby/1.9.2-p180/bin/:/usr/local/sbin:~/bin/:$PATH"
# Add Bash Completion ---------------------------------------------
if [ -f `brew --prefix`/etc/bash_completion ]; then
. `brew --prefix`/etc/bash_completion
fi
# Add Bash Completion support for Brew ----------------------------
source `brew --prefix`/Library/Contributions/brew_bash_completion.sh
@ouyangzhiping
ouyangzhiping / gist.rb
Created July 8, 2011 15:24
github库修改之后的gist.rb文件
# Copyright 2008 Chris Wanstrath
# Taken from defunkt's gist repository: http://github.com/defunkt/gist/tree/master
require 'open-uri'
require 'net/http'
require 'net/https'
module Gist
extend self
@ouyangzhiping
ouyangzhiping / gist:1058219
Created July 1, 2011 10:05
10 Ruby One Liners to Impress Your Friends
#10 Ruby One Liners to Impress Your Friends
#http://programmingzen.com/2011/06/02/10-ruby-one-liners-to-impress-your-friends/
#1. Multiply each item in a list by 2
p (1..10).map {|n| n*2}
#2.Sum a list of numbers
p (1..1000).inject { |sum, n| sum + n }
@ouyangzhiping
ouyangzhiping / gist:1053292
Created June 29, 2011 06:58
安装gems时如何跳过ri以及RDoc的.gemrc配置示例
---
:benchmark: false
:bulk_threshold: 1000
:verbose: true
:update_sources: true
:sources:
- http://rubygems.org/
- http://gemcutter.org
:backtrace: false
#gemrc目录在: mate ~/.gemrc
@ouyangzhiping
ouyangzhiping / gist:1053214
Created June 29, 2011 05:28
.zshrc文件配置示例
# Path to your oh-my-zsh configuration.
export ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
# 配置theme,这是默认的theme.
export ZSH_THEME="robbyrussell"