Skip to content

Instantly share code, notes, and snippets.

Avatar

Hidekazu Kobayashi KOBA789

View GitHub Profile
@KOBA789
KOBA789 / multine-dewplayer.js
Created Oct 17, 2021
http://maltinerecords.cs8.biz/ の試聴プレイヤーを dewplayer(Flash 製)から HTML5 Audio に置き換えるブックマークレット
View multine-dewplayer.js
[...document.querySelectorAll('object[data^="/dewplayer.swf"]')].forEach(dew=>{const a=new Audio(new URL(dew.data).searchParams.get('mp3'));a.controls=true;a.style.width='150px';a.style.height='20px';dew.replaceWith(a);})
View large-chain.zse
{"wires":{"root":{"children":[{"Parent":{"children":[{"Parent":{"children":[{"Parent":{"children":[{"Parent":{"children":[{"Leaf":{"from":[550,100],"to":[550,200]}},{"Leaf":{"from":[800,100],"to":[800,200]}},{"Leaf":{"from":[500,400],"to":[500,500]}},{"Leaf":{"from":[750,400],"to":[750,500]}}],"envelope":{"lower":[500,100],"upper":[800,500]}}},{"Parent":{"children":[{"Leaf":{"from":[1000,400],"to":[1000,500]}},{"Leaf":{"from":[1050,100],"to":[1050,200]}},{"Leaf":{"from":[1250,400],"to":[1250,500]}},{"Leaf":{"from":[1300,100],"to":[1300,200]}}],"envelope":{"lower":[1000,100],"upper":[1300,500]}}},{"Parent":{"children":[{"Leaf":{"from":[1500,400],"to":[1500,500]}},{"Leaf":{"from":[1550,100],"to":[1550,200]}},{"Leaf":{"from":[2000,400],"to":[2000,500]}},{"Leaf":{"from":[2050,100],"to":[2050,200]}}],"envelope":{"lower":[1500,100],"upper":[2050,500]}}}],"envelope":{"lower":[500,100],"upper":[2050,500]}}},{"Parent":{"children":[{"Parent":{"children":[{"Leaf":{"from":[550,900],"to":[550,1000]}},{"Leaf":{"from":[800,
View keybase.md

Keybase proof

I hereby claim:

  • I am koba789 on github.
  • I am koba789 (https://keybase.io/koba789) on keybase.
  • I have a public key ASBdqnayPVpvFG06bpP6y8zfmcn-hUQrOPZFHh5MqvZ1Ewo

To claim this, I am signing this object:

@KOBA789
KOBA789 / 00_timeline.md
Created Sep 15, 2018 — forked from south37/00_timeline.md
ISUCON Cheat Sheet
View 00_timeline.md
View trackpoint_keyboard.lua
-- HANDLE SCROLLING
local deferred = false
overrideMiddleMouseDown = hs.eventtap.new({ hs.eventtap.event.types.otherMouseDown }, function(e)
--print("down"))
deferred = true
return true
end)
@KOBA789
KOBA789 / fix_snr.patch
Created Mar 15, 2018
recdvb-1.3.1 の SNR 表示をいい感じにするパッチ
View fix_snr.patch
diff --git a/recpt1core.c b/recpt1core.c
index 168a023..36dd1fd 100644
--- a/recpt1core.c
+++ b/recpt1core.c
@@ -39,11 +39,50 @@ close_tuner(thread_data *tdata)
}
void
+print_stat(struct dtv_stats stat)
+{
View type_safe_url_template.ts
class PathTemplate<N extends string> {
constructor(public fragments: string[], public paramNames: N[]) {}
render(params: {[_ in N]: string}) {
const buf = [this.fragments[0]];
for (let i = 0; i < this.paramNames.length; ++i) {
buf.push(params[this.paramNames[i]]);
buf.push(this.fragments[i + 1]);
}
return buf.join('');
View inference.ts
function dig<T, K extends keyof T>(obj: T, key: K): T[K] {
return obj[key];
}
const s: string = dig({ a: 'hoge', b: 1 }, 'a');
const t: number = dig({ a: 'hoge', b: 1 }, 'b');
@KOBA789
KOBA789 / async_await.js
Created Feb 22, 2017
Node.js v7.6.0 記念
View async_await.js
'use strict';
function wait (ms) {
return new Promise((resolve) => setTimeout(resolve, ms));
}
async function mainLoop() {
while(true) {
console.log('tick!');
await wait(1000);
@KOBA789
KOBA789 / tsconfig.json
Last active Jan 28, 2017
よさそう.json
View tsconfig.json
{
"compilerOptions": {
"module": "commonjs",
"noImplicitAny": true,
"preserveConstEnums": true,
"target": "es2015",
"moduleResolution": "node",
"strictNullChecks": true,
"types": [
"node"