/* Code-Comments */

Search:
December 08, 2019

Yesterday, I wrote about [how to pull a specific files from another branch into your branch](../../2019-12-07/git-copy-files-between…

Read more
December 07, 2019

Frequently, I want to pull in just a single file from another git branch. I always need to look up the specifics, so I’m documenting it to…

Read more
December 06, 2019

While Storybook is great for communicating the potential of different components, debugging issues with components can be more of a…

Read more
December 05, 2019

If you're like me, you've likely never heard of a Harvey Ball - though you'd recognize them if you saw it. That's because Harvey Balls are…

Read more
December 04, 2019

I'm a big fan of Storybook JS. It makes sharing what's possible with a React component trivial.<sup>1</sup> There is a potential problem…

Read more
December 03, 2019

If you [switch between shells](../../2019-09-02/change-default-shell-zsh), it might be handy to determine which one is currently running…

Read more
December 02, 2019

When you have a lot of scripts in your npm package, it can get overwhelming. Recently a colleague introduced a new pattern in one of our…

Read more
December 01, 2019

I was looking to plan an event recently at [Beermiscuous](https://beermiscuous.com/), a beer cafe in Chicago that I really like. Their…

Read more
November 30, 2019

Recently I was working with a Docker image of a Postgres database. Everything was going great. ![](./docker-image.png) At one point, I…

Read more
November 29, 2019

Recently, I went on a search to find a new arrow to use on my website (I settled on `&#10149;` which produces this: &#10149;). In my…

Read more
November 28, 2019

By default the `node-postgres` returns everything from PostgreSQL as a string. Brian Carlson, the author of `pg`, provides a solution for…

Read more
November 27, 2019

I am constantly striving to improve my understanding and comfort interacting with my terminal. I remember how excited I was when I first…

Read more
November 25, 2019

I wrote in the past about [Array Intersections in Postgres](../../2019-07-01/array-intersection-in-psql/), which alluded to operators and…

Read more
November 25, 2019

If you’re just learning how to use Postgres from the terminal (as I am), sometimes you click the wrong button and don’t know what it does…

Read more
November 24, 2019

Before you can [connect to a Postgres database](../../2018-08-19/access-psql-via-shell/) from the command line, it needs to be running. If…

Read more
November 23, 2019

When it comes to RESTful APIs, there’s not a ton of availability to be creative - at least in terms of the names of the APIs. You’re going…

Read more
November 22, 2019

As apps grow, the number of routes can balloon. More than that, you may need custom middleware for certain routes and not others - whether…

Read more
November 21, 2019

Middleware is software that sits between two other pieces of software and can augment, change, modify, or even respond to data it receives…

Read more
November 20, 2019

One of the challenges of using `nodemon` to monitor changes to a node server and restart is if some changes get cached. I came across…

Read more
November 19, 2019

If you’re running a node application and you want to debug, but don't want to use the debugger in your text editor, perhaps your text…

Read more
November 18, 2019

I often find myself looking up patterns for converting synchronous code into async variants in Javascript. Whether it’s remembering how…

Read more
November 17, 2019

I came across the following function in a codebase today and struggled to see what was happening - the combination of classes with…

Read more
November 16, 2019

One of the best parts of the javascript ecosystem is the number of packages that are readily available to expedite development. If there’s…

Read more
November 15, 2019

To create a symlink, you need only one command: ```shell $ sudo ln -s /path/to/original /path/to/destination ``` For example, on Ubuntu…

Read more
November 14, 2019

I recently spun up a Digital Ocean droplet and almost immediately ran into problems logging into it. For context - the steps I took were…

Read more
November 13, 2019

The `!!` is a quick way to repeat a command in a UNIX environment. For example, here I’m looking at a directory’s contents, then invoking…

Read more
November 12, 2019

Continuing the trend of learning more about Javascript classes of late, I found the following recently and thought it was quite interesting…

Read more
November 11, 2019

Recently I wrote about [my aha realization of what exactly we’re doing when we pass the props that a class constructor receives to super…

Read more
November 10, 2019

To make an environment variable available in Bash or Zsh, save the environment to `.bashrc` or `zshrc` respectively. To set the variable…

Read more
November 09, 2019

When we define a class component as a derivation of a base class, this gives us access to all of the base class’s public (and protected…

Read more
November 08, 2019

Imagine you have a Single page application but you want to allow your users to navigate to different pages within the app. I wanted to…

Read more
November 07, 2019

I thought this was pretty cool. Imagine you want to create a file programmatically and allow a user to download it. For the sake of this…

Read more
November 06, 2019

Came across an interesting example of a rarely used feature (at least for me) in Javascript creating unexpected results with Typescript…

Read more
November 05, 2019

As React continues to upgrade its API, there are parts the team is working to deprecate. If you want to make sure your app stays up to…

Read more
November 04, 2019

The `useEffect` hook in React is scheduled to run after render. There are three different categories of running it: 1. Without…

Read more
November 03, 2019

When it comes to global node packages, there are typically three things I want to do: 1. See what’s installed (view globally installed node…

Read more
November 01, 2019

In Javascript, Sets are Objects with a few special attributes. Notably, they’re _iterable_ collections of _unique_ elements. One of the…

Read more
November 01, 2019

![](./universe-drawing.png) I want to highlight one way to create a subset of data. To get us started, let’s think about a universe of…

Read more
October 31, 2019

Filing this under delightful surprises. I was working with `StorybookJS` today when I stumbled into a few keybindings that I didn't know…

Read more
October 30, 2019

What if, instead of a table’s _data_, you wanted to see the table’s metadata? That is, instead of querying all of the rows within a table…

Read more
October 29, 2019

The other day I came across a pattern for creating objects I couldn’t quite understand. The code looked a little like this: ```javascript…

Read more
October 28, 2019

Let’s say we’re building a simple web form with a twist: we want the submit to only appear if all of the fields are valid. In all other…

Read more
October 27, 2019

There are three main types of React Components. There are also (with the introduction of hooks in 16.8) three different ways to define…

Read more
October 26, 2019

I still remember when I first learned how to conditionally render my React components. It was a light bulb moment. I began seeing new…

Read more
October 25, 2019

I was reviewing a project recently that made use of the `react-intersection-observer` library and was fascinated by the simplicty of the…

Read more
October 24, 2019

The goal of most writing is to communicate a point to the reader. This is where conventions and rules come in handy. They create a shared…

Read more
October 23, 2019

When you pull a repository down (i.e. clone it) from a remote (like Github, Gitlab, or a private host), git will automatically add it as a…

Read more
October 22, 2019

When trying to run an `npm` command, you can’t install the packages, you may get the error: ```shell stephen  ~/_coding/remine…

Read more
October 21, 2019

When does it make sense to use a reducer vs a simple state value with React’s Hooks? There’s no hard-and-fast rule, but the React team…

Read more
October 20, 2019

Deciding to not bootstrap my [React-Playground](https://github.com/stephencweiss/react-playground) app is the gift that keeps on giving…

Read more
October 19, 2019

I was recently trying to switch over from a private registry default to the default one. When I tried to reinstall my dependencies…

Read more
October 18, 2019

I’ve written in the past about the [benefits of `Pick` in writing better interfaces with Typescript](../../2019-06-25/typescript-pick…

Read more
October 17, 2019

When things that used to work break, I want to understand why. That was the situation recently with `npm`, the reliable workhorse behind…

Read more
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…

Read more
October 15, 2019

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

Read more
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…

Read more
October 13, 2019

Back in February I wrote a [primer on exports and require](https://www.stephencharlesweiss.com/2019-02-11/js-modules-primer-export-and…

Read more
October 12, 2019

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

Read more
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…

Read more
October 10, 2019

We use templates to help write descriptive tickets or MRs on various projects at work. <sup>[1](#fn1)</sup><a id="sup1"></a> Then I started…

Read more
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…

Read more
October 08, 2019

Every time I’ve thrown an error, I’ve used the `Error` object. ```javascript try { // do something if (/* something bad happens…

Read more
October 07, 2019

Starting around 2015, browsers started treating the attribute `autocomplete` on `<input>` fields differently. Instead of honoring what had…

Read more
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…

Read more
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.<sup…

Read more
October 04, 2019

About a year ago, I learned about [bitwise operators and using them to swap elements of a list](../../2018-10-21/swapping-and-bitwise…

Read more
October 03, 2019

In learning about [Auto-Complete In HTML Forms](../../2019-10-07/auto-complete-forms), I discovered that the `type` of an `<input>` makes…

Read more
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…

Read more
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…

Read more
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…

Read more
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…

Read more
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…

Read more
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…

Read more
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…

Read more
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…

Read more
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…

Read more
September 23, 2019

Recently, I walked through building a basic React App.<sup>1</sup> In retrospect, I could make it _even more_ basic by removing _any…

Read more
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…

Read more
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…

Read more
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…

Read more
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…

Read more
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…

Read more
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…

Read more
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…

Read more
September 15, 2019

What are the differences between a `.zip`, `.tar`, `.gz`., and `.rar`? It turns out it’s both a lot and a little. Some basics: - `.zip…

Read more
September 14, 2019

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

Read more
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…

Read more
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…

Read more
September 09, 2019

I found this insanely easy way to roast an entire Caulflower head.<sup>1</sup> ~~If~~ When I do it again in the future, I'll experiment…

Read more
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…

Read more
September 07, 2019

The steps to adding Prettier to a project are very simple: 1. Install Prettier (`npm i --save-dev prettier`) 2. Create a `.prettierrc…

Read more
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…

Read more
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…

Read more
September 04, 2019

Built into Javascript’s `String` primitive are Regex methods such as `.match` and `.replace`.<sup>1</sup> We can use the latter to…

Read more
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…

Read more
September 02, 2019

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

Read more
September 01, 2019

Recently upgraded an application and got this warning ![](./error-cannot-be-opened.png) In the past, I used to be able to "right" click on…

Read more
August 31, 2019

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

Read more
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…

Read more
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…

Read more
August 28, 2019

One of our family’s favorite recipes is a Harissa Grilled Eggplant from Goop.<sup>1</sup> It’s quick, full of flavor, and relatively…

Read more
August 27, 2019

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

Read more
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…

Read more
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…

Read more
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…

Read more
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…

Read more
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…

Read more
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…

Read more
August 20, 2019

I was trying to modify a table today when I hit an error: `SQL Error [42501]: ERROR: must be owner of table XXX`. To figure out _who_ the…

Read more
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…

Read more
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…

Read more
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…

Read more
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…

Read more
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…

Read more
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…

Read more
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…

Read more
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…

Read more
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…

Read more
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…

Read more
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…

Read more
August 09, 2019

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

Read more
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…

Read more
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…

Read more
August 05, 2019

When I set up my `gatsby-filesystem` previously, I noted that if there were multiple file systems that I wanted access to, all I need to do…

Read more
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…

Read more
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…

Read more
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…

Read more
August 01, 2019

If you have `vim` already installed, you can get an interactive walk-through using the `vimtutor`. To launch `vimtutor`, open your shell…

Read more
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…

Read more
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…

Read more
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…

Read more
July 26, 2019

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

Read more
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…

Read more
July 24, 2019

My dive into [Gatsby](../../2019-07-20/gatsby-source-filesystem) continues. Today, I wanted to better understand how dynamic queries worked…

Read more
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…

Read more
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…

Read more
July 20, 2019

Continuing my learnings in Gatsby and today I found out a few new pieces about the filesystem plugin, `gatsby-source-filesystem`.<sup>…

Read more
July 19, 2019

The `SEQUENCE` in Postgres is a number generator.<sup>1</sup> Once created, they can be managed with sequence operators.<sup>2</sup> So…

Read more
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…

Read more
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…

Read more
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…

Read more
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…

Read more
July 13, 2019

In order to understand `require.resolve`, part of the Node API, we must first understand its context. Namely, the `require` module and how…

Read more
July 12, 2019

I wrote in the past about using [constraints in the context of array operators in Postgres](../../2019-07-01/array-intersection-in-psql…

Read more
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…

Read more
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…

Read more
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.<sup>1</sup…

Read more
July 03, 2019

I’ve written in the past about why I like testing my [APIs with Postman](../../2019-04-13/testing-api-with-curl-and-postman). Today, I…

Read more
July 02, 2019

Yesterday, I wrote about the [intersecting of Arrays in Postgres](../../2019-07-01/array-intersection-in-psql). Today, I wanted to go a…

Read more
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…

Read more
June 30, 2019

Imagine the following situation - you’re trying to select columns from a Postgres table ```sql create table if not exists media…

Read more
June 29, 2019

Yesterday, in talking about [Postgres and Subqueries](../../2019-06-28/postgres-subquery-basics) I was trying to represent a relationship…

Read more
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…

Read more
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…

Read more
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…

Read more
June 25, 2019

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

Read more
June 24, 2019

The short answer: there is _no_ difference. When investigating, I was steered to the Typescript Handbook<sup>1</sup> which notes: > The…

Read more
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…

Read more
June 21, 2019

Building on lessons from yesterday's dive into `groupBy`, I found an opportunity to explore `pick`. This time it was because I wanted to…

Read more
June 20, 2019

As I [wrote previously](../../2019-05-03/lodash-groupby-vs-custom-helpers), the `_.groupBy` method of Lodash can be really useful. My…

Read more
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…

Read more
June 18, 2019

A few days ago, I wrote about handling arrays from [Javascript to SQL](../../2019-06-15/array-handling-javascript-sql). Turns out, I…

Read more
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…

Read more
June 15, 2019

Yesterday we updated a Postgres record’s details based on the `id` and returned the update in a [single query](../../2019-06-14/psql-return…

Read more
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…

Read more
June 13, 2019

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

Read more
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…

Read more
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](https://www…

Read more
June 10, 2019

When looking around a table in Postgres today, I noticed a curious looking field. `groups_reso` _looked_ like a collection, but when I…

Read more
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…

Read more
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…

Read more
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…

Read more
June 06, 2019

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

Read more
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…

Read more
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…

Read more
June 04, 2019

I was recently trying to understand Material UI's `<Stepper>` component. In looking through their implementation of the Horizontal Linear…

Read more
June 03, 2019

[Storybook supports static files](https://storybook.js.org/docs/configurations/default-config/#image-and-static-file-support), like images…

Read more
June 02, 2019

In the same vein as [cleaning up my git branches](../../2019-05-26/local-git-stale-branch-cleanup), today I recalled that I can easily…

Read more
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…

Read more
May 31, 2019

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

Read more
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…

Read more
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…

Read more
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…

Read more
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…

Read more
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…

Read more
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…

Read more
May 23, 2019

Using two libraries, `styled-components` and `react-image`, I learned a new simple way to create a `Loader` component (i.e. a spinner) to…

Read more
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…

Read more
May 20, 2019

> Make it work. > Make it right. > Make it fast.<sup>1</sup> This maxim screams pragmatism. Don’t optimize too early. Get something…

Read more
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…

Read more
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…

Read more
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…

Read more
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…

Read more
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…

Read more
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…

Read more
May 03, 2019

Yesterday, I wrote about using [Lodash’s `pickBy`](https://www.stephencharlesweiss.com/2019-05-02/objects-undefined-values-and-lodash…

Read more
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…

Read more
April 30, 2019

To rename the name of a branch, there are four potential steps: 1. Checkout the existing branch (the one you want to rename): `git…

Read more
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…

Read more
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…

Read more
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…

Read more
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…

Read more
April 26, 2019

Using the example of importing the `material ui` into a file, we can see how this works. ```javascript import * as materialUI from…

Read more
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…

Read more
April 18, 2019

Running my node server, I got an error indicating that my port was already in use (`Error: listen EADDRINUSE :::5001`). I knew that…

Read more
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…

Read more
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…

Read more
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…

Read more
April 14, 2019

I brought pomodori back this week after listening to the podcast episode with [Productivity with Mani Vaya](https://overcast.fm/+B1THOPAVc…

Read more
April 13, 2019

For a long time, I hated seeing functions like this: `const someFn = a => b => a + b;`. I thought this was just "code golf" (the idea of…

Read more
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…

Read more
April 07, 2019

I find myself writing the following command multiple times daily. ```bash git stash push pacakage-lock.json git stash drop 0 ``` I had…

Read more
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…

Read more
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…

Read more
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…

Read more
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…

Read more
March 08, 2019

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

Read more
March 08, 2019

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

Read more
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…

Read more
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…

Read more
February 17, 2019

If you’ve ever mapped over an array in React, you’ve likely seen this warning: `Warning: Each child in a list should have a unique "key…

Read more
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…

Read more
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…

Read more
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…

Read more
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…

Read more
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…

Read more
January 31, 2019

# Difference Arrays Imagine you’re given a problem that says for each "query" in the format `[a,b,k]` add `k` to all elements of an array…

Read more
January 30, 2019

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

Read more
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…

Read more
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…

Read more
January 04, 2019

Two tools to keep in your tool belt when adding forms to your website should be: 1. `Event.preventDefault()` 2. `HTMLFormElement.reset…

Read more
December 29, 2018

My very first introduction to code was with [~Introduction To Computational and Programming Using Python~](https://www.amazon.com…

Read more
December 29, 2018

A few months ago, I found a font, `fira code` that introduced me to ligatures and how they could be useful in writing code. | ![](./fira…

Read more
December 27, 2018

**NB:** The below illustrations are inspired / adapted from MDN’s great page on [QuerySelector](https://developer.mozilla.org/en-US/docs…

Read more
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…

Read more
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…

Read more
December 22, 2018

**NB: If you want the quick steps to add aliases to your `zsh`, jump down to the section, "[Adding Aliases: The Better Way](#adding-an…

Read more
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…

Read more
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…

Read more
December 16, 2018

Trying to run tests with Jest, I got the following error: `Requires Babel "^7.0.0-0", but was loaded with "6.26.3"...` Looking at the…

Read more
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…

Read more
December 12, 2018

While working on a React project, I came across the following error: `Uncaught TypeError: this.searchDB is not a function` `searchDB` is a…

Read more
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…

Read more
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…

Read more
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…

Read more
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…

Read more
November 22, 2018

A short review of when and how to index a Postgres database. # Common Commands ```sql CREATE INDEX <index_name> ON <table_name> (<field(s…

Read more
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…

Read more
November 20, 2018

Recently, I was using NodeJS to write directly to a Postgres database when I got an error beginning with: `{ error: permission denied for…

Read more
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…

Read more
October 23, 2018

In an effort to learn React, I pulled up [React’s introductory tutorial](https://reactjs.org/tutorial/tutorial.html). Almost immediately I…

Read more
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…

Read more
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…

Read more
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…

Read more
September 11, 2018

Cal Turner Jr., CEO of Dollar General, was on the [A16Z podcast](https://a16z.com/2018/09/05/dollar-store-retail/) this week. In a wonderful…

Read more
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…

Read more
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…

Read more
September 08, 2018

Dear Donald, Four years ago, you told me to "[Learn To Code](https://www.thehunt.com/the-hunt/XWvoQ4-childish-gambino-learn-to-code…

Read more
September 05, 2018

# .gitconfig follow-up with .bash_profille In my previous Git posts ([here](https://wp.me/p6u9oI-eG) and [here](https://wp.me/p6u9oI-eK…

Read more
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…

Read more
August 31, 2018

Spend enough time looking at pictures of [desks](www.reddit.com/r/battlestations) and you'll realize that despite all of the electronics…

Read more
August 30, 2018

# Git Clone, Pull, and Push Continuing my learnings re: [Git](../../2018-08-22/learning-git-from-the-ground-up-another-git-tutorial). I…

Read more
August 29, 2018

This spring I read the Jason Zweig updated version of Benjamin Graham’s [*The Intelligent Investor*](https://www.amazon.com/Intelligent…

Read more
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…

Read more
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…

Read more
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…

Read more
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…

Read more
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…

Read more
August 14, 2018

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

Read more
August 13, 2018

I’m currently reading *[The Path](https://smile.amazon.com/Path-Chinese-Philosophers-Teach-About/dp/1476777845?sa-no-redirect=1)* by…

Read more
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:…

Read more
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…

Read more
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…

Read more
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…

Read more
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…

Read more
June 08, 2017

In his brilliant book on management and leadership, [The Hard Thing About Hard Things](https://www.amazon.com/Hard-Thing-About-Things…

Read more
May 23, 2017

The hat tip is "[a cultural expression of recognition, respect, gratitude](https://en.wikipedia.org/wiki/Hat_tip)." It's more modern…

Read more
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…

Read more
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…

Read more
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…

Read more
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…

Read more
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…

Read more
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…

Read more
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…

Read more
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…

Read more
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…

Read more
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…

Read more
March 31, 2017

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

Read more
March 30, 2017

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

Read more
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…

Read more
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…

Read more
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…

Read more
May 07, 2016

![](./oshlogo.jpg) This morning I woke up for the first time in nearly three years without something that had become a core part of my…

Read more
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…

Read more
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…

Read more
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…

Read more
December 11, 2015

`youtube: JgMiS81jFyE` > "For the rest of our lives, we will always be one pot of coffee ahead." > > "Until that day when I make a pot of…

Read more
November 24, 2015

`youtube: 9pillaOxGCo` Because who doesn't want to go to space? Also, props to the creative team who had the video chopped and edited in…

Read more
November 02, 2015

"Who would buy a car programmed to sacrifice the owner?" <sup>1</sup> What I love about this question is that it gets at two conflicting…

Read more
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…

Read more
September 27, 2015

|![](./stroebel-fig1-26-jan.png)| |:---:| | *The left panel of Figure 1 shows that retail-price inflation was highest in locations with high…

Read more
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…

Read more
August 09, 2015

| ![](./OldDesignShop_ONeillCatalogueMensClothingBW.jpg) | |:---:| | via The Old Design Shop | Yesterday, I sat down at my friend Grant’s…

Read more
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…

Read more
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…

Read more
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!