Skip to content

Instantly share code, notes, and snippets.

alert('test');
@namikingsoft
namikingsoft / flatten-using-reduce.js
Last active June 11, 2016 23:31
Flatten using reduce - reduce関数を使ってflattenを実現する
const flattened = [[0, 1], [2, 3], [4, 5]].reduce((p, x) => p.concat(x));
// flattened is [0, 1, 2, 3, 4, 5]
@namikingsoft
namikingsoft / object-assign-vs-rest-spread.js
Last active May 23, 2016 03:17
Object.assign vs Object rest spread
{
let options = {
key1: "val1",
};
const optionsDefault = {
key1: "default-val1",
key2: "default-val2",
};
// object rest spread on es7
@namikingsoft
namikingsoft / docker-build-another-file.sh
Last active January 25, 2016 17:19
Docker build another Dockerfile - 別のDockerfileからビルド
# stdin
docker build -t hoge - < Dockerfile.another
# option
docker build -t hoge -f Dockerfile.another .
@namikingsoft
namikingsoft / rm-all-on-directory-include-hidden-file.sh
Last active January 25, 2016 16:47
Delete all on directory include hidden file - ディレクトリの中身を隠しファイルを含め、全て削除
rm -rf $(find /path/to/directory -maxdepth 1 -mindepth 1)