All Posts
JavaScript Closures: Lexical Scope and the Environment That Survives Function Return
A closure is a function bundled with the lexical environment it was created in. That environment survives because the closure holds a reference to it - which is why each call to a function factory returns an independent counter.
JavaScript Prototypal Inheritance: The Prototype Chain, `new`, and Class Syntax
How JavaScript actually shares methods between objects - the prototype chain, what `new` really does, and how ES6 class syntax maps onto the same underlying machinery.
Understanding useEffect: Each Render Has Its Own Props, State, and Effects
A mental model for useEffect: moving past the lifecycle (mount/update/unmount) mindset to thinking about effects as a way to synchronize side effects with React state and props.
useReducer: A Mental Model for Decoupling Actions from State Updates
When to reach for useReducer over useState, and why. The Dan Abramov framing: dispatch tells the reducer what happened, the reducer decides how state changes - so the component never needs to know the update logic.
Switching AWS Profiles for Serverless CLI
A guide to set up and switch between multiple AWS profiles when working with AWS CLI and Serverless Framework projects.
How to Teach Programming (and other things)
Exploring effective programming education through mental models, with practical strategies for building conceptual understanding and improving outcomes.
How JavaScript `this` Works: Function Invocation and the `.call` Primitive
A single-rule mental model for JavaScript's `this` - everything desugars to `Function.prototype.call(thisValue, ...args)`. Walks through bare calls, method calls, detachment, `.call` / `.apply` / `.bind`, the `new` operator, arrow functions, strict mode, and how to implement `.bind` from scratch.
Select Gatsby Contentful Locale Data in GraphQL
A detailed guide to implementing dynamic locale selection in Gatsby using Contentful, GraphQL variables, and React Context for internationalized content.
Using TypeScript Type Guards
A guide to using TypeScript type guards for runtime type checking and type narrowing in your TypeScript applications.
Array .map() over TypeScript Array Union Types
A guide to properly handling array map operations with union types in TypeScript, including type inference and type safety considerations.
Load Python Environment Variables
A guide to managing Python environment variables using dotenv, including best practices for configuration and security.
How to Read a Python Error Traceback
A practical guide to reading Python tracebacks - the bottom-up mental model, multi-frame call stacks, common exception types, and the "During handling of the above exception" chain that confuses beginners.
Python Context Managers: The with Statement and the __enter__/__exit__ Protocol
Python's with statement compresses try/finally resource handling into a clean syntax - but it's just sugar over the __enter__/__exit__ protocol, which you can implement yourself with a class or the @contextmanager decorator.
Testing Document Head Meta Tags
A detailed guide to testing React Helmet document head meta tags using React Testing Library, including setup, best practices, and common testing patterns.
Conditional Types to Infer Props from Emotion `as` Prop
A guide to implement TypeScript generics and conditional types for type-safe Emotion components with dynamic as props, including practical patterns and examples.
AWS SDK v2 with async/await in Node.js Lambda Handlers
Bridging callback-style AWS SDK v2 methods with async/await in Node.js Lambda handlers - the .promise() method, sequential and parallel SDK calls, and the init-outside-handler pattern for cached Promises.
CloudFormation !Ref vs !GetAtt in serverless.yml
The mental model behind CloudFormation !Ref and !GetAtt - !Ref returns a resource primary identifier, !GetAtt returns one of its named attributes. With practical examples for IAM permissions and Lambda environment variables in serverless.yml.
When Direct Lambda-to-Lambda Invocation Is OK
AWS docs call Lambda-to-Lambda invocation an anti-pattern, but there are specific cases where direct invoke is the right call. A walkthrough of the real costs, the cases where they apply, the cases where they do not, and the alternatives.
Serverless Framework Commands by Workflow
A practical cheatsheet for the Serverless Framework CLI - organized by workflow phase (bootstrap, develop, deploy, invoke, inspect, rollback, remove) instead of alphabetically.
A Least-Privilege IAM Strategy for Serverless Framework Deployments
Two practical patterns for scoping down the IAM permissions used by the Serverless Framework CLI when deploying - bottom-up gradual scoping, and the top-down 'dedicated deployer' pattern using a dev account as a permission discovery sandbox.
Serverless Testing Strategy: Test Integrations and IAM Surface
Most serverless bugs don't live in your code - they live at integration points and in IAM config. Here's why unit tests miss them and what to test instead.
Why typescript-eslint Performance is Slow
A deep dive into TypeScript ESLint plugin performance issues, exploring common bottlenecks and providing solutions for improved linting speed.
Reducing AWS Lambda Cold Start Latency in Node.js
A practical guide to reducing AWS Lambda cold start latency in Node.js - the anatomy of a cold start, six concrete optimizations from SDK tree-shaking to HTTP keep-alive, common myths (VPC and Layers), and when to reach for Provisioned Concurrency.
Setting Up ESLint: Understanding Config Files and Plugins
A guide to set up ESLint, explaining the differences between ESLint config files and plugins, with detailed configuration examples and best practices.
Profile and Remove Slow ESLint Rules
A detailed guide to profiling, measuring, and optimizing slow ESLint rules, with practical techniques for improving linting performance.
TypeScript Module Declaration for SVG Assets
A guide to create TypeScript module declarations for SVG and image assets, including webpack configuration and type definitions.
AWS Amplify TypeScript aws-exports.js
A guide to properly typing and integrating AWS Amplify configuration files in TypeScript projects, with focus on aws-exports.js setup.
Set Up Storybook Decorators - Emotion Theme Provider
A guide to implementing Emotion Theme Provider decorators in Storybook, including troubleshooting common issues and best practices for theme management.
Set Up Storybook Decorators - React Intl Provider
A guide to configure React-Intl Provider decorators in Storybook for internationalization testing, including setup and best practices.
Import SVG Components in Storybook
A detailed guide to setting up Webpack loaders in Storybook for importing and using SVG files as React components.
Use Emotion CSS Prop in Storybook
A guide to configure Emotion CSS prop with JSX Pragma in Storybook, including setup, troubleshooting, and best practices.
Sync a Git Remote Fork with Upstream
A step-by-step guide to keeping your Git fork in sync with the original upstream repository, including remote tracking and branch management.
Testing ValidationSchema Formik Forms
A detailed guide to testing Formik form validation schemas using Jest and React Testing Library, covering validation rules, error handling, and test patterns.
What is, if __name__ == "__main__":
An in-depth explanation of the __name__ == __main__ pattern in Python, why it exists, and how to use it effectively in your modules.
Setting Up Python: pyenv, pyenv-virtualenv, poetry
A guide to set up a modern Python development environment using pyenv for version management and Poetry for dependency management.
Fixing Netlify Build Fail - error #98123 WEBPACK
A practical guide to diagnosing and resolving common Netlify build failures, including deployment issues and continuous integration troubleshooting.
Hacktoberfest Orange County Meetup
Recap of the Hacktoberfest Orange County meetup: open source contributions, community engagement, and collaborative coding experiences.
Testing Formik 'onSubmit' with Jest
A detailed guide to testing Formik form submission handlers using Jest and React Testing Library, including async submissions and validation testing.
Fixing React Warning: Synthetic Events in setState()
Understand and resolve React synthetic event warnings in setState, with best practices for event handling and state updates.
Pure render() 'this' Binding Patterns in React
A deep dive into React pure render optimization and method binding patterns, exploring different approaches for improving component performance.
webpack: Building React For Production on Windows
A guide to configuring Webpack for building optimized React production bundles on Windows, including environment-specific settings and common pitfalls.
Avoiding React setState() Pitfalls
A guide to avoiding common pitfalls when using setState in React, including asynchronous updates, batching, and state management patterns.