{{< gist username document_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
// オブジェクトのプロパティを結合することも可能 | |
const withProp1 = { | |
n: 1, | |
o: { | |
prop1: 'p1', | |
prop2: 'p2', | |
}, | |
}; | |
const withProp2 = { | |
n: 1, |
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
// スプレッド構文でオブジェクトを結合する | |
// オブジェクトfirst、オブジェクトsecondを結合してオブジェクトthirdを作る | |
const first = { | |
a: 1, | |
b: 2, | |
c: 3, | |
}; | |
const second = { | |
d: 4, | |
e: 5, |
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
// スプレッド構文でオブジェクトをコピーする | |
const original = { | |
a: 1, | |
b: 2, | |
c: 3, | |
}; | |
const copied = {...original}; | |
console.log(copied); // {a: 1, b: 2, c: 3} |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<title>list-style</title> | |
<style> | |
p > code { | |
padding-left: 0.5rem; | |
} |
Basic usage:
{{< figure src="path/to/image.png" >}}
add figcaption:
{{< figure src="path/to/image.png" caption="figure caption" >}}
set width:
{{< figure src="path/to/image.png" caption="figure caption" width="500" >}}
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
set d to (do shell script "d=`date +%s`;echo ${d:(-4)}") | |
set the clipboard to d |
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
on run {input, parameters} | |
tell application "Terminal" | |
activate | |
tell front document | |
do script "cd " & input & "; subl ." | |
end tell | |
end tell | |
return input |
サイトのすべてのファイルを http://www.example.com にリダイレクトする。ただし、dir1ディレクトリ以下は除外する(リダイレクトしない)。
RedirectMatch 301 "^/((?!dir1).*)$" http://www.example.com/
除外するディレクトリが複数ある場合、たとえばdir1だけでなくdir2以下も除外するときはこうする。
RedirectMatch 301 "^/((?!(dir1|dir2)).*)$" http://www.example.com/
NewerOlder