Skip to content

Instantly share code, notes, and snippets.

@twalker
twalker / base_keymap.md
Created December 28, 2023 23:05
tw2k's base keymap

tw2k's base keymap

legend

abbreviation definition
CDH base layer
MAC Macros one-shot layer
# numbers layer
ESC$ escape on tap, symbols layer on hold
@twalker
twalker / History|-141572fa|entries.json
Last active July 27, 2022 01:02
Getting started with MB's custom keyboard
{"version":1,"resource":"file:///Users/timwalker/projects/zmk-crkbd/.github/workflows/build.yml","entries":[{"id":"KEcD.yml","timestamp":1649020939184}]}
@twalker
twalker / mb-choose-a-board.md
Created January 29, 2022 05:11
mb-choose-a-board.md

Choose your ergonomic keyboard

I plan to build a custom ergonomic mechanical keyboard for you. We want it to fit you so well it becomes a joy to type.

Choose your board

Name # of keys** Number row Column stagger Notes
@twalker
twalker / favorite-10-metal-bands.md
Last active August 22, 2020 23:15
favorite-10-metal-bands.md

Favorite Metal Bands

  1. Slayer
  2. Gojira
  3. Megadeth
  4. Voivod
  5. King Diamond
  6. Sepultura
  7. Nevermore
  8. Prong
@twalker
twalker / cloud-init
Created November 3, 2018 16:51 — forked from jwkidd3/cloud-init
#cloud-config
package_upgrade: true
write_files:
- path: /etc/systemd/system/docker.service.d/docker.conf
content: |
[Service]
ExecStart=
ExecStart=/usr/bin/dockerd
- path: /etc/docker/daemon.json
content: |
@twalker
twalker / tech-alignment-redis-retry-strategy.md
Last active September 12, 2018 20:45
tech-alignment-redis-retry-strategy.md

Problem

A hard dependency on redis servers being available, with no way to implement a fallback if they're not.

The refresh token requests are dependent on our redis servers being available to store tokens (#3237) . If the redis server is down, refresh token requests will not complete. PR: https://scm.starbucks.com/starbucks-web/core/pull/3469

Solution

Inform consumers of the redis being in a faulted state (cannot connect, redis crashed, redis out of memory, servers not available, etc.), so they can implement a fallback strategy. e.g. If redis is down, go directly to the api for data that was expected to be in cache.

Demo

@twalker
twalker / app-state-flow.txt
Last active September 24, 2017 02:18
app state flow
dispatch(action) (state, action)
+-------------+ data +------------+ +------------+ +--> +------------+
| gql/bff api | +--> | Action | +--> | Store | | Reducers |
+------^------+ | Creators | +-----+------+ <--+ +------------+
| +------------+ <-+ | (newState)
+--------+ fetch(url, query) | |
| connect
| |
| |
| +-----v------+
@twalker
twalker / set-on-fire.js
Created May 13, 2016 02:37
set-on-fire.js
#!/usr/bin/env node
'use strict';
if (process.argv.length <= 2) {
process.stdout.write(`Usage: node ./emojize.js <outputPath>\n`);
process.exit(-1);
}
const path = require('path');
const inPath = path.resolve(process.argv[2]);
@twalker
twalker / cli-intl-example.js
Created April 13, 2016 04:45
cli-intl-example.js
// global.Intl = require('intl');
// global.Intl.__applyLocaleSensitivePrototypes();
// Intl.NumberFormat = IntlPolyfill.NumberFormat;
// Intl.DateTimeFormat = IntlPolyfill.DateTimeFormat;
// IntlPolyfill.__applyLocaleSensitivePrototypes();
var IntlPolyfill = require('intl');
Intl.NumberFormat = IntlPolyfill.NumberFormat;
Intl.DateTimeFormat = IntlPolyfill.DateTimeFormat;
@twalker
twalker / intl-node-protoype-example.js
Last active April 13, 2016 03:08
Repro example for needing to Polyfill Date/Number prototypes in node.
var express = require('express');
var app = express();
if (global.Intl) {
// `Intl` exists, but it doesn't have the data we need, so load the
// polyfill and patch the constructors we need with the polyfill's.
var IntlPolyfill = require('intl');
Intl.NumberFormat = IntlPolyfill.NumberFormat;
Intl.DateTimeFormat = IntlPolyfill.DateTimeFormat;