I hereby claim:
- I am alastaircoote on github.
- I am alastair (https://keybase.io/alastair) on keybase.
- I have a public key whose fingerprint is 09CE E35D 405E DD3C 46B0 27D2 17C9 9C92 91E4 E05B
To claim this, I am signing this object:
const stream = new ReadableStream({ | |
start: async function(controller) { | |
controller.enqueue("<html>"); | |
let content = await getSomeContent(); | |
controller.enqueue(content); | |
controller.enqueue("</html>"); | |
} | |
}); | |
let r = new Response(stream,{ |
I hereby claim:
To claim this, I am signing this object:
import opentype from 'opentype.js'; | |
let lastRenderTime = null; | |
let x = 0; | |
let y = 0; | |
let moveBackwards = false; | |
let moveUp = false; | |
let logoImg = null; | |
let parsedFont = null; |
const trySubscribeAction = function(id, action, log) { | |
return Promise.resolve() | |
.then( () => { | |
if (action == "subscribe") { | |
return subscribePromise(id); | |
} else { | |
return unsubscribePromise(id); | |
} | |
}) | |
.then( (result) => { |
SELECT | |
min(log_entries."time") AS "time", | |
max(log_entries.level) AS level, | |
jsonb_merge(log_entries.data) AS data, | |
json_agg(log_entries.msg) AS msg, | |
log_entries.req_id | |
FROM log_entries | |
GROUP BY log_entries.req_id |
CREATE OR REPLACE FUNCTION jsonb_merge_state(jsonb, jsonb) | |
returns jsonb | |
language sql | |
as $$ | |
SELECT $1 || $2 | |
$$; | |
DROP AGGREGATE IF EXISTS jsonb_merge(jsonb); | |
CREATE AGGREGATE jsonb_merge(jsonb) ( |
class DbStream extends stream.Writable { | |
constructor() { | |
super( {objectMode: true} ); | |
} | |
_write(data, encoding, cb) { | |
let specificFields = ["name", "pid", "hostname", "time", "level", "msg", "req_id", "v"]; | |
let fieldData = []; |
CREATE TABLE "log_entries" ( | |
"id" serial PRIMARY KEY, | |
"name" varchar NOT NULL, | |
"pid" int8 NOT NULL, | |
"hostname" varchar NOT NULL, | |
"time" timestamp NOT NULL, | |
"level" integer NOT NULL, | |
"msg" varchar NOT NULL, | |
"v" integer NOT NULL, | |
"req_id" varchar, |
var webviewProvider = (function() { | |
if (/\/FBIOS/i.test(navigator.userAgent) === true) { | |
return 'facebook'; | |
} | |
if (/Twitter for/i.test(navigator.userAgent) === true) { | |
return 'twitter'; | |
} | |
if (/Pinterest\//.test(navigator.userAgent) === true) { | |
return 'pinterest'; | |
} |