Skip to content

Instantly share code, notes, and snippets.

@timhwang21
timhwang21 / gist:e6a2b24e064182dd9099ad00e4f4f9a6
Created March 19, 2022 03:50 — forked from bluechoochoo/gist:a034da52c64ac6fcb637
text transcription of Stanley Druckenmiller talk at Lost Tree Club, including Q&A w/Ken Langone
Last week the transcript of a talk Stanley Druckenmiller gave went a little viral on #financetwitter.
(http://covestreetcapital.com/Blog/wp-content/uploads/2015/03/Druckenmiller-_Speech.pdf)
Only problem- it's been traveling around in the form of an image PDF,
making it hard to cut + paste or search for your favorite quotes.
So I ran it through a couple programs, and bleepblorp, a text transcript is below.
If you want *just the text,* and not this surrounding web page, click "Raw" in the corner above.
@timhwang21
timhwang21 / missing_indexes.sql
Created July 23, 2020 04:05
Spotting missing indexes for MariaDB & MySQL
SELECT
t.TABLE_SCHEMA,
t.TABLE_NAME,
c.COLUMN_NAME,
IFNULL(
kcu.CONSTRAINT_NAME, 'Not indexed'
) AS `Index`
FROM
information_schema.TABLES t
INNER JOIN information_schema.`COLUMNS` c ON c.TABLE_SCHEMA = t.TABLE_SCHEMA
@timhwang21
timhwang21 / making-tickets-actionable.md
Last active August 2, 2023 16:43
Making Tickets Actionable

Making Tickets Actionable

Tim Hwang


Roles in Product Development

  • PM identifies 🔎 user requirements
  • UX designs 🎨 them
@timhwang21
timhwang21 / curry-record.md
Last active January 9, 2023 21:34
Curry unary functions that take a record as an argument

curryRecord

This is an example of a function whose logic lives in the type definition rather than in the function body.

/**
 * @name `curryRecord`
 *
 * Takes a unary function that takes a record as an argument, and makes the
 * record partially applicable. Returns a new function that takes a partial of
@timhwang21
timhwang21 / conditional-fields.md
Last active July 7, 2022 16:25
Handling conditional field visibility in dynamic forms

Handling conditional field visibility in dynamic forms

This post explores several common ways of handling visibility of conditional fields. Our sample form will have the following schema:

  • foo: always present
  • bar: dependent on form state (value of foo)
  • baz: dependent on other application state (e.g. user permissions)

Below is our form, prior to implementing visibility logic:

@timhwang21
timhwang21 / rickroll.sh
Created March 28, 2021 00:44
chmod +x trust me
#!/bin/sh
sleep .1; printf "⣽⣩⣺⣻⣾⣺⣻⣿⣿⡿⠟⠙⠀⢀⣀⡀⠀⢀⣠⣨⣨⣨⣼⣿⣿⣿⣿⣿⣿⣿⣿⣸⠀⠀
⣿⣿⣿⣿⣿⣿⣿[4

Stevey's Google Platforms Rant

I was at Amazon for about six and a half years, and now I've been at Google for that long. One thing that struck me immediately about the two companies -- an impression that has been reinforced almost daily -- is that Amazon does everything wrong, and Google does everything right. Sure, it's a sweeping generalization, but a surprisingly accurate one. It's pretty crazy. There are probably a hundred or even two hundred different ways you can compare the two companies, and Google is superior in all but three of them, if I recall correctly. I actually did a spreadsheet at one point but Legal wouldn't let me show it to anyone, even though recruiting loved it.

I mean, just to give you a very brief taste: Amazon's recruiting process is fundamentally flawed by having teams hire for themselves, so their hiring bar is incredibly inconsistent across teams, despite various efforts they've made to level it out. And their operations are a mess; they don't real

@timhwang21
timhwang21 / combinators.js
Created July 19, 2020 14:16 — forked from Avaq/combinators.js
Common combinators in JavaScript
const I = x => x;
const K = x => y => x;
const A = f => x => f(x);
const T = x => f => f(x);
const W = f => x => f(x)(x);
const C = f => y => x => f(x)(y);
const B = f => g => x => f(g(x));
const S = f => g => x => f(x)(g(x));
const P = f => g => x => y => f(g(x))(g(y));
const Y = f => (g => g(g))(g => f(x => g(g)(x)));
@timhwang21
timhwang21 / 1-1-template.md
Created January 9, 2020 22:21
1:1 template

DD/MM/YYYY

Questions to direct report

Tasks

What tasks have you accomplished in the first half of the week?

What tasks do you plan on working on in the second half of the week?

@timhwang21
timhwang21 / renderDoctor.js
Last active February 8, 2019 23:33
Diagnose inefficient renders by identifying "changed" props that are actually equal
import React from "react";
import { isEqual } from "underscore";
/**
* HOC for diagnosing unnecessary renders and identifying faulty selectors
*
* Adds a logger function to a component that lists all changed props
* Also checks if changed props are deeply equal
*
* Usage: Decorate the component you are investigating with renderDoctor: