graph TD;
subgraph 結果
R0[何もなし]
R1[強化値ダウン]
R2[銀剥がし]
R3[メッキ印消し]
R4[印消し]
end
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 binconv = (()=>{ | |
// base64 <-> binary | |
const atob = window.atob | |
const btoa = window.btoa | |
// binary <-> Uint8Array | |
const btou8 = b => new Uint8Array([].map.call(b,c=>c.charCodeAt(0))) //new Uint8Array([...b].map(c=>c.charCodeAt(0))) | |
const u8tob = u8 => String.fromCharCode.apply(null,u8) //String.fromCharCode(...u8) | |
// string <-> Uint8Array |
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
#!/usr/bin/env bash | |
sudo yum groups install -y Development\ tools | |
sudo yum install -y cmake | |
sudo yum install -y python34-{devel,pip} | |
sudo pip-3.4 install neovim --upgrade | |
( | |
cd "$(mktemp -d)" | |
git clone https://github.com/neovim/neovim.git | |
cd neovim | |
make CMAKE_BUILD_TYPE=Release |
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
#!/bin/bash | |
# Qiita記事 https://qiita.com/kawaz/items/0593163c1c5538a34f6f | |
set -e | |
set -o pipefail | |
# pam_tidの存在チェック(間違えてLinux環境などで実行されたら中断する) | |
[[ -f /usr/lib/pam/pam_tid.so.2 ]] || exit 1 | |
[[ "${OSTYPE:0:6}" == "darwin" ]] || exit 1 | |
# /etc/pam.d/sudo を念のためターミナルに出力しておく(似非バックアップ) |
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
#!/bin/bash | |
# コピペで使えてシンプルなやつ (動的なファイルディスクリプタ) | |
# 2重起動防止 | |
exec {lock}<"$0"; flock -n "$lock" || { | |
echo "this script is already running" >&2 | |
exit 1 | |
} | |
echo "なにかの処理" |
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 superInterval = (cb, interval=1000, ...args) => { | |
try { | |
const code = `self.addEventListener('message', msg=>{setInterval(()=>self.postMessage(null), msg.data)})` | |
const w = new Worker(`data:text/javascript;base64,${btoa(code)}`) | |
w.onmessage = () => cb(...args) | |
w.postMessage(interval) | |
return {stop:()=>w.terminate()} | |
} catch(_){ | |
// 実装の問題またはCSPによる拒否などで Worker が使えなければ普通の setInterval を使う | |
const id = setInterval(cb, interval, ...args) |
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
#!/bin/bash | |
# テンプレート変数を用意 | |
declare -A TEMPLATE_KV=() | |
while read -r k v; do | |
k=${k//-/_}; k=${k//:/}; k=${k^^} | |
TEMPLATE_KV["$k"]="$v" | |
done < <(ec2-metadata -i -t -h -o -z -p -v) | |
TEMPLATE_KV[REGION]=$(perl -pe's/[a-z]$//' <<< "${TEMPLATE_KV[PLACEMENT]}") |
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
// 日本語の声をランダムに1つ選ぶ | |
const voices = speechSynthesis.getVoices().filter(v=>/^ja-/.test(v.lang)) | |
const voice = voices[Math.floor(voices.length*100000*Math.random())%voices.length] | |
const ssu = new SpeechSynthesisUtterance() | |
ssu.lang = 'ja-JP' // 言語 | |
ssu.voice = voice // 発話に使用する音声(未設定の場合lang設定を見て適切な音声が選ばれる | |
ssu.volume = 1 // 発話の音量 0~1、default=1 | |
ssu.rate = 1 // 発話の速度 0.1~10、default=1 | |
ssu.pitch = 1 // 発話の音程 0~2、default=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
#!/bin/bash | |
set -e -o pipefail | |
# HostedZone[].Id を保存 | |
aws route53 list-hosted-zones | jq .HostedZones[].Id -r | tee HostedZoneIds.txt | |
# 全HostedZoneのRecordSetを取得 | |
while read id; do | |
aws route53 list-resource-record-sets --hosted-zone-id "$id" | |
done <HostedZoneIds.txt | tee rs.json.tmp |
NewerOlder