Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

Shigeru Hagiwara hgwr

🏠
Working from home
View GitHub Profile
@hgwr
hgwr / .tmux.conf
Last active Jun 23, 2020
.tmux.conf
View .tmux.conf
# tmux cheat sheet
#
# 新規セッション開始: tmux
# 名前をつけて新規セッション開始: tmux new -s <セッション名>
# セッションの一覧表示: tmux ls
# 接続クライアントの一覧表示: tmux lsc
# セッションを再開 ※-t <対象セッション名>でセッション名の指定も可能: tmux a
# セッションを終了 ※-t <対象セッション名>でセッション名の指定も可能: tmux kill-session
# tmux全体を終了: tmux kill-server
# その他コマンドを実行: tmux [command [flags]]
@hgwr
hgwr / install-npm-packages.sh
Created Dec 30, 2019
install-npm-packages.sh
View install-npm-packages.sh
npm install -g npm
npm install -g yarn
npm install -g textlint
npm install -g @textlint-ja/textlint-rule-no-insert-dropping-sa
npm install -g textlint-rule-en-capitalization
npm install -g textlint-rule-general-novel-style-ja
npm install -g textlint-rule-ja-hiragana-fukushi
npm install -g textlint-rule-ja-hiragana-hojodoushi
npm install -g textlint-rule-ja-hiragana-keishikimeishi
npm install -g textlint-rule-ja-no-abusage
@hgwr
hgwr / .aspell.conf
Last active Nov 3, 2019
2019-08-12 hgwr's home settings
@hgwr
hgwr / .textlintrc
Last active Aug 31, 2019
.textlintrc
View .textlintrc
{
"filters": {},
"rules": {
"@textlint-ja/no-insert-dropping-sa": true,
"ja-hiragana-fukushi": true,
"ja-hiragana-hojodoushi": false,
"ja-hiragana-keishikimeishi": true,
"max-appearence-count-of-words": true,
"no-surrogate-pair": true,
"prefer-tari-tari": true,
@hgwr
hgwr / generate_icns.sh
Created Aug 28, 2019
generate macOS app icons
View generate_icns.sh
#!/usr/bin/env bash
#
# convert big png to macOS app icon sets
#
set -o errexit
set -o pipefail
set -o nounset
trap 'echo "Ctrl-C captured and exit."; exit 1' INT
@hgwr
hgwr / ng_test.sh
Last active Aug 23, 2019
run ng test and less log file
View ng_test.sh
#!/bin/bash
logifle=~/tmp/ng_test_`date +'%Y%m%d-%H%M%S'`.log
if [ `node -v` == "v8.9.4" ]; then
ng test --single-run --code-coverage 2>&1 | tee "$logifle"
else
ng test --watch=false --code-coverage 2>&1 | tee "$logifle"
fi
open coverage/index.html
@hgwr
hgwr / rspec.sh
Created Aug 23, 2019
run rspec and show results and coverages
View rspec.sh
#!/bin/bash
export CIRCLE_ARTIFACTS=.
export COVERAGE=true
export CI=true
export DISABLE_SPRING=true
export ENABLE_COV=true
export RAILS_ENV=test
logifle=~/tmp/rspec_`date +'%Y%m%d-%H%M%S'`.log
bundle exec rspec 2>&1 | tee $logifle
@hgwr
hgwr / install-textlint.sh
Created Aug 17, 2019
install textlint full packages
View install-textlint.sh
npm install -g "textlint"
npm install -g "@textlint-ja/textlint-rule-no-insert-dropping-sa"
npm install -g "@textlint-rule/textlint-rule-no-invalid-control-character"
npm install -g "prh"
npm install -g "spellchecker"
npm install -g "textlint-rule-abbr-within-parentheses"
npm install -g "textlint-rule-common-misspellings"
npm install -g "textlint-rule-date-weekday-mismatch"
npm install -g "textlint-rule-en-capitalization"
npm install -g "textlint-rule-footnote-order"
View recursive_lightweighter.sh
#!/bin/bash
set -o errexit
set -o pipefail
set -o nounset
trap 'echo "Ctrl-C captured and exit."; exit 1' INT
find . -type d \( -not -path '.' -not -path '*outdir' \) -print0 | \
while read -d $'\0' line; do
View lightweighter.sh
#!/bin/bash
set -o errexit
set -o pipefail
set -o nounset
trap 'echo "Ctrl-C captured and exit."; exit 1' INT
trap 'echo "some error occured at $(pwd) and exit."; exit 8' SIGHUP
mkdir -p outdir || exit 1
You can’t perform that action at this time.