Skip to content

Instantly share code, notes, and snippets.

src
├── array
│   ├── asyncFilter.ts
│   ├── asyncFlatMap.ts
│   ├── asyncForEach.ts
│   ├── asyncMap.ts
│   ├── asyncPartition.ts
│   ├── asyncSome.ts
│   ├── batched.ts
│   ├── compact.ts
graphql-1 | [18:46:43.519] DEBUG: Setting CheckoutConfig:22.options to ReadyPlanOption:11900,ReadyPlanOption:13446,ReadyPlanOption:13420,ReadyPlanOption:11902,ReadyPlanOption:11909
graphql-1 | [18:46:44.040] DEBUG: Base house price = 115074900 (salesPriceInCents=129999900)
graphql-1 | [18:46:44.050] DEBUG: Pricing out rpog:7403 Elevation - {"includedRpo":{"id":"rpo:11900"},"includedPrice":129999900,"selectedRpo":{"id":"rpo:11900"}}
graphql-1 | [18:46:44.051] DEBUG: rpo:11900 Transitional = included
graphql-1 | [18:46:44.055] DEBUG: rpo:11905 Modern Tudor = -470000 (config=ReadyPlanOption:11905,ReadyPlanOption:13446,ReadyPlanOption:11902,ReadyPlanOption:11909)
graphql-1 | [18:46:44.058] DEBUG: rpo:11908 Modern Farmhouse = 95000 (config=ReadyPlanOption:11908,ReadyPlanOption:13446,ReadyPlanOption:11902,ReadyPlanOption:11909)
graphql-1 | [18:46:44.063] DEBUG: Pricing out rpog:8683 Exterior Scheme - {"includedRpo":{"id":"rpo:13446"},"includedPrice":119484400,"selectedRpo":{"id":"rpo:13446"}}
graphq
@stephenh
stephenh / bun.txt
Created March 1, 2025 21:16
Stacks Example
allAwaitsSync
10 | }
11 | async function bar() {
12 | await zaz();
13 | }
14 | async function zaz() {
15 | throw new Error("oops");
^
error: oops
@stephenh
stephenh / morph.ts
Created November 29, 2024 00:45
Remove tsconfig paths to relative imports
import * as path from "path";
import { Project } from "ts-morph";
function getRelativePath(fromPath: string, toPath: string): string {
let relativePath = path.relative(path.dirname(fromPath), toPath);
if (!relativePath.startsWith(".")) {
relativePath = "./" + relativePath;
}
return relativePath.replace(/\\/g, "/");
}
@stephenh
stephenh / .yarnrc.yml
Created October 23, 2023 15:40
supported architectures
# This setting ensures we always install the Linux binaries when running `yarn install`. This is needed for running
# swc natively in Docker from a Mac host.
supportedArchitectures:
cpu:
- current
- x64
- arm64
libc:
- current
- glibc
<body class="b-using-keyboard">
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root" style="position: relative; z-index: 0;">
<div class="css-32lf3s">
<img src="/wordmark.svg" alt="Homebound" class="css-u1jr60" />
<div class="css-1k9buc6">Purchase Order</div>
<div class="css-1yduzul">
<div class="css-11ykhmt">Prime Contractor ("Homebound")</div>
<div class="css-11ykhmt">Trade Partner</div>
</div>
@stephenh
stephenh / .gitconfig
Created July 14, 2022 21:58
Multiple git configs
# In your home directory ~.gitconfig
[user]
name = <your name>
email = <personal-email>@gmail.com
# If all Homebound-related code is in your ~/homebound directory
[includeIf "gitdir:~/homebound/"]
path = .gitconfig-homebound
@stephenh
stephenh / linkedomEnv.js
Created April 3, 2021 22:04
linkedomEnv.js
const { EnvironmentContext, JestEnvironment } = require("@jest/environment");
const { LegacyFakeTimers, ModernFakeTimers } = require("@jest/fake-timers");
const { Config, Global } = require("@jest/types");
const { ModuleMocker } = require("jest-mock");
const JestUtil = require("jest-util");
const { parseHTML } = require("linkedom");
const VM = require("vm");
const { Script } = VM;
/**
@stephenh
stephenh / makeSimpleAutoObservable.ts
Last active August 19, 2021 13:30
makeSimpleAutoObservable.ts
import { $mobx, isObservable, makeObservable } from "mobx";
const annotationsSymbol = Symbol("annotationsSymbol");
const objectPrototype = Object.prototype;
/**
* A purposefully-limited version of `makeAutoObservable` that supports subclasses.
*
* There is valid complexity in supporting `makeAutoObservable` across disparate/edge-casey
* class hierarchies, and so mobx doesn't support it out of the box. See:
@stephenh
stephenh / exact.ts
Created July 9, 2020 20:33
ExactType
type Args = {
id?: string | undefined | null;
firstName?: string | undefined | null;
parentId?: string | undefined | null;
different?: string | undefined | null;
};
type Opts = {
id?: string | undefined | null;
firstName?: string | undefined | null;