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
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) | |
+{ |
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
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(''); |
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
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'); |
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
'use strict'; | |
function wait (ms) { | |
return new Promise((resolve) => setTimeout(resolve, ms)); | |
} | |
async function mainLoop() { | |
while(true) { | |
console.log('tick!'); | |
await wait(1000); |
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
Show hidden characters
{ | |
"compilerOptions": { | |
"module": "commonjs", | |
"noImplicitAny": true, | |
"preserveConstEnums": true, | |
"target": "es2015", | |
"moduleResolution": "node", | |
"strictNullChecks": true, | |
"types": [ | |
"node" |
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 -ue | |
#------------------------------------------------------------------------------- | |
SOURCE_DIR="." | |
DESTINATION_DIR="public/assets" | |
JAVASCRIPTS_DIR="javascripts" | |
STYLESHEETS_DIR="stylesheets" |
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
function Parent () { | |
this._state = []; | |
} | |
Parent.prototype.foo = function (v) { | |
this._state.push(v); | |
}; | |
Parent.prototype.bar = function () { | |
return this._state.join(','); |
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
[/* item */].map(function (item) { | |
return function () { | |
return new Promise(function (resolve, reject) { | |
/* procedure */ | |
}); | |
}; | |
}).reduce(function (a, b) { | |
return function () { | |
return a().then(b); | |
}; |
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
// THIS CODE IS LICENCED UNDER WTFPL | |
var qs = { | |
get: function () { | |
return qs.parse(window.location.search.substring(1)); | |
}, | |
parse: function (str) { | |
return str.split('&').map(function (value) { return value.split('='); }) | |
.reduce(function (obj, pair) { | |
obj[pair[0]] = decodeURIComponent(pair[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
var A = /* put your answer here */, | |
B = /* put your answer here */; | |
if (B/A !== A/B && A === B && 1/A > 2/B) console.log('congrats!'); |