Skip to content

Instantly share code, notes, and snippets.

View vincentjiang's full-sized avatar

VincentJiang vincentjiang

View GitHub Profile
@vincentjiang
vincentjiang / vimrc
Last active August 29, 2015 14:08
vimrc
set encoding=utf8
map <C-h> <C-w>h
map <C-j> <C-w>j
map <C-k> <C-w>k
map <C-l> <C-w>l
set tabstop=2
set softtabstop=2
set shiftwidth=2
@ktaragorn
ktaragorn / puma.sh
Last active January 15, 2018 09:08 — forked from ivanxuu/puma.sh
#! /bin/sh
### BEGIN INIT INFO
# Provides: pumacontrol
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Puma web server
@nightire
nightire / Changes in Rails 4_1.md
Last active May 11, 2022 04:50
拥抱 Rails 4 —— 详述 Rails 4 的新变化

Routes

小心地使用 Match(Rails 3 已实现)

Rails 3 提供了 match 方法供我们自定义 routes,然而我们要小心使用它以避免“跨站脚本攻击”(XSS Attack)。比如像这样的 routes:

注:(r3 代表 Rails 3,r4 代表 Rails 4)

# routes.rb