/* Code Comments */

Search:

    Typescript’s Omit: Pick’s Mirror

    October 18, 2019

    I’ve written in the past about the benefits of in writing better interfaces with Typescript. Today, I found out about ’s mirror: .1 Quick…

    Dealing With NPM Config Files

    October 17, 2019

    Dealing With NPM Config Files When things that used to work break, I want to understand why. That was the situation recently with , the…

    Gatsby & A (Simple) Publishing Embargo

    October 16, 2019

    Imagine you have a website, like this one, that aims to publish regularly. You’re not a big publication. You don’t have a full-time staff…

    DRY And Styled Components

    October 15, 2019

    A quick optimization to keep an eye out for while styling components - particularly those where they share logic - whether between…

    ESLint, Prettier, And VSCode - When They Stop Cooperating

    October 14, 2019

    A while ago I installed the Prettier extension in VSCode and configured a few defaults in my global settings. I like having a global…

    Exporting A Named Function As Default

    October 13, 2019

    Back in February I wrote a primer on exports and require. While the primer was helpful, one piece that never quite clicked, was how to…

    Default Enums And Fallbacks

    October 12, 2019

    Working on a component that receives a prop where the status are defined by an enum (I’m working in Typescript). The problem arose when a…

    Named Anchors & Markdown

    October 11, 2019

    When writing longer files in Markdown, it can be useful to create links within the document to help readers navigate. This cross referencing…

    Gitlab Description Templates

    October 10, 2019

    We use templates to help write descriptive tickets or MRs on various projects at work. 1 Then I started working on a new project and when I…

    Supporting Submit On Enter

    October 09, 2019

    When asking users for their input, it’s often a pleasant user experience to allow them to submit the form by pressing “Enter”. In fact, that…

    Bubbling Up Exceptions And Throwing Objects

    October 08, 2019

    Every time I’ve thrown an error, I’ve used the object. It turns out, however, you can throw anything. I probably knew this intuitively, but…

    Auto-Complete In HTML Forms

    October 07, 2019

    Starting around 2015, browsers started treating the attribute on fields differently. Instead of honoring what had become a tradition of…

    Notes On _What Unites Us_

    October 06, 2019

    America has changed a lot since Dan Rather’s youth. Much of that change, though not all, has been positive - a transformation he chronicles…

    Benedict Evans On AI (Or More Accurately ML)

    October 05, 2019

    I first came across Benedict Evans through a fascinating interview he did with Russ Roberts on EconTalk to discuss the future of cars.1 The…

    Swapping Array Elements In Place, Destructuring, and Automatic Semicolon Insertion

    October 04, 2019

    About a year ago, I learned about bitwise operators and using them to swap elements of a list in place. With Array Destructuring, Javascript…

    Masking Inputs And More Ref Fun

    October 03, 2019

    In learning about Auto-Complete In HTML Forms, I discovered that the of an makes can make a significant difference in how they are…

    Jakob’s Law of Internet User Experience

    October 02, 2019

    Jakob Nielsen of the Nielsen Norman Group, a consulting firm focused on user-experience, has what I think is a pretty profound observation…

    Validating Social Security Numbers

    October 01, 2019

    I continue to be enamored with the power of regular expressions — a feeling that only grows the more I understand them. Today, for example…

    Showing Up: The NYTimes Editorial Board

    September 30, 2019

    The most striking aspect of the New York Times’ Editorial Board’s recent opinion, “Why the Trump Impeachment Inquiry Is the Only Option” was…

    An Unremarkable Achievement: Accomplishing Goals Through Steady Progress

    September 29, 2019

    Yesterday I accomplished a goal I’d been working toward for close to three months: I swam an uninterrupted 200m freestyle. It wasn’t special…

    Web-Safe Fonts and Font Fallbacks

    September 28, 2019

    Today, I had a colleague mention that the font we are using is “web-safe” in response to why it was so weird that it wasn’t showing up…

    Inspect A Hoverable Event

    September 27, 2019

    Some effects only appear when you hover over them with your mouse. The problem is that in order to see the details and ensure they’re what…

    Running VSCode On Linux: Hitting My Watcher Limit

    September 26, 2019

    I have been working on a Linux VM more recently, and one particularly annoying thing about it (there are a lot of little quirks that are…

    Reusing CSS With Styled Components

    September 25, 2019

    Styled components are really nice in compartmentalizing styling and keeping it close to the components that use it. I wasn’t around for the…

    Getting Refs To Sync With Container State

    September 24, 2019

    I was working on a project recently which was using Refs in order to integrate with a third-party library. My mental model for refs are that…

    An Even More Basic React App Tutorial

    September 23, 2019

    Recently, I walked through building a basic React App.1 In retrospect, I could make it even more basic by removing any package managers…

    Leading Spaces & The Web

    September 22, 2019

    One of the more frustrating little quirks about HTML is its insistence on collapsing white space. This is actually often more useful than it…

    HTML Id Fields

    September 21, 2019

    Ids are everywhere. But what are the rules for them? Turns out, the rules in HTML5 are pretty permissive: unique, at least one character…

    HTML: Name vs. Id

    September 20, 2019

    In looking into labels for web forms recently, I stumbled on a question I really didn’t know the answer to: What’s the difference between a…

    Web Accessibility: Form Basics: Labels

    September 19, 2019

    For accessibility purposes all form inputs should be labelled. How do we apply a label though? There are multiple ways to add a label, but…

    Score Dial

    September 18, 2019

    Given a score within a range, how could we visualize that on a dial? That was what I got to work on recently and it turned out to be a ton…

    Undo And Redo In Vim

    September 17, 2019

    Sometimes Vim is simultaneously impossible opaque and extraordinarily intuitive. That’s the case with the undo and redo. To undo the last…

    Display: None vs Visibility: Hidden

    September 16, 2019

    When hiding elements on the client, there are multiple options. Two of the most common are through the selective toggling ofCSS properties…

    Compression Basics: Zip, Tar, Rar, and Gz

    September 15, 2019

    What are the differences between a , , ., and ? It turns out it’s both a lot and a little. Some basics: represents a compressed archive of…

    REM vs EM

    September 14, 2019

    Jeremy Church put together a nice little side by side comparison of REM and Em (and PX).1 Both REM and EM are relative units. The difference…

    An Anniversary Of Sorts

    September 11, 2019

    This weekend was an anniversary of sorts for me. Exactly one year ago Saturday was my last day in a job and career I’d been building since…

    Putting Humans At The Center

    September 10, 2019

    When I was in high school, I argued passionately in defense of determinism. It wasn’t that I didn’t like the idea of free will or want it to…

    Roasted Cauliflower

    September 09, 2019

    I found this insanely easy way to roast an entire Caulflower head.1 If When I do it again in the future, I’ll experiment with other spices…

    Getting a Basic React App Up And Running

    September 08, 2019

    Update: I’ve now found an even more basic way to write a React app and I put together a tutorial in a post, An Even More Basic React App…

    Adding Prettier To A Project

    September 07, 2019

    The steps to adding Prettier to a project are very simple: Install Prettier () Create a file in the root directory Add an empty object to…

    Simulating Slow Network Connections: Firefox vs. Chromium

    September 06, 2019

    Testing my app on a slower connection is a key part of my development cycle. That’s why when I recently found myself developing within…

    Using Callbacks To Reverse Data Flow In React

    September 05, 2019

    React’s one way data flow makes it easy to reason through, but sometimes the controlling component needs to know what’s going on inside. For…

    RegEx In Javascript Strings: Remove numeric or alphabetic characters

    September 04, 2019

    Built into Javascript’s primitive are Regex methods such as and .1 We can use the latter to sanitize inputs. A simply way to clean a phone…

    NPM Link

    September 03, 2019

    Unless you’re working on a mono-repo, it’s fairly common that in the process of making changes to a code base, you’ll actually need to…

    Changing the default shell to zsh

    September 02, 2019

    By default, the shell on a Mac is . Changing this should be a simple three step process: Make sure that is installed and is an accepted…

    Error Handling: App can’t be opened because Apple cannot check it for malicious software

    September 01, 2019

    Recently upgraded an application and got this warning In the past, I used to be able to “right” click on the app, but Apple’s UI makes it…

    Passing Test Variables To GraphiQL

    August 31, 2019

    Previously, I wrote about writing a GraphQL query that takes variables. I was using this to programmatically create posts. In returning to…

    Import Aliases in Gatsby

    August 30, 2019

    I wanted to be able to import JSX elements I defined in a Gatsby project into markdown files. Very quickly I got tired of writing out the…

    HEIC To JPG And The Cost Of Free

    August 29, 2019

    Apple’s Live Photos are a fun way to add a little twist to photos you snap on your phone. Empowering this feature is a file format called…

    Harissa Grilled Eggplant

    August 28, 2019

    One of our family’s favorite recipes is a Harissa Grilled Eggplant from Goop.1 It’s quick, full of flavor, and relatively healthy. Where the…

    RESTful APIs: Put Vs. Patch

    August 27, 2019

    I routinely find myself looking up the differences between the HTTP methods (aka verbs) and . While there’s plenty of nuance, some of which…

    Defining Idempotent

    August 26, 2019

    Idempotent is a word that gets thrown out a lot within computing but that I continually forget what it means. From Wordnik, the definition…

    Server-Side Pagination With Limit/Offset

    August 25, 2019

    How do you limit the number of rows returned from a query? Let’s consider a basic example with a members table. You’re building a front end…

    Node Out Of Memory: Force Feeding Node More Memory

    August 24, 2019

    It’s not uncommon for larger apps to exceed the default memory allocated to Node. When this happens, you’ll get an errory alerting you that…

    Andrew Sullivan’s "My Addiction Sickness"

    August 23, 2019

    I read Andrew Sullivan’s 2016 piece for the New York Magazine this week and it’s as relevant as ever. It’s a wonderful, thought-provoking…

    Markdown Image Titles and Alt Text

    August 22, 2019

    I continue to be impressed by the simplicity and power of Markdown. Today, while exploring the API for Gatsby’s Remark Images, I noticed the…

    Dealing With Disappearing "Position: Fixed" On Overflow?

    August 21, 2019

    Have you ever tried to have an element overflow when one of its children is in a fixed positioned relative to it? Fun fact: It doesn’t work…

    Postgres: Getting The Owner Of Tables

    August 20, 2019

    I was trying to modify a table today when I hit an error: . To figure out who the owner was so that I could ask them to modify the table on…

    Reminder: Logging Into Postgres With Shell Commands

    August 19, 2019

    PGAdmin, Dbeaver, etc. are useful GUIs for managing and reviewing Postgres databases. Sometimes, however, there’s a desire to login via the…

    Reminder: Logging Into Postgres With Shell Commands

    August 19, 2019

    PGAdmin, Dbeaver, etc. are useful GUIs for managing and reviewing Postgres databases. Sometimes, however, there’s a desire to login via the…

    Adding Columns To Postgres Tables After Creation

    August 18, 2019

    If you already have a table created in Postgres, how can you modify it to add a new column? Similar to adding constraints after a table has…

    Adding a Unique Constraint To Postgres Tables After Creation

    August 17, 2019

    How do you add a unique constraint to a table in Postgres if it’s already been created? Most of the time, we add unique constraints to a…

    :hover Vs :focus

    August 16, 2019

    Most of the time, these two pseudo-selectors act in concert. In fact, they’re so frequently triggered together that my naive testing…

    Regex Search in VSCode

    August 15, 2019

    Finding all instances of an imported module in a large app can be challenging. With the namespace for a module being restricted to the file…

    Replacing MouseEvents with PointerEvents

    August 14, 2019

    How can the necessity of handling different types of inputs (e.g., mouse, touch, and pen) by duplicating event handler logic? The Pointer…

    Typescript Generics: A Basic Use Case

    August 13, 2019

    When does it make sense to use a Generic in a Typescript type? How do you create a type that takes a Generic? I’ve read through the…

    Importing Modules While Reducing Clutter

    August 12, 2019

    I’ve developed a peculiar habit. I knew I’d developed it, but didn’t know it was peculiar until my lead asked me about it this morning. When…

    MDX vs Remark

    August 11, 2019

    Both MDX and Remark are Markdown compilers that will convert valid Markdown into HTML to render on the web. The beauty of Remark is that it…

    Working On The Wrong Problem

    August 10, 2019

    Working with code is an extraordinarily satisfying experience. Not in the minute-to-minute. At that scale, it can be infuriating. The code…

    Superscript And Subscript With Markdown

    August 09, 2019

    Markdown doesn’t support for superscript or subscript directly. However, there are multiple strategies to adding superscript and subscript…

    Error: "Field "image" must not have a selection since type "String" has no subfields."

    August 08, 2019

    I was trying to query an image I’d placed in the frontmatter of a post, when I got the error: Field ‘image’ must not have a selection since…

    VSCode - Reenable Settings When "Exclude Settings And Ignore Files Are Disabled"

    August 06, 2019

    Filing this one under annoying bugs that shouldn’t be an issue but end up taking up way more of your time than you’d like. VSCode offers the…

    Multiple Post Types With Gatsby

    August 05, 2019

    When I set up my previously, I noted that if there were multiple file systems that I wanted access to, all I need to do was to duplicate…

    Programmatic Page Generation

    August 04, 2019

    Alright, I’ve been building to this point! Time to generate new pages for a blog programmatically using Gatsby! Previously I wrote about…

    Trials In CSS: Fit Content To Window

    August 03, 2019

    One of my ongoing challenges with layouts on the web is the fact that a website does not naturally have an end. Unlike an 8.5”x11” sheet of…

    Git Push New

    August 02, 2019

    Every time I cut a new branch in Git and am ready to submit a PR for review, I get an annoying error reminding me that I need to set the…

    Learning Vim With VimTutor

    August 01, 2019

    If you have already installed, you can get an interactive walk-through using the . To launch , open your shell and type in the command…

    State, Reducers, And useReducer In React

    July 31, 2019

    To date, I’ve struggled to understand reducers. Terms like reducers, actions, dispatch, all blurred together and even though I could use…

    Using isValidElement To Ensure A Node Is An Element In React

    July 30, 2019

    I am trying to reduce an array of React Nodes to an array of React Elements. Specifically, I’m trying to extract the title prop from those…

    Reminders And Suggestions

    July 29, 2019

    Every week I sit down and write what I want to stop, start, and continue. That habit, it would seem, should insulate me to some degree both…

    useRef Vs. useState And Unnecessary Renders

    July 26, 2019

    Today, I found a wonderful side-effect of : it doesn’t re-render components when it changes. This was ideal for my situation because I…

    Git Branch Naming Conventions

    July 25, 2019

    I have a habit of making longer git branch names. I use the branch name as a way to communicate what and why I’m working on something. For…

    How To Use Variables GraphQL Queries

    July 24, 2019

    My dive into Gatsby continues. Today, I wanted to better understand how dynamic queries worked in GraphQL. For example, my blog (which I…

    Using Lodash Reduce And Some To Accomplish Complex Filtering

    July 23, 2019

    I came across a situation where I had a collection of collections. Some of the internal collections, however, I didn’t want to keep around…

    Reframing No

    July 21, 2019

    The past few weeks I’ve felt like I’ve been saying “no” to more things. Specifically, I’ve said “no” to caffeine. “No” to bagels and muffins…

    Getting Started With Gatsby-Source-Filesystem

    July 20, 2019

    Continuing my learnings in Gatsby and today I found out a few new pieces about the filesystem plugin, .1 The filesystem plugin is from…

    Sequences in Postgres

    July 19, 2019

    The in Postgres is a number generator.1 Once created, they can be managed with sequence operators.2 So, why use them? One reason would be…

    The Seed Of Imagination Is Others

    July 18, 2019

    My mind races a lot. I can’t help it. Whenever I talk to someone, read something, observe an interaction, etc. I immediately start thinking…

    Using COALESCE And Dynamic Updates To Multiple Records In Postgres

    July 16, 2019

    I wanted to update multiple fields on multiple records and handle the case that not all of the information is present in the update for each…

    Check For Duplicates - COUNT, CASE, and EXIST In Postgres

    July 16, 2019

    Before I write to a database, I want to make sure that I don’t create a duplicate record based on the name and parent record id. To…

    Gatsby Config Plugin Syntax

    July 14, 2019

    I often struggle with the syntax of config files. What are resolvers? How do options work? etc. As a result, while making my way through…

    What Is `require.resolve` And How Does It Work?

    July 13, 2019

    In order to understand , part of the Node API, we must first understand its context. Namely, the module and how it fits within the realm of…

    Postgres Constraints And Arrays

    July 12, 2019

    I wrote in the past about using constraints in the context of array operators in Postgres. Today, however, I didn’t have a pre-defined array…

    Inserting Values Into A Table - Postgres

    July 11, 2019

    How do you insert multiple values? I always find myself looking this up. I decided I’d jot it down here for future reference. Hopefully it…

    SQL Tricks: Querying The Same Table Twice

    July 10, 2019

    I recently came across a creative solution to finding the relationships between different values within a table using SQL. This may be…

    Don’t Let Facts Get In The Way Of A Good Story

    July 06, 2019

    Don’t Let Facts Get In The Way Of A Good Story The first time I heard about Jerry Seinfeld’s “Productivity System” was 2013.1 2 The system…

    Variables in Postman

    July 03, 2019

    I’ve written in the past about why I like testing my APIs with Postman. Today, I learned that they have yet another feature that makes my…

    Array Lengths In Postgres

    July 02, 2019

    Yesterday, I wrote about the intersecting of Arrays in Postgres. Today, I wanted to go a step further and think about finding the maximum…

    Array Intersection In Postgres

    July 01, 2019

    Recently, I was building an API to modify the data in a database. The field I was modifying happened to be an array, and I wanted to make…

    The One About Quotes In Postgres - Single, Double, And Handling `non_snake_case` Fields

    June 30, 2019

    Imagine the following situation - you’re trying to select columns from a Postgres table Let’s assume these are the only four fields you want…

    Entity Relationship Diagrams - What The Lines Mean

    June 29, 2019

    Yesterday, in talking about Postgres and Subqueries I was trying to represent a relationship between tables. I knew intuitively what I was…

    Select And Calculate With Postgres Using Subqueries

    June 28, 2019

    I wanted to be able to retrieve a set of records from a database along with specific details from a related table. I knew SQL could…

    Errors, Loading, And Happiness: A Pattern In React

    June 27, 2019

    If I’m working on a React application that is trying to render data based on an asynchronous call, there are three common cases I should…

    Error Handling: SSH & Git Remotes

    June 26, 2019

    Starting this morning, I was suddenly unable to update my repositories on Github. As I’d written about in the past, I prefer using SSH over…

    Using Typescript’s Pick To Improve Communication And Decrease Maintenance

    June 25, 2019

    Instead of documenting an interface that is redundant, but only a partial, we can use to allow the interface to automatically be linked, w…

    `Type[]` vs `Array<Type>`: What’s the Difference?

    June 24, 2019

    The short answer: there is no difference. When investigating, I was steered to the Typescript Handbook1 which notes: The type…

    Details Tags And Choosing Your Own Adventure On The Web

    June 22, 2019

    Recently I heard about Julian.com and specifically about the design of the manuals the owner, Julian Shapiro writes. One of the things that…

    Using `_.pick` To Extract Relevant Details From Objects

    June 21, 2019

    Building on lessons from yesterday’s dive into , I found an opportunity to explore . This time it was because I wanted to send data from the…

    More Uses Of `_.groupBy`

    June 20, 2019

    As I wrote previously, the method of Lodash can be really useful. My original use case for was for one big object, but of course, those…

    In Defense Of Pen & Paper

    June 19, 2019

    I seem incapable of reading without a pen in hand. If I am not in a place where I can underline or jot a note in the margins — I don’t read…

    Handling Empty Arrays With Postgres

    June 18, 2019

    A few days ago, I wrote about handling arrays from Javascript to SQL. Turns out, I missed an edge case - empty arrays. If you try to set an…

    Testing - Chai Tests And Database Connection Pools

    June 17, 2019

    I’m writing some integration tests for an app that is confirming database queries are working the way I’m expecting. In order to prep the…

    Array Handling: JavaScript to SQL

    June 15, 2019

    Yesterday we updated a Postgres record’s details based on the and returned the update in a single query. What if the details was not a…

    Postgres `RETURNING` Statement

    June 14, 2019

    Often, after making a change to a database, we want to verify that the change was made and use the updated rows. A naïve approach would be…

    Optional Params With JSON Stringify

    June 13, 2019

    I’ve gotten in the habit recently of printing my variables as object literals. For example, if I have a variable, , that I want to inspect…

    Adding Comments To A SQL Statement

    June 12, 2019

    There are two ways to add a comment to a SQL query - using and . The differences are as follows: With a comment surrounded by and , the…

    Marathon Pace And Stumbling Forward

    June 11, 2019

    The topic of life as a journey has been on my mind lately - evidenced by my last two essays Defense of Detours and Arrive Safely And Avoid…

    Postgres Data Types: Array

    June 10, 2019

    When looking around a table in Postgres today, I noticed a curious looking field. looked like a collection, but when I looked at the Data…

    Git Stash With A Message

    June 09, 2019

    Adding a message to a stash is a great way to easily identify what’s included in a stash. This can be particularly helpful if you’re only…

    Git Stash A Specific File

    June 08, 2019

    Sometimes you only want to stash a few files at a time. Maybe in the course of your work, the files you were changing revealed a bigger…

    Lessons In Typescript: Extending 3rd Party Libraries And Reading Type Definitions

    June 07, 2019

    Using third party libraries is great when they do exactly what you want them to do. When it comes to extending them, however, it can get…

    Debugging Transpiled Code

    June 06, 2019

    I was investigating a situation where my application was deviating from my expectations during runtime — aka bug fixing. Opening up my…

    Buttons Without Style

    June 05, 2019

    When it comes to accessibility (a11y) on the web, one of the best / easiest things you can do is to use semantic HTML. Structural, semantic…

    In Defense Of Detours

    June 04, 2019

    Detours are slow. They add time and distance to our route. Particularly when we have a plan and know where we’re going, this delay can be…

    Incrementing State In Functional Components

    June 04, 2019

    I was recently trying to understand Material UI’s component. In looking through their implementation of the Horizontal Linear Stepper, they…

    Storybook.js And Static Image Files

    June 03, 2019

    Storybook supports static files, like images. But it wasn’t working for me. In fact, the way to make a story with a static file is really…

    Keep Homebrew Formulae Up To Date

    June 02, 2019

    In the same vein as cleaning up my git branches, today I recalled that I can easily update my Homebrew formulae with the command . This…

    Github Branch Protection Rules

    May 31, 2019

    I use Netlify to manage the deployment of my site. One of the things I love about Netlify are the checks they run against each branch to…

    Printing The Directory Tree

    May 31, 2019

    I wanted to be able to print cool trees of my directories to help show my folder structure. At first, I thought it was simply using standard…

    Using Variables To Make Interchangeable React Components

    May 31, 2019

    Using Variables To Make Interchangeable React Components I’m still making tweaks to the Stepper project I wrote about previously (here and…

    Higher Order Components In Javascript / Typescript

    May 29, 2019

    Imagine you have a prop that you want to be passed all the way through to the DOM. If you try and pass through a prop that isn’t…

    Adding Words To The MacOS Dictionary

    May 27, 2019

    When writing about Javascript (or past lives writing about health care), I would often type words that don’t appear in Webster’s or Oxford’s…

    Arrive Safely And Avoid (Avoidable) Accidents

    May 27, 2019

    No matter the mode of transportation, the faster you go, the less control you have. If you’ve ever tried to turn on a dime when sprinting or…

    Cleaning Up Your Local Git Repository: AKA How To Remove Stale Branches

    May 26, 2019

    Unless your git workflow is pushing straight to master (because YOLO), it’s likely that your local repository will grow unwieldy in time…

    Simple Way To Swap Variables Using Javascript

    May 24, 2019

    I’ve been learning about some of the ways you can use destructuring to make my Javascript more declarative and communicate my intent more…

    Create A Spinner & Add A Loader In React

    May 23, 2019

    Using two libraries, and , I learned a new simple way to create a component (i.e. a spinner) to be used while an image is being loaded in…

    Unzipping A File From The Command Line

    May 22, 2019

    I should start with the observation that I hate using my mouse. Yet, that was exactly what I was about to do today to unzip a file. The…

    Make Space To Revisit Problems

    May 20, 2019

    Make it work. Make it right. Make it fast.1 This maxim screams pragmatism. Don’t optimize too early. Get something working. Then, and only…

    Hooks, Async, And The Joy Of New Problems

    May 17, 2019

    When all you have is a hammer, every problem looks like a nail. When approaching new problems, it’s easy to fall into old ways of doing…

    Rivers Of Knowledge

    May 11, 2019

    Describing each individual as unique has become cliche. And yet, isn’t it the case? Our lives are our own - no other person has the same…

    Hover Events & Different Cursors With CSS

    May 08, 2019

    More CSS fun today! One way to visually indicate that an element is clickable is by changing the cursor to a If a data element is supposed…

    Z-Index: Geometry, Not Magic

    May 07, 2019

    It was one of those light bulb moments when things finally clicked. My colleague was describing how to ensure that my elements weren’t…

    Scroll Events And Invoking Lodash’s `_.throttle` Or `_.debounce`

    May 06, 2019

    Recently, I was working on a project where I wanted the scroll event to invoke a function that would affect other elements on the page. For…

    Git Merge Strategies - Recursive - Theirs (and Ours)

    May 04, 2019

    Often when I get a merge conflict, what I really want to do is defer to the master branch, so, if I’m on a branch and I want to merge in the…

    Lodash `_groupBy` Vs. Custom Helper Functions

    May 03, 2019

    Yesterday, I wrote about using Lodash’s to solve a problem. The issue was that that wasn’t the first time Lodash proved helpful. My first…

    Objects, Undefined values, and Lodash’s `_.pickBy` and `_.identity`

    May 01, 2019

    Let’s start with the basics. I was in an oh-so-common situation recently where I was building a component that would visualize the details…

    Git - Renaming A Branch: Locally & Remotely

    April 30, 2019

    To rename the name of a branch, there are four potential steps: Checkout the existing branch (the one you want to rename): Rename the local…

    Ps and Qs: The Overlooked Final Piece

    April 30, 2019

    When I was younger, I learned to “mind my Ps and Qs.” I’m glad I did. It’s a relatively straightforward behavior that has paid dividends…

    How To Find Your Notes Quickly (In Bear)

    April 28, 2019

    I use Bear as my digital note keeper and place where I write. As I continue to add more notes to it (6k and counting), being able to find my…

    Using The Emoji Keyboard And Keyboard Shortcuts

    April 28, 2019

    On Macs there is a Emoji & Symbols keyboard. You’ve probably seen it on your phone, but desktops and laptops have it too. To launch it, go…

    Git - Checking Out Remote Branches

    April 27, 2019

    Earlier this week, I pulled down a colleague’s work to test it locally. Unfortunately, the steps I followed ended up merging the new feature…

    Minimizing bundle sizes by restructuring your imports

    April 26, 2019

    Using the example of importing the into a file, we can see how this works. is equivalent (at least in terms of bundle size) to But, if we…

    The Purposeful Pause Practice

    April 23, 2019

    The world is busier than it used to be. We’re bombarded by constantly with work emails, Instagram notifications, and Slack messages. My…

    Error Handling: Address In Use

    April 18, 2019

    Running my node server, I got an error indicating that my port was already in use (). I knew that shouldn’t have been the case because I had…

    Writing Is Just The Beginning: The Tradeoff Between Clarity And Exploration With Writing And Conversing

    April 17, 2019

    But you’re never going to achieve what you want to, Mr. Caro, if you don’t stop thinking with your fingers. R.P. Blackmur via ‘Working…

    Learning (@ Work)

    April 16, 2019

    I think the psychology of learning at work is interesting. On the one hand, an employer should want employees to ask questions and learn…

    Pomodori and Deep Work

    April 14, 2019

    I brought pomodori back this week after listening to the podcast episode with Productivity with Mani Vaya. Mani won me over early in the…

    When Tracking Makes Sense

    April 14, 2019

    Before my recent efforts to be more mindful of how I used technology, I was quite proud of the streak I had with meditating daily. I had…

    Currying - An Introduction With Function Declarations & Expressions

    April 13, 2019

    For a long time, I hated seeing functions like this: . I thought this was just “code golf” (the idea of reducing a function to its shortest…

    How To Test Your API Using cURL & Postman

    April 13, 2019

    The other day, I found myself making some changes to a network request for our application. By navigating to a specific page, I knew I’d…

    Bash Functions & Git - How to wipe out changes made to a specific file

    April 07, 2019

    I find myself writing the following command multiple times daily. I had been reading a little about bash functions and wanted to see if I…

    Default Prop Values In React

    April 05, 2019

    What value does a prop get if no value is assigned? To think about this more tangibly, imagine you have a higher order component, . That…

    Closure & Lexical Scope

    April 05, 2019

    When we say that JS is lexically scoped, what we mean is that a function will have access to the variables in the context of which it was…

    Rename Variable While Destructuring In Javascript

    April 04, 2019

    I recently came across a situation where I had two different props in a component that had the same name (they were in different parts of…

    React Lifecycle Methods - A primer with React 16

    April 04, 2019

    One of the things that I didn’t appreciate when I first started using React was how helpful the different lifecycle methods were. I got away…

    Copying Data From One Column To Another With SQL

    March 08, 2019

    If you need to copy all data from one column to another column in SQL, use the method. If it’s a simple copy for copy, without conditionals…

    `.d.ts` Files And Typescript Interfaces

    March 08, 2019

    The file is a declaration file. In this case, it’s a declaration file for Typescript files. What does that actually mean though? The…

    The Limits of Habits

    March 02, 2019

    Are there areas of life where the costs of efficiency gained outweigh the costs? Of course. It’s just not a question that I ask that…

    Object Oriented Javascript: Class Instantiation Patterns

    February 18, 2019

    What are classes anyway? A class is an entity that is capable of producing objects (instances) that share common attributes, features, and…

    React Key Props And Why You Shouldn’t Be Using Index

    February 17, 2019

    If you’ve ever mapped over an array in React, you’ve likely seen this warning: I wanted to understand why React gives this warning. After…

    Looking Up Shell Functions In Zsh

    February 13, 2019

    I recently figured out how to write a shell function. The problem is that pretty quickly I’d forgotten which functions I’d written, or fi I…

    Next Level Shell: Aliases And Functions

    February 13, 2019

    Imagination Time Imagine a situation where you want to be able to navigate to a specific directory then open that directory with your text…

    MacOS Spotlight Nonsense & Reindexing

    February 12, 2019

    Recently, Spotlight had been acting up. For example: When I search for Spotify (an app I use every day), it wouldn’t show up. Instead I’d…

    JS Modules Primer: Export & Require

    February 11, 2019

    Import/Export vs. Require in JS On more than one occasion I’ve found myself looking up the MDN page on imports and exports for modules in…

    Reasons To Share

    February 06, 2019

    There are plenty of reasons to write this blog and share your perspective. Recently, however, I had a few experiences that really reinforced…

    Difference Arrays: What Are They And How Do They Work?

    January 31, 2019

    Difference Arrays Imagine you’re given a problem that says for each “query” in the format add to all elements of an array of zeros with a…

    Exploring GET Requests: Multiple Values And Parameters

    January 30, 2019

    The ease of writing GET requests varies with the clarity of the supporting documentation. With that in mind, I recently explored an API…

    Rotating Arrays: Two Ways

    January 30, 2019

    How would you rotate an array’s elements if you were given an array and a number of left rotations? (A left rotation is defined as moving…

    Heroic Consistency, Wu Wei, And The Middle Way

    January 30, 2019

    I recently found the following tweet about heroic consistency. Don’t aim for consistently heroic efforts. Aim for being heroic at…

    Better Form Submissions with Event.preventDefault() and HTMLFormElement.reset()

    January 04, 2019

    Two tools to keep in your tool belt when adding forms to your website should be: The reason is that by default, on submission of a form…

    Write Your Own Javascript Contracts and Docstrings

    December 29, 2018

    My very first introduction to code was with ~Introduction To Computational and Programming Using Python~ by John V. Guttag. While I didn’t…

    VSCode: Adding Ligatures To A Font That Doesn't Have THem

    December 29, 2018

    A few months ago, I found a font, that introduced me to ligatures and how they could be useful in writing code. Fira Code’s ligature set…

    Lessons In querySelector And The Importance Of Understanding Mechanism

    December 27, 2018

    NB: The below illustrations are inspired / adapted from MDN’s great page on QuerySelector. I did not come up with these examples (though I…

    Postman, URI Encoding, and Occam's Razor

    December 25, 2018

    Occam was a 14th century theologian-philosopher who is perhaps best known now for his relentless insistence on using the law of parsimony…

    Debugging: Dev.To RSS-To-Draft Only Displaying Post Summaries (Wordpress Solution)

    December 23, 2018

    Preamable I’m filing this under the category of: “Issues that I created for myself and don’t want to forget how I solved.” Also, I don’t…

    Oh-My-Zsh and Persistent Aliases

    December 22, 2018

    NB: If you want the quick steps to add aliases to your , jump down to the section, ”Adding Aliases: The Better Way“. First, a little…

    Charts, Colors, and Complements: Oh my!

    December 20, 2018

    Charts are the black hole of programming. I was warned, but I wanted to tackle charts anyway. That was my first mistake. Humans tend to…

    Node Environmental Variables: A Simple Example

    December 18, 2018

    This is not going to be a deep dive into Node’s environmental variables, but rather a quick look at how you may use environmental variables…

    Error Handling: Jest with Babel

    December 16, 2018

    Trying to run tests with Jest, I got the following error: Looking at the stack trace (in full at the end of this post), however, there were…

    Custom Sort Functions with Javascript

    December 14, 2018

    Javascript’s built-in sort is powerful and fast. However, there are many times when you will want to sort in a custom fashion. Whenever I…

    Error Handling: Uncaught TypeError: this.searchDB is not a function

    December 12, 2018

    While working on a React project, I came across the following error: is a method on my component that is called when certain buttons are…

    Customizing webpack

    December 10, 2018

    I’ve looked up how to customize my Webpack a number of times, so I’m documenting here to serve as a reference and template for future…

    Adding Indexes To Mongo + A Case Study

    November 30, 2018

    I’ve been working on projects with larger data sets recently and have begun to notice that not all queries resolve in one or two…

    Experience, exposure, and the building of knowledge

    November 29, 2018

    A few weeks back I went from an absolute novice to being invited to present on a topic in the span of five days. The experience was humbling…

    Axios And Routing With baseURLs

    November 27, 2018

    I was unifying multiple micro services into a single front-end. To do this efficiently, I wanted to create a single proxy that sat in front…

    Indexing Databases - A Postgres Example

    November 22, 2018

    A short review of when and how to index a Postgres database. Common Commands Why Index Your Postgres Table The two most common reasons to…

    Learning To Savor The Moment

    November 21, 2018

    Savor the moment I love that phrase. It’s a reminder that there is something genuinely special about this moment in time. The circumstances…

    Error Handling: permission denied for sequence _id_seq…

    November 20, 2018

    Recently, I was using NodeJS to write directly to a Postgres database when I got an error beginning with: What follows are the steps I took…

    A Beginner's Guide to Feature Branch Workflows with Git

    October 25, 2018

    The Feature Branch Workflow for git is a graduation from the Centralized workflow where all changes are made directly to the master branch.…

    Debugging Create-React-App

    October 23, 2018

    In an effort to learn React, I pulled up React’s introductory tutorial. Almost immediately I hit turbulence. I was in the setup of the…

    Printing Articles and Blogs in 2018

    October 21, 2018

    There are more free resources out there today than ever before. For a student, it’s a glorious time. Despite the rise of great annotating…

    Swapping and Bitwise Operators

    October 02, 2018

    One of the simplest ways to swap two variables in programming is to create a temporary variable that holds a value while you iterate. Given…

    Growing up

    September 14, 2018

    Greg Lukianoff was recently on the Cato Daily Podcast to discuss his new book with Jonathan Haidt, the ”The Coddling of the American Mind…

    Leadership vs Management

    September 11, 2018

    Cal Turner Jr., CEO of Dollar General, was on the A16Z podcast this week. In a wonderful moment, Cal reflected on a lesson he took from his…

    Shady email practices

    September 10, 2018

    Want to make sure that your customers unsubscribe even less than they would otherwise? Make your email long enough so that only the footer…

    Aggregators and what they're hiding

    September 09, 2018

    The thing about aggregators is: in an era of abundant supply, it’s almost impossible to know when things aren’t there. When you need a piece…

    Dear Donald

    September 08, 2018

    Dear Donald, Four years ago, you told me to ”Learn To Code.” This month I will be taking the next step in that journey as I start a full…

    Aliases and the .bash_profile

    September 05, 2018

    .gitconfig follow-up with .bash_profille In my previous Git posts (here and here), I noted that one of the things I found really helpful was…

    Chia seed pudding

    September 01, 2018

    At brunch with my cousin, I tried Chia Seed Pudding for the first time. It was awesome. To me it was a pleasant combination of Oatmeal and a…

    Improvements in cable management

    August 31, 2018

    Spend enough time looking at pictures of desks and you’ll realize that despite all of the electronics, there are terribly few wires on…

    Git clone, pull, and push

    August 30, 2018

    Git Clone, Pull, and Push Continuing my learnings re: Git. I wanted to better understand the use cases for three Git commands: Clone Pull…

    Curbing my natural tendencies

    August 29, 2018

    This spring I read the Jason Zweig updated version of Benjamin Graham’s The Intelligent Investor, the follow up to his more technical…

    Time in the kitchen

    August 28, 2018

    I’ve been trying to pick up more of the cooking duties in our home and I’ve noticed that recipes often make a distinction between prep time…

    Deciphering the terminal

    August 27, 2018

    My goal is to be a competent command line programmer. I knew that in order to make that happen, I would have to get very comfortable reading…

    How to quickly / safely keep my project up to date with branches (and avoid avoidable problems)

    August 26, 2018

    I got into a bit of a mess earlier today when I accidentally checked out an old state of my current branch without creating a new branch for…

    Learning Git from the ground up - another Git tutorial

    August 22, 2018

    I’ve been trying to learn more about Git recently. I thought I’d write up some of the lessons I’ve learned to create a basic primer on Git…

    Deep and shallow copying - A tale of two friends

    August 20, 2018

    I was recently using the slice method to copy an array and I ran into a few difficulties understanding why my copy was not shallow. From the…

    Giraffes and Elephants

    August 14, 2018

    The simplest endeavor toward diversity focus on hiring practices. Making sure that candidates are not systematically excluded and that…

    Confucianism’s marketing problem

    August 13, 2018

    I’m currently reading The Path by Michael Puett and Christine Gross-Loh. Puett and Gross-Loh contrast Confuscius to Kant and the modern…

    The best time to get started was yesterday

    August 12, 2018

    The next best time is now. I’ve been dying to get back to this blog for months but this week two things gave me the push I needed: First…

    Measurement overload

    June 14, 2017

    Measurements are getting cheaper, but the amount getting done is not keeping pace. Why is that? Nearly 150 years ago, William Thomson, the…

    A Healthy Skepticism

    June 13, 2017

    “For best results, mattresses should be replaced every 8 years” — I recently saw an ad with this copy in a window of a mattress store near…

    A small tweak but a big difference

    June 10, 2017

    Last night, I made a small change that made a big difference. It didn’t feel significant when I made it. It felt like a thing you do when…

    Meetings with yourself

    June 09, 2017

    I write only when inspiration strikes. Fortunately it strikes every morning at nine o clock sharp. - W. Somerset Maugham It’s not…

    Sending a signal - Meetings at AndreesonHorowitz

    June 08, 2017

    In his brilliant book on management and leadership, The Hard Thing About Hard Things, Ben Horowitz covered a lot of ground. Three years…

    The hat tip

    May 23, 2017

    The hat tip is ”a cultural expression of recognition, respect, gratitude.” It’s more modern incarnation takes that tradition and translated…

    Showing up and the Daffodil Principle

    May 19, 2017

    There are days when I don’t want to show up. Days when I wish I could just jump ahead to the part where I have accomplished my goal, won the…

    You're doing it wrong

    May 17, 2017

    Ryan Holiday recently weighed in on the phenomenon of ‘ultra hardcore readers’ - people who spent nearly every spare minute of their day…

    The hidden cost of habit creep

    May 16, 2017

    Habits are a way to automate certain decisions to make space for the bigger ones. They are not, however, a panacea - a lesson which became…

    The allure of banned materials

    May 06, 2017

    A few days ago, I got to talking with a friend about the Berkeley students’ recent protests and threatened protests in advance of speeches…

    Why write?

    April 26, 2017

    In his annual letter to shareholders, Jeff Bezos answered a question that had been following him around for twenty years: what does Day…

    Optimizing for the experience

    April 16, 2017

    Think about the last time you were in an elevator. Did you pull out your phone to check your email or get an update on the score of the game…

    Where do you live?

    April 08, 2017

    When we meet people for the first time, we are filling in gaps with all of the information we can gather about a person. No matter how good…

    This too shall pass and thoughts on (im)permanence

    April 06, 2017

    Permanence is beautiful. I would argue that one reason we gravitate toward immortal divine beings is that there’s comfort and solace in…

    Acknowledge then correct; skip the judgment

    April 03, 2017

    I had wanted to write something smart tonight. The topic was all picked out, I had researched it, and I’d even thought of an anecdote about…

    Drowning out thoughts

    April 02, 2017

    “An artist must have downtime, time to do nothing.” — Julia Cameron A few months back, I was talking to a friend who confided that he filled…

    City of Big Shoulders

    March 31, 2017

    Hog Butcher for the World, Tool Maker, Stacker of Wheat, Player with Railroads and the Nation’s Freight Handler; Stormy, husky, brawling…

    Looking at the keys to successful (email) communication

    March 30, 2017

    In my first corporate orientation class, I participated in a professional writing seminar lad by Curry Young Consultants. In terms of return…

    Alleviating the pressure to be right

    March 29, 2017

    “If they don’t know your dreams, then they can’t shoot ‘em down” - J.Cole Most kids learn to share at an early age. It’s a lesson that…

    Graveyard of Good Intentions

    March 28, 2017

    Commitments are easy to accumulate and much harder to extricate from. One of the reasons why I’ve felt this week to be particularly…

    Media diet

    March 27, 2017

    These past few weeks have been a lot for me. I’ve felt overwhelmed and underwhelmed, isolated and crowded, confident and unsure. The roller…

    Yesterday is not like today

    May 07, 2016

    This morning I woke up for the first time in nearly three years without something that had become a core part of my identity. Yesterday, I…

    Sneezes, meetings, and Kitty Genovese

    February 21, 2016

    The room was quiet and the music soothing. After 50 minutes of flowing from pose to pose in a room approaching 95°F, the class collectively…

    Learning to "GTD"

    February 14, 2016

    I have a friend who likes to say that people complain all the time about not having enough time to do what they find important, but when he…

    Brief thoughts on reading and note taking

    February 10, 2016

    Coming into 2015, I promised myself that I would read more than I did the year before. I was achieved this goal, but I finished was no where…

    Yesterday's Coffee - tastes like you made it today!

    December 11, 2015

    “For the rest of our lives, we will always be one pot of coffee ahead.” “Until that day when I make a pot of coffee that neither of us will…

    Blue Origin's historic rocket landing

    November 24, 2015

    Because who doesn’t want to go to space? Also, props to the creative team who had the video chopped and edited in 24 hours to take us all…

    Who Would Buy A Car Programmed To Sacrifice The Owner?

    November 02, 2015

    “Who would buy a car programmed to sacrifice the owner?” 1 What I love about this question is that it gets at two conflicting priorities…

    Reaction: The Thucydides Trap: Are the U.S. and China Headed for War?

    October 02, 2015

    Graham Allison’s article “The Thucydides Trap: Are the U.S. and China headed for War?” published in this month’s Atlantic reviews the rise…

    Reaction: When Housing Prices Rise, So Do Retail Prices

    September 27, 2015

    The left panel of Figure 1 shows that retail-price inflation was highest in locations with high housing price growth during the housing boom…

    Musings in the beer aisle

    August 13, 2015

    Preamble I love beer. Thanks in part to a stint in Prague and living with a beer nerd for a year, it’s a real treat to stand in front of a…

    Shirt patterns and memory

    August 09, 2015

    via The Old Design Shop Yesterday, I sat down at my friend Grant’s desk to catch up a bit. He commented on my shirt and said something to…

    Should education be subsidized?

    July 19, 2015

    Beyond my health, education is probably the single greatest gift I have ever received. I am eternally grateful to my parents, my teachers…

    Starting with a question

    July 18, 2015

    This site starts with a question. It’s a question about purpose, about direction, and about value - “Is this worth reading? Is it useful or…

    Stephen Weiss

    Thanks for reading! My name's Stephen Weiss. I live in Chicago with my wife, Kate, and dog, Finn.
    Click here to see the archives of my weeks in review and sign up yourself!