git init <目錄>
git clone <repo>
git config user.name
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
TAR_FILENAME=_production-upload.tar.gz | |
npm install | |
gulp --production | |
# 拿掉 dev 環境相依套件 | |
composer install --prefer-dist --no-dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### lib/capistrano/tasks/touch_all_linked_files.rake | |
namespace :deploy do | |
namespace :check do | |
# desc 'Touches all linked files' | |
task :touch_all_linked_files do | |
on release_roles :all do | |
fetch(:linked_files, []).each do |file| | |
target = shared_path.join(file) | |
execute :touch, target | |
info "Touched : #{target}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### part of config/deploy.rb | |
namespace :deploy do | |
namespace :check do | |
# desc 'Touches all linked files' | |
task :touch_all_linked_files do | |
on release_roles :all do | |
fetch(:linked_files, []).each do |file| | |
target = shared_path.join(file) | |
unless File.file?(target) | |
info "File.file?('#{target}') : #{File.file?(target)}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//增加固定長度的 validation rule | |
$.validator.addMethod("exactlength", function(value, element, param) { | |
return this.optional(element) || value.length == param; | |
}, $.validator.format("輸入長度必須為 {0} 個字元.")); | |
$.validator.addMethod("checkTWPID", function(value, element, param) { | |
var letters = new Array('A', 'B', 'C', 'D', | |
'E', 'F', 'G', 'H', 'J', 'K', 'L', 'M', | |
'N', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', | |
'X', 'Y', 'W', 'Z', 'I', 'O'); |