Skip to content

Instantly share code, notes, and snippets.

Avatar

Marcus Ramberg marcusramberg

View GitHub Profile
View gist:cbc8d44947bb57063a96fe4583cc26f9
LUKS header information for /dev/nvme0n1p2
Version: 1
Cipher name: aes
Cipher mode: xts-plain64
Hash spec: sha256
Payload offset: 4096
MK bits: 512
MK digest: b9 7a 23 c0 11 6d c7 f2 0f f4 16 e8 45 59 df 7a c6 94 27 41
MK salt: 57 d7 3f 08 7a c4 d9 47 44 fb 7f 2d dc c3 24 9c
View gist:132ba0e79dfd63ec114a7cf5aa789270
diff --git a/src/body.ts b/src/body.ts
index 7699b13..e360a37 100644
--- a/src/body.ts
+++ b/src/body.ts
@@ -64,6 +64,7 @@ export class Body {
* Get message body as a readable stream.
*/
createReadStream(): Readable {
+ if (this._stream.readableEnded) throw 'Request already parsed, trying to read more than once?';
if (this.autoDecompress !== true || this.get('content-encoding') !== 'gzip') return this._stream;
View gist:ca44effd7fecf16c444d8c16778f025b
diff --git a/src/body.ts b/src/body.ts
index 7699b13..b2ab8bd 100644
--- a/src/body.ts
+++ b/src/body.ts
@@ -1,5 +1,6 @@
import type {JSONValue} from './types.js';
import type {Readable, Writable} from 'node:stream';
+import type {IncomingMessage} from 'node:http';
import {on} from 'node:events';
import zlib from 'node:zlib';
View test.js
import mojo from '@mojojs/core';
const app = mojo();
app.post('/', async ctx => {
ctx.log.debug(await ctx.req.text());
await ctx.render({json: await ctx.req.json()});
});
app.start();
@marcusramberg
marcusramberg / gist:e38aad81baebe7793d9e695c684326f7
Last active Jul 4, 2022
Minimal SurfingKeys config for 1.0
View gist:e38aad81baebe7793d9e695c684326f7
// emoji at os-level.
api.iunmap(":");
api.cmap('<Ctrl-n>', '<Tab>');
api.cmap('<Ctrl-p>', '<Shift-Tab>');
settings.modeAfterYank = "Normal";
settings.tabsThreshold = 0;
api.mapkey('<Space>', 'Choose a tab with omnibar', function() {
Front.openOmnibar({type: "Tabs"});
});
View gist:32524971015af294d7696a3222d9f601
1.5) Official ASR mottos
The official ASR motto, our catch phrase, is the immortal:
"Down, not Across"
It is our mantra. We recite it to ourselves as we deal with the day-to-day
realities of a life that is far more nasty, brutish, and short than even
Hobbes could have ever imagined.
View gist:96c47bf9bf53f87104b1d4835a86fbf7
❯ ./node_modules/tap/bin/run.js
test/support/server.js 2> /home/marcus/Source/server-starter/test/support/server.js:1
test/support/server.js 2> Error: listen EINVAL: invalid argument
test/support/server.js 2> at Server.setupListenHandle [as _listen2] (node:net:1293:21)
test/support/server.js 2> at listenInCluster (node:net:1358:12)
test/support/server.js 2> at Server.listen (node:net:1419:5)
test/support/server.js 2> at Object.<anonymous> (/home/marcus/Source/server-starter/test/support/server.js:9:8)
test/support/server.js 2> at Generator.next (<anonymous>)
test/support/server.js 2> Emitted 'error' event on Server instance at:
test/support/server.js 2> at emitErrorNT (node:net:1337:8)
View gist:a237b898019f8ada0987a8eb9d887192
#!/usr/bin/env perl -w
use strict;
if (1) {
$var = 'a';
}
print $var
View surfingkeys.conf
// -----------------------------------------------------------------------------------------------------------------------
// // Surfingkeys: https://github.com/brookhong/Surfingkeys#properties-list
// // Dracula Theme: https://github.com/dracula/dracula-theme#color-palette
// -----------------------------------------------------------------------------------------------------------------------
// Map Keys
// -----------------------------------------------------------------------------------------------------------------------
unmap('ox');
unmap('oh');
unmap('om');
unmap('on');