Skip to content

Instantly share code, notes, and snippets.

View nkabrown's full-sized avatar

Nathan Brown nkabrown

View GitHub Profile
@nkabrown
nkabrown / chpt-04.md
Last active February 26, 2026 19:51
Designing Data-Intensive Applications – Chapter 4

Encoding and Evolution

The need to evolve the system often means that you need to maintain backwards and forwards compatibility at the same time.

  • Backwards compatibility – newer code can read data that was written by older code
  • Forwards compatibility – older code can read data that was written by newer code (older code ignores additions made by newer code)

Formats for Encoding Data

In memory data is kept in a wide-variety of data structures optimized for efficient access and manipulation. When writing data to file or sending over the network the data must be encoded in some kind of self-contained sequence of bytes.

@nkabrown
nkabrown / schema-on-read.md
Last active February 25, 2026 03:34
Schema-on-Read

Schema-on-Read

How can frontend applications best work with Open API specifications?

JSON Schema

https://json-schema.org/

JSON Schema is a declarative language for defining structures and constraints for JSON data. JSON Schema is a media type (application/schema+json) for defining the structure of JSON data.

@nkabrown
nkabrown / chpt-01.md
Last active February 25, 2026 03:35
Designing Data-Intensive Applications – Chapter 01
@nkabrown
nkabrown / aoc-node-starter.js
Last active December 8, 2023 17:39
Advent of Code Node/ESM starting template
// in package.json need to set type field to module { "type": "module" }
import { open } from 'node:fs/promises';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
// recreate Node globals for ESM modules
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
(async () => {
@nkabrown
nkabrown / LEARNINGS.md
Last active December 8, 2023 17:40
Advent of Code 2023 Learnings

2023 Advent of Code Learnings

The nature of the input data, files consisting of lines of text, means that regex often seems the perfect tool to accomplish subtasks needed for puzzle solutions. As I'm learning more about regular expressions this year I've found these resources helpful:

Day 01

@nkabrown
nkabrown / dependency-updates.md
Last active January 28, 2026 19:15
Regular dependency updates

Regular Dependency Updates

Regular dependency updates are important for long-lasting codebases. For short-term projects and one-off scripts nothing might ever have to change, but for software that is in use for a long enough period of time everything will likely have to change, eventually. Regular dependency updates are a good practice because they chunk the amount of changes we have to review and navigate into a managable amount and save us from problematic version migrations. They keep our systems in tip-top shape and help us avoid technical debt.

Make them regular because:

  • You want to keep the number of changes you have to review for any dependency at any one time minimal.
  • You want to avoid deferring breaking changes and gathering them all up into a problematic, complex, and hard to understand series of version migrations.
  • You want to resolve security vulernabilites promptly.
  • You want new improvements and fixes to flow into your project regularly.
@nkabrown
nkabrown / proxy-list-format.js
Last active June 5, 2019 03:09
Return a default value when passing empty arrays to Intl.ListFormat
var countryList = ['Mexico', 'United States', 'Canada'];
// prefer not to use the Oxford comma so use locale 'en-GB'
var phraseFormatter = new Intl.ListFormat('en-GB', {type: 'conjunction'});
phraseFormatter.default = 'North America';
// see http://exploringjs.com/es6/ch_proxies.html#_intercepting-method-calls
const handler = {
get(target, key) {
@nkabrown
nkabrown / README.md
Last active January 2, 2019 21:59
Pursuit Economic Impact Numbers

PURSUIT

Pursuit is a social impact organization that creates transformation where it’s needed most.

Through our four-year intensive program, we train adults with the most need and potential to get their first tech jobs, advance in their careers, and become the next generation of leaders in tech. Our graduates are hired by leading companies like Pinterest, Kickstarter, LinkedIn, BlackRock, and JPMorgan Chase, and increase their average annual salaries from $18,000 to over $85,000.

I volunteer at Pursuit and I recommend you do too!

@nkabrown
nkabrown / mental-engagement.md
Last active March 28, 2018 02:16
The Pragmatic Programmer – Tip 2 Think! About Your Work – mental engagement

Mental Engagement

Tip 2 – Think! About Your Work

Who feels like programming requires a tireless mindfulness? It kinda does, which is why it's important to take breaks.

Here are a couple of ideas to try that will help you become a better thinker about your work.

Git commit message forecasting

@nkabrown
nkabrown / diversification.md
Last active March 28, 2018 00:34
The Pragmatic Programmer § 5 – Your Knowledge Portfolio – learning plateaus & diversification

Learning Plateaus & Diversification

§ 5 — 'Your Knowledge Portfolio'

The authors of The Pragmatic Programmer talk about the importance of diversifying your knowledge base specifically in terms of guaranteeing your long-term success in a field that is always changing. I want to talk about the power diversification has to jump start your understanding even of those areas you already think you know well.

Probably those of you in class are desperately praying for a learning plateau and a chance to catch your breath. But after your program ends and when you are working you are going to experience some learning plateaus. When you feel this way, "I have a body of stuff I know and am competent with but I'm not learning how to do more", then you've hit a learning plateau. It's pretty common.

I've learned that diversifying your knowledge by learning something completely new is a great way to get your learning momentum moving again. And surprisingly learning something new always seems to shed light on the bundle