Skip to content

Instantly share code, notes, and snippets.

View drew-y's full-sized avatar

Drew Youngwerth drew-y

  • OpenAI
  • San Francisco, CA
  • 17:48 (UTC -07:00)
View GitHub Profile
@drew-y
drew-y / jwt-bench.js
Last active November 14, 2024 23:25
Fixed Java vs Node.js JWT Benchmark
// Adapted from benchmark described in this article https://medium.com/deno-the-complete-reference/node-js-vs-java-how-faster-is-bytecode-compared-to-interpreted-code-for-jwt-sign-verify-910caa55a7f2
// Moves the SHA Key outside of the loop, Brings performance down to ~7 seconds on M3 Macbook Air 24GB RAM
import jwt from "jsonwebtoken";
import { readFileSync } from "node:fs";
import { KeyObject } from "node:crypto";
const emails = JSON.parse(readFileSync("./emails.json"));
let i = 1,
idx = 0;

Updated Release Process Proposal

Goals of this plan:

  • Eliminate interruptions to an in-progress release
  • Move towards a trunk based continuous delivery model (https://trunkbaseddevelopment.com/)
  • Avoid disruption to engineers

proposed-git-workflow

New Concepts

@drew-y
drew-y / sign-commits-gpg-mac.md
Last active March 27, 2022 23:34
How to Sign Commits With GPG on macOS
@drew-y
drew-y / pipe.ts
Created February 28, 2019 00:15
Simple TypeScript Pipe Pattern Implementation
interface Pipe<T> {
val: T;
into<U>(cb: (val: T) => U): Pipe<U>;
}
function pipe<T>(val: T): Pipe<T> {
return { val, into: cb => pipe(cb(val)) }
}
// // Example Usage
@drew-y
drew-y / hyperscript.js
Created April 17, 2016 21:26
HyperScript for client side templating
var compileAtts = function(atts, node) {
for (var prop in atts) {
var att = document.createAttribute(prop);
att.value = atts[prop].toString();
node.setAttributeNode(att);
}
};
var compileElement = function(tagName, args) {
var atts = args[0] instanceof Object ? args.shift() : false;
@drew-y
drew-y / ajax.js
Last active April 17, 2016 22:01
Simple promise based ajax helper function
/**
* Ajax helper, returns a promise. Assumes both request and response are json.
*/
function ajax(type, url, data) {
return new Promise(function (resolve, reject) {
var req = new XMLHttpRequest();
req.onload = function () {
if (req.status >= 200 && req.status < 400) {
resolve(JSON.parse(req.responseText));
} else {