Skip to content

Instantly share code, notes, and snippets.

View nathanstilwell's full-sized avatar
💭
🔥 💻 🤘 💀

Nathan Stilwell nathanstilwell

💭
🔥 💻 🤘 💀
View GitHub Profile
@nathanstilwell
nathanstilwell / Makefile
Created July 25, 2017 21:35
How to Makefile for dummies. Like me.
##
## A Sample Makefile
##
## I worked on a pretty good Makefile once, so here's a sample in case I want to do one again.
## Comments are above their relavant sections.
##
##
## SHELL - declare the path to the shell you would like to run this shell as
##
@nathanstilwell
nathanstilwell / openapi.json
Last active March 26, 2019 19:29
Flow public api as openapi version 3.0.2
This file has been truncated, but you can view the full file.
{
"components": {
"schemas": {
"account_orders_export_type": {
"properties": {
"statement_id": {
"type": "string"
},
"transaction_summary_id": {
"type": "string"
@nathanstilwell
nathanstilwell / nathan-numerals.ts
Created August 26, 2023 21:40
Nathan Numerals
/* Nathan's Numerals */
const NathanNumerals = [
"•", "|", "—",
"+", "x", "=",
"△", "⊓", "ϟ",
"⏥", "⧖", "⩕",
] as const;
type NathanNumeralID = typeof NathanNumerals[number];
const nanu: Record<NathanNumeralID, number> = {
"⩕": 117147,
@nathanstilwell
nathanstilwell / groupByAndAnnotate.test.ts
Last active April 19, 2024 20:58
Something I was toying with that may not be a good idea.
describe('groupByConfig', () => {
it('should group primitive values based on predicate', () => {
const data = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
const grouped = groupByConfig<number>(
{ predicate: (n) => n % 2 === 0, annotation: 'Even numbers' },
{ predicate: (n) => n % 2 !== 0, annotation: 'Odd numbers' }
)(data);
expect(grouped).toEqual([
{ list: [2, 4, 6, 8, 10], annotation: 'Even numbers' },