Skip to content

Instantly share code, notes, and snippets.

Shengyou Fan shengyou

Block or report user

Report or block shengyou

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View 入厝指南
h1. 入厝準備
h2. 準備物品
* 雞腿飯(7-11)
* 包著紅包紙袋的白蘿蔔
- 紅包 (7-11)
- 白蘿蔔 (菜市場)
* 一杯白開水
- 紙杯(7-11)
@maccman
maccman / app.rb
Created Jul 6, 2012
Sinatra Async UI chat
View app.rb
#!/usr/bin/env ruby
# coding: utf-8
require 'sinatra'
set :server, 'thin'
set :sessions, true
streams = Hash.new {|k, v| k[v] = [] }
helpers do
def session_id
@RhinoLu
RhinoLu / ChkRepeatedValue.as
Created Mar 9, 2012
檢查一維陣列中的值(數字、字串)是否重複
View ChkRepeatedValue.as
package
{
public class ChkRepeatedValue
{
/**
* 檢查陣列中的值是否有重複值,只能是一維陣列,例[0,1,2,3,4,5,6],常用於表單檢查
* 例[0,1,1,3,3]將回傳[[1, 2], [3, 4]]
* @param _array 待檢查之陣列
* @return 陣列,例如 [[0, 1], [2, 3, 4]] 代表 第0,1個相同,第2,3,4個值相同
*/
@kaochenlong
kaochenlong / gist:1889703
Created Feb 23, 2012
台灣公司統一編號判斷規則
View gist:1889703
# encoding: utf-8
def company_serial_no_checker(serial)
# 共八位,全部為數字型態
at_least_8_digits = /^\d{8}$/
return false unless at_least_8_digits.match(serial)
# 各數字分別乘以 1,2,1,2,1,2,4,1
# 例:統一編號為 53212539
You can’t perform that action at this time.