Skip to content

Instantly share code, notes, and snippets.

@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)
@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 / 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 / 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]
alert('test');
@namikingsoft
namikingsoft / hunho2markdown.sh
Last active June 27, 2018 10:09
[殴り書き] Slack 分報から日報用マークダウン生成 for MacOSX
#!/bin/sh -eu
# Usage: hunho2markdown.sh <2010-01-02>
# required: export SLACK_TOKEN="(e.g. https://api.slack.com/custom-integrations/legacy-tokens)"
# required: brew install pandoc
date="${1:-undefined}"
# slack variables
slack_domain="${SLACK_DOMAIN:-f**df****e}" # ****.slack.com
slack_userid="${SLACK_USERID:-U********}"
@namikingsoft
namikingsoft / waffle_wip_judge.sh
Last active December 4, 2018 02:28
Judge Exceeded WIP Limit on Waffle.io (Experimental)
#!/bin/sh -eu
#
# required env:
# WAFFLE_ACCESS_TOKEN
# WAFFLE_ORG_NAME
# WAFFLE_PROJECT_NAME
#
# required packages:
# base64
# curl
@namikingsoft
namikingsoft / notify-audit-to-slack.sh
Last active February 28, 2019 21:28
Scripts of yarn audit
#!/bin/sh -eu
#
# required env:
# SLACK_TEXT: Description, Build URL of CI
# SLACK_INCOMING: Slack Incoming Webhook URL
#
# required stdin:
# json text of `.data.advisory` on yarn audit
#
# required packages:
@namikingsoft
namikingsoft / notify-wiplimit-of-github-project.sh
Last active May 10, 2019 04:51
Notify Exceeded WIP Limit on GitHub Project via Slack (Experimental)
#!/bin/sh -eu
#
# required env:
# GITHUB_ACCESS_TOKEN
# GITHUB_PROJECT_ID
# GITHUB_PROJECT_SETTING_CARD_ID
# SLACK_INCOMING_WEBHOOK_URL
#
# required packages:
# base64
@namikingsoft
namikingsoft / testcafe-report-json-to-xunit-for-timings.sh
Last active May 24, 2021 08:14
Testcafe report of json to xunit for split by timings on CircleCI
#!/bin/sh -eu
#
# Testcafe report of json to xunit for split by timings on CircleCI
#
# refs.
# https://github.com/DevExpress/testcafe-reporter-xunit
# https://github.com/DevExpress/testcafe-reporter-json
#
# required packages:
# base64