Skip to content

Instantly share code, notes, and snippets.

Design Principles

  • YAGNI: Don't build it until you need it.
  • DRY: Extract patterns after second duplication, not before.
  • Fail Fast: Explicit errors beat silent failures.
  • Simple First: Write the obvious solution, optimize only if needed.
  • Delete Aggressively: Less code = fewer bugs.
  • Semantic Naming: Always name variables, parameters, and API endpoints with verbose, self-documenting names that optimize for comprehension by both humans and LLMs, not brevity (e.g., waitUntilObjectIsSaved = true vs wait = true).
  • Naming the app in identifiers: spell it out as Batterby/batterby in code — variables, constants, config values, storage keys. The short btb/BTB_ form is only for identifiers that are also read outside this codebase and benefit from being terse: DOM ids and classes in the browser extension, Blender object prefixes, and generated filenames.
https://codepen.io/Premisedata/collab/d12f89c524d6945a72de94f28651699c
@craigbeck
craigbeck / profileMiddleware.js
Created March 30, 2019 00:27
redux profile middleware
const profileMiddleware = _ => {
console.log('%cINSTALLED profileMiddleware', 'color:magenta');
return next => action => {
if (typeof action.then === 'function') {
return next(action);
}
// eslint-disable-next-line no-console
console.group('dispatch ' + action.type);
console.time(action.type);
const result = next(action);
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@craigbeck
craigbeck / cv-axle-replacement.md
Created June 10, 2017 21:03
Lexus GX470/4Runner CV axle replacement

Tools 1 21mm socket 1 19mm socket 1 17mm socket 1 35mm socket 1 10mm hex head socket BFH (big effing hammer) Also a rubber mallet is a plus...or just hit the old axle with the big one as it's coming out anyways. 1 short prybar (12 inches) 1 long prybar (36 inches)

@craigbeck
craigbeck / ORV-resources.md
Last active February 11, 2017 07:47
Off-Road resources
@craigbeck
craigbeck / gx470-resources.md
Last active September 25, 2021 14:50
Lexus GX470 notes
@craigbeck
craigbeck / bad-query.gql
Last active May 12, 2016 22:37
extra ids in query
query RootQueryType {
recentConversations {
id
...F2
}
}
fragment F0 on Conversation {
id
unreadCount
{
profile {
id
name
email
}
lines {
id
number