Skip to content

Instantly share code, notes, and snippets.

View lynsei's full-sized avatar
:octocat:
Huzzah!

Lynsei lynsei

:octocat:
Huzzah!
View GitHub Profile
@lynsei
lynsei / deploy-your-own-saas.md
Last active January 19, 2024 20:22
[how to unpack an xpi | asar, reference] #asar #xpi #unpack #xpi-unpack #firefox-extension #userChrome.css #hack #userChrome.css does stuff

Everything You Need To Become A Machine Learner

Part 1:


Everything You Need To Become A Machine Learner

Part 1:

@lynsei
lynsei / instant-setup.lyns
Last active March 29, 2022 14:48
[raw github] #userful #raw #github #fish commands
#!lyns
# this file works as either .lyns or .fish. Lyns is interoperable with Fish, it is just a superset focused on Docker and DAPR/ K&s, and ML ModelOps.
if ! test -z $MY_VERSION && test -z (set -q $MY_VERSION); echo $MY_VERSION; else; echo "no-version"; end;
if $MY_VERSION not no-version
curl -LO https://raw.githubusercontent.com/fish-shell/fish-shell/master/share/config.fish
end;
@lynsei
lynsei / fish.example.truth.md
Last active March 29, 2022 14:43
[truth in fish] #fish or #lyns

Truth in Fish/Lyns takes a bit of getting used to but is fairly elegant if done correctly:

function if-test-no-arg
  set var

  if set -q var
    # true
  end

 if set -q var[1]
@lynsei
lynsei / vsc-extensions.txt
Created March 9, 2022 04:42
[vscode extensions list] these worth. #extensions #vscode
42Crunch.vscode-openapi
4a454646.github-purple
4tron.ionic-docs
4tron.ionic4-snippets-vscode
aaa1.all-nighter-italic
aaron-bond.better-comments
aaron00101010.http-client
Aashish.emoji-in-git-commit
abhith.vscode-favorites
abierbaum.vscode-file-peek
@lynsei
lynsei / my-open-pgp-reference.js.md
Created February 22, 2022 15:27
[openpgp] #reference #openpgp #pgp #implementation #node #nodejs #tsc #typescript

Encrypt and decrypt String data with PGP keys

Encryption will use the algorithm preferred by the public (encryption) key (defaults to aes256 for keys generated in OpenPGP.js), and decryption will use the algorithm used for encryption.

const openpgp = require('openpgp'); // use as CommonJS, AMD, ES6 module or via window.openpgp
(async () => {
    // put keys in backtick (``) to avoid errors caused by spaces or tabs
    const publicKeyArmored = `-----BEGIN PGP PUBLIC KEY BLOCK-----
@lynsei
lynsei / es6-cjs-import-murder-hornets.md
Last active March 28, 2022 15:57
[es6-cjs] #murder #hornets because every project seems to suffer in the ecosystem of #nodejs. It is probably #ryan #dahls fault somehow.

"Murder Hornets attacked my code.

"this code never had errors before, but now through the magic of async functions, it has all sorts of problems. Why do node CommonJS authors hate ESM authors so much?" --- some guy on the internet

a.k.a. What it feels like to work in Typescript sometimes

Look folks, the Node and ECMAScript (ESM) developers don't hate each other (too much)! Nor do the users or developers of these two subtly different loading systems for Node packages, because we ALL use them, and we also use many of the NPM features that go hand-in-hand like workspaces, modules, linking etc. We don't hate anyone because we aren't 12 years old, yet, either!

The problem is there are subtle differences between ECMA Script 6 or ES6, and CommonJS. These subtle differences make me curse Ryan Dahl, but that's okay. I mean who doesn't? Imports are newer and much more complex, but they are [built in to the Javascript Language, after all](https://developer.mozilla.org/en-US/docs/web/javascript/refe

@lynsei
lynsei / .env
Last active February 17, 2022 18:10
[#dotenv usage] with #import instead of require (as a #Node Module rather than a require of CommonJS package)
API_KEY=api-key-123456789
# UUID
For the creation of [RFC4122](http://www.ietf.org/rfc/rfc4122.txt) UUIDs. Via NodeJS module from NPM.
- **Complete** - Support for RFC4122 version 1, 3, 4, and 5 UUIDs
- **Cross-platform** - Support for ...
- CommonJS, [ECMAScript Modules](https://www.npmjs.com/package/uuid#ecmascript-modules) and [CDN builds](https://www.npmjs.com/package/uuid#cdn-builds)
- Node 8, 10, 12, 14
- Chrome, Safari, Firefox, Edge, IE 11 browsers
- Webpack and rollup.js module bundlers
@lynsei
lynsei / binary-streams.duplex.md
Created February 15, 2022 09:38
[in-duplex, binary streams] # ie.- #double #binding #binary #streams in browser #bundles using #socket.io #client/server

Installation

npm install socket.io-stream

Usage