Skip to content

Instantly share code, notes, and snippets.

View ThisIsMissEm's full-sized avatar

Emelia Smith ThisIsMissEm

View GitHub Profile
@ThisIsMissEm
ThisIsMissEm / Schema.graphql
Created October 2, 2019 05:15
Form Validation as a Result Union
mutation updateUser(
details: UpdateUserInput!
): UpdateUserResult
union UpdateUserResult =
UpdateUserSuccess |
FormValidationError
type UpdateUserSuccess {}

Yes, this is absolutely a spam email. Worse than that, you've failed to at all in anyway make this a personal outreach to a candidate.

Honestly, I've lost track of how many times I've declined Amazon already. You treat staff who are essential to your business like crap, have huge and unjustified pay disparities between your lowest paid and highest paid staff, invade peoples privacy & sell that data to police, have shitty management practices that undervalue minorities, and a crappy interviewing process.

Ask yourself: given all that, why would I ever want to work at Amazon?

You're like the Boomer of tech companies.

#! /usr/bin/env node
/**
* This file does not use typescript as it's run before you've necessarily run `yarn install`
* As such, we can only use built-in modules here.
*/
function main() {
let [
// Arguments from the githook: https://git-scm.com/docs/githooks#_post_checkout
import { Kafka, logLevel, KafkaConfig, SASLOptions } from "kafkajs";
const options: KafkaConfig = {
clientId: "my-client",
brokers: (process.env.KAFKA_BROKERS &&
process.env.KAFKA_BROKERS.split(",")) || ["localhost:9092"]
};
if (
process.env.KAFKA_AUTH_MECHANISM &&
type Key {
constructor(identifier)
unlock(): Promise<void>
lock(): Promise()<void>
decrypt(value: ArrayBuffer): Promise<ArrayBuffer>
}
type Key {
constructor(identifier)
unlock(): Promise<void>
lock(): Promise()<void>
decrypt(value: ArrayBuffer): Promise<ArrayBuffer>
}
@ThisIsMissEm
ThisIsMissEm / gist:13d37d8745f39656ed52e88031d69bf6
Created July 24, 2019 19:28
Securely(?) sharing private keys using DHTs & one-time tokens
‪From the initiating client (owner)‬
1. create a short-code (say 12 lowercase hex characters)‬
2. Using the dat archives public key, encrypt that value, let that be token‬
3. poll a DHT for token's value‬
4. Once we receive a value for that token, encrypt the archive private key with the received public key & save as a file
‪From the new client:‬
1. Ask the user to input the short-code from the same dat archive
2. Using the archives public-key, encrypt that value
3. Create a new public/private key pair
const fs = require("fs").promises;
const createReadStream = require("fs").createReadStream;
const debug = require("debug");
class MessageLogDB {
constructor(filename, separator) {
this.separator = separator || "\r\n";
this.separator_length = Buffer.byteLength(this.separator, "utf8");
this.filename = filename;
const fs = require("fs").promises;
const path = require("path");
const execa = require("execa");
const assert = require("assert");
const gitUrlParse = require("git-url-parse");
const fse = require("fs-extra");
async function findRepos(workingDirectory) {
const nodes = await fs.readdir(workingDirectory, { withFileTypes: true });
const directories = nodes.filter(node => node.isDirectory());
@ThisIsMissEm
ThisIsMissEm / package.json
Last active April 6, 2019 22:14
Concept for multi-registry support in package.json
{
"name": "my-app",
"version": "1.0.0",
"registries": {
"npm": { "url": "registry.npmjs.org", "default": true },
"tidelift": { "url": "registry.tidelift.org" },
"acme-corp": { "url": "verdaccio.acme.corp" }
},
"dependencies": {
"express": "^4.0.x",