Skip to content

Instantly share code, notes, and snippets.

View taichunmin's full-sized avatar

戴均民 taichunmin

View GitHub Profile
export default {
alpha_dash: (field) => `${field} 欄位只能填寫半形英文字母、數字、底線及剪號。`,
alpha_num: (field) => `${field} 欄位只能填寫半形英文字母及數字。`,
alpha: (field) => `The ${field} 欄位只能填寫半形英文字母。`,
between: (field, [min, max]) => `${field} 欄位必須介於 ${min} 和 ${max} 之間。`,
confirmed: (field, [confirmedField]) => `${field} 欄位必須與 ${confirmedField} 欄位相同。`,
decimal: (field, [decimals] = ['*']) => `${field} 欄位只能填寫${decimals === '*' ? '' : '小數點 ' + decimals + ' 位以內的'}小數。`,
digits: (field, [length]) => `${field} 欄位只能填寫剛好 ${length} 位數的數字。`,
dimensions: (field, [width, height]) => `${field} 欄位只能填寫 ${width} 像素乘以 ${height} 像素。`,
email: (field) => `${field} 欄位的電子郵件地址不正確。`,

用 Docker 來製作優雅的 MongoDB Seeder

本篇是原文 Delightful Database Seeding with Docker 的摘要

流程總共區分為三個階段:

  • 複製正式伺服器的資料並清理
  • 打包並發佈 Seeder
  • 使用 Seeder 匯入資料
@taichunmin
taichunmin / atom-packages.txt
Last active August 31, 2017 08:12
My Atom Installed Packages
aligner@1.2.4
aligner-css@1.2.1
aligner-javascript@1.3.0
aligner-php@1.1.1
atom-beautify@0.30.5
atom-format-lua@0.1.5
autocomplete-paths@2.8.1
busy-signal@1.4.3
docblockr@0.11.0
duplicate-line-or-selection@0.9.0
apt-get install build-essential libtool libusb-dev libusb-1.0 gcc make autoconf pkg-config libudev-dev flex pcsc-tools libpcsclite-dev
#download pcsc lite
wget https://alioth.debian.org/frs/download.php/file/4225/pcsc-lite-1.8.22.tar.bz2
tar xvf pcsc-lite*.tar.bz2
cd pcsc*
@taichunmin
taichunmin / COSCUP2016_slides.md
Last active May 21, 2017 12:01
COSCUP 2016 Workshop: 用 Docker 架設班級 git-it 練習環境,投影片使用 Marp 產生。

用 Docker 架設

班級 git-it 練習環境

By 和風信使 ( @taichunmin )

// https://xss-game.appspot.com/level6
alert(1)
7 4 5
1 3 1
3 2 2
2 3 5
3 4 4
1 6 6
//: Playground - noun: a place where people can play
import Darwin
var prime = [2, 3, 5, 7]
func isPrime(num: Int) -> Bool {
let primeMax = Int(floor(sqrt(Double(num))))
for i in prime {
if i > primeMax {
break
}
@taichunmin
taichunmin / aliyun.sources.list
Created February 11, 2015 08:17
阿里雲 Ubuntu 14.04 的 apt-get 設定 sources.list
# deb http://mirrors.aliyun.com/ubuntu trusty main restricted
# deb http://mirrors.aliyuncs.com/ubuntu trusty main restricted
# deb http://mirrors.aliyun.com/ubuntu trusty-updates main restricted
# deb http://mirrors.aliyuncs.com/ubuntu trusty-updates main restricted
# deb http://security.ubuntu.com/ubuntu trusty-security main restricted
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://mirrors.aliyun.com/ubuntu trusty main restricted