Skip to content

Instantly share code, notes, and snippets.

View firstfu's full-sized avatar
🧸
Focusing

firstfu firstfu

🧸
Focusing
  • Taiwan
View GitHub Profile
@firstfu
firstfu / cloudSettings
Last active September 4, 2020 06:52
Visual Studio Code Settings Sync Gist
{"lastUpload":"2020-09-04T06:52:38.927Z","extensionVersion":"v3.4.3"}
## 判断是否为isNaN
let n1 = NaN
let n2 = 'NaN'
console.log(Number.isNaN(n1))
console.log(Number.isNaN(n2))
sudo nginx -s start
sudo nginx -s reload
# 新增SSH Key
$ ssh-keygen -t rsa -C "youremail@example.com"
getDay()返回一星期中的某一天(0-6)
getDate()返回一个月中的某一天(1-31)
getDate (date) {
return {
year: date.getFullYear(),
month: date.getMonth(),
day: date.getDay(),
date: date.getDate()
}
# 單行聲明變量
let x = 5, y, z = 4
## null 表示無值
## undefined 表示沒有定義的變數
##變數設定為- undefined
bartimer = void 0;
##判斷變數如果不為undefined,則變數設定為undefined
if (typeof bartimer != 'undefined'){
bartimer = void 0;
## 取代全部
let dd = '2019-08-31 16:57:46'
dateVal = dateVal.replace(/-/g, '/')
##去除數字後多除0
$disPrice = rtrim(rtrim($disPrice, '0'), '.');