Skip to content

Instantly share code, notes, and snippets.

Avatar

Emelia Smith ThisIsMissEm

View GitHub Profile
@ThisIsMissEm
ThisIsMissEm / router.tsx
Last active Dec 4, 2020
How to use loadable component properly with react-router using full dynamic imports and correct typescript types.
View router.tsx
import loadable, { LoadableComponent } from '@loadable/component';
import { RouteComponentProps } from 'react-router-dom';
import { StaticContext } from 'react-router';
import { LocationState } from 'history';
// Autogenerated Types for the Capabilities and their Screens:
import { Capabilities, Screens } from './routeTypes';
export * from 'react-router-dom';
export function createScreen<
@ThisIsMissEm
ThisIsMissEm / bootstrap.ts
Created Sep 27, 2020
entrypoint.js is the entrypoint for the CLI and lives in bin/ and is tied to a scripts entry. bootstrap.js figures out the conditions under which we are executing, and extracts the argv variables from the command run in the terminal, so you can pass them to your cli.js file.
View bootstrap.ts
import path from 'path';
const debug = require('debug')('cli:bootstrap');
debug({
npm_lifecycle_script: process.env.npm_lifecycle_script,
npm_config_argv: process.env.npm_config_argv,
npm_config_username: process.env.npm_config_username,
});
@ThisIsMissEm
ThisIsMissEm / t5571-pre-push-hook.sh.diff
Created Aug 19, 2020
Patch with test for git pre-push hook when remote is already up to date; No stdin lines are generated
View t5571-pre-push-hook.sh.diff
diff --git a/t/t5571-pre-push-hook.sh b/t/t5571-pre-push-hook.sh
index ac53d63869..edb619726e 100755
--- a/t/t5571-pre-push-hook.sh
+++ b/t/t5571-pre-push-hook.sh
@@ -19,14 +19,31 @@ test_expect_success 'setup' '
test_commit one &&
git push parent1 HEAD:foreign
'
+
+COMMIT1="$(git rev-parse HEAD)"
View How To Reply To Amazon Recruiters.md

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.

@ThisIsMissEm
ThisIsMissEm / Post-checkout-hook.js
Last active Oct 2, 2020
The only post-checkout git hook I'll agree with
View Post-checkout-hook.js
#! /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
View post-checkout.js
#! /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
@ThisIsMissEm
ThisIsMissEm / Schema.graphql
Created Oct 2, 2019
Form Validation as a Result Union
View Schema.graphql
mutation updateUser(
details: UpdateUserInput!
): UpdateUserResult
union UpdateUserResult =
UpdateUserSuccess |
FormValidationError
type UpdateUserSuccess {}
View kafka.ts
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 &&
View KafkaRPC.js
import { Kafka, Consumer, Producer, KafkaMessage } from "kafkajs";
import { Logger } from "pino";
import { EventEmitter } from "events";
import uuidv4 from "uuid/v4";
type Options = {
groupId: string;
topicPrefix: string;
logger: Logger;
};
View Keys-api.js
type Key {
constructor(identifier)
unlock(): Promise<void>
lock(): Promise()<void>
decrypt(value: ArrayBuffer): Promise<ArrayBuffer>
}