Skip to content

Instantly share code, notes, and snippets.

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

Nathan Stilwell nathanstilwell

💭
🔥 💻 🤘 💀
View GitHub Profile
@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' },
@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 / 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 / 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
##
function stringTohex(string) {
// convert to base64
const base64encoded = btoa(string);
// convert to array
const arr = base64encoded.split('');
// convert to string to char code
const charCodes = arr.map((letter) => letter.charCodeAt());

Keybase proof

I hereby claim:

  • I am nathanstilwell on github.
  • I am nathanstilwell (https://keybase.io/nathanstilwell) on keybase.
  • I have a public key ASB0Moj6IJNp1qXV0wwt-xmNdlOxIDljvs2V9THKUETbmAo

To claim this, I am signing this object:

/* Rainbows */
.meetup-makes-it-magical--rainbow-everything {
background: -moz-linear-gradient(
right,
hsl(0, 100%, 50%) 1%,
hsl(0, 100%, 50%) 14%,
hsl(30, 100%, 50%) 14%,
hsl(30, 100%, 50%) 28%,
hsl(60, 100%, 50%) 28%,
hsl(60, 100%, 50%) 42%,
(function (global) {
//
// Vars
//
var prefix = 'meetup-makes-it-magical--';
var magicStyleUrl = 'https://cdn.rawgit.com/nathanstilwell/54f147004fc83b5d3885/raw/22ab7a581c5377ff2c679a93f6c02f1d1c2f1cdc/magical.css';
var supercornUrl = 'https://raw.githubusercontent.com/upright-netizen/uprightnetizen.com/102d1d84259c54189ad31110668455f167302d3c/img/supercorn.gif';
var supercornClassname = prefix + 'supercorn';
/*global require: true*/
'use strict';
var gulp = require('gulp');
var gutil = require('gulp-util');
var rename = require('gulp-rename');
var svgstore = require('gulp-svgstore');
var svgmin = require('gulp-svgmin');
var svgfallback = require('gulp-svgfallback');
@nathanstilwell
nathanstilwell / .eslintrc
Last active September 19, 2015 23:51
This is an ESLint config I'm using. I'll update and us it as a reference
{
"rules": {
"quotes": [2, "single"],
"linebreak-style": [2, "unix"],
"semi": [2, "always"]
},
"env": {
"es6": true,
"node": true,
"browser": true