Skip to content

Instantly share code, notes, and snippets.

View tsai-jimmy's full-sized avatar
🌎
work out of my country

tsai-jimmy tsai-jimmy

🌎
work out of my country
View GitHub Profile
@tsai-jimmy
tsai-jimmy / rails http status codes
Created August 20, 2019 12:17 — forked from mlanett/rails http status codes
HTTP status code symbols for Rails
HTTP status code symbols for Rails
Thanks to Cody Fauser for this list of HTTP responce codes and their Ruby on Rails symbol mappings.
Status Code Symbol
1xx Informational
100 :continue
101 :switching_protocols
102 :processing
@tsai-jimmy
tsai-jimmy / pidCheck.js
Created May 21, 2018 15:40 — forked from twlca/pidCheck.js
檢查身分證字號
/* 依據內政部:
1. 身分證編碼原則
2. 外來人口統一證號編碼原則(居留證) https://www.immigration.gov.tw/ct_cert.asp?xItem=1106801&ctNode=32601&mp=1
身分證及居留證通用
第一碼 縣市編碼原則:
A=10 台北市 J=18 新竹縣 S=26 高雄縣
B=11 台中市 K=19 苗栗縣 T=27 屏東縣
C=12 基隆市 L=20 台中縣 U=28 花蓮縣
D=13 台南市 M=21 南投縣 V=29 台東縣
@tsai-jimmy
tsai-jimmy / setup-gh-cli-auth-2fa.md
Created May 20, 2018 15:06 — forked from ateucher/setup-gh-cli-auth-2fa.md
Setup git on the CLI to use 2FA with GitHub

These are instructions for setting up git to authenticate with GitHub when you have 2-factor authentication set up. This authentication should be inherited by any GUI client you are using. These are intentionally brief instructions, with links to more detail in the appropriate places.

  1. Download and install the git command-line client (if required).

  2. Open the git bash window and introduce yourself to git (if required):

    git config --global user.name 'Firstname Lastname'
    git config --global user.email '[email protected]'
    
@tsai-jimmy
tsai-jimmy / setup-gh-cli-auth-2fa.md
Created May 20, 2018 15:06 — forked from ateucher/setup-gh-cli-auth-2fa.md
Setup git on the CLI to use 2FA with GitHub

These are instructions for setting up git to authenticate with GitHub when you have 2-factor authentication set up. This authentication should be inherited by any GUI client you are using. These are intentionally brief instructions, with links to more detail in the appropriate places.

  1. Download and install the git command-line client (if required).

  2. Open the git bash window and introduce yourself to git (if required):

    git config --global user.name 'Firstname Lastname'
    git config --global user.email '[email protected]'
    
@tsai-jimmy
tsai-jimmy / .gitignore
Created May 14, 2018 04:03 — forked from octocat/.gitignore
Some common .gitignore configurations
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
@tsai-jimmy
tsai-jimmy / version.js
Created April 3, 2018 12:01 — forked from monkianer/version.js
檢查目前瀏覽器的版本
var versions = function (){
var u = navigator.userAgent, app = navigator.appVersion;
var ua = navigator.userAgent.toLowerCase();
return { //偵測移動端瀏覽器版本信息
trident: u.indexOf('Trident') > -1, //IE 核心
presto: u.indexOf('Presto') > -1, //opera 核心
webKit: u.indexOf('AppleWebKit') > -1, //Apple, google 核心
gecko: u.indexOf('Gecko') > -1 && u.indexOf('KHTML') == -1, //Firefox 核心
mobile: !!u.match(/AppleWebKit.*Mobile.*/), //行動裝置
@tsai-jimmy
tsai-jimmy / gist:0fd103dc5f7fbe04b13334ab8b2adb66
Last active April 3, 2018 12:03
[...]擴展運算符Default 、Rest 、Spread
//Default
function findArtist(name='lu', age='26') {
...
}
//Rest
function f(x, ...y) {
// y is an Array
return x * y.length;
}