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
ruby -run -e httpd . -p 8000 |
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
$ ps auxf |
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
javascript:$("img.avatar").attr("src", "https://pbs.twimg.com/profile_images/903950953459490816/1_wK5kUp_400x400.jpg") |
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
{ | |
"editor.fontFamily": "'CamingoCode', 'Ricty Diminished'", | |
"editor.fontSize": 14, | |
"editor.tabSize": 2, | |
"editor.formatOnType": true, | |
"editor.cursorBlinking": "smooth", | |
"editor.renderWhitespace": "boundary", | |
"editor.renderControlCharacters": true, | |
"editor.renderIndentGuides": true, | |
"editor.renderLineHighlight": "all", |
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
help | |
prefix+? | |
起動 | |
% tmux | |
or | |
% tmux new-session | |
セッションの確認 | |
% tmux ls |
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
echo 192.168.3.{1..254} | xargs -P256 -n1 ping -s1 -c1 -W1 | grep ttl |
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 | |
ffmpeg -i "$1" -c copy "openrec-`date "+%Y-%m%d-%H%M%S"`.ts" | |
# ./dl.sh http://url.to/m3u8 | |
# https://gist.github.com/rokugasenpai/cdaff5eac2e88e6b9efe412982e7ae31 |
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
// 5勝でOKラインになり8敗で割れる ⇒ 5勝7敗までセーフ | |
// であるから、求める確率は | |
// 4勝n敗してから5勝目をおさめる確率 (n = 0, 1, ..., 7) | |
// = (4勝0敗の確率 + 4勝1敗の確率 + 4勝2敗の確率 + ... + 4勝7敗の確率) × 5勝目をする確率 | |
// $= (_4C_0p^4 + _5C_1p^4(1-p)+ _6C_2p^4(1-p)^2 + \cdots + _{11}C_7p^4(1-p)^7)\cdot p$ | |
// ただし p は勝率とする | |
// nPk | |
const permutation = (n, k) => Array.from({length: k}, (_, i) => n - i).reduce((a, b) => a * b, 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
window.$ = (function () { | |
if (Math.random() < 0.95) return $; // 影響範囲をへらしてリスク減らす | |
var getCallStack = function () { | |
try { | |
throw new Error("DUMMY"); | |
} catch(e) { | |
return e.stack | |
.split(/[\r\n]+/) | |
.filter(function (s){ |
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
// ns.targetFnを上書きしたい | |
var ns = { | |
prop: 10 | |
}; | |
ns.__proto__.targetFn = function targetFn(v1, v2) { | |
return this.prop + v1 + v2 | |
}; | |
console.log(ns.targetFn(5, 3)); // => 18 | |
var tmp1 = ns.targetFn; |