All things Tip
How to read Node.js environment variables
Running a Node app is simple. Sometimes you want to add environment variables that either contain sensitive information or are contextual to the environment you want to run your app on. You can set them the moment the process is started. Imagine hav…
How to show filenames in code snippets in Gatsby in Markdown
With the gatsby-remark-code-titles plugin. Custom title gets injected and then needs to be styled. Example from docs: Usage This plugin will parse the Markdown AST, pluck the title, and then “clean” the code snippet language for further processing. …
Edit your web page content directly in Chrome
Executing in the browser console will let you click and type anywhere you want on your page. This is helpful if you want to experiment with text directly on the page instead of in the DOM.
How to unmap a var from a Clojure namespace
I was working with a multimethod that I needed to redefine in my REPL and came across this doc. There is an entry that states if you are in the REPL and need to redefine then you will need to unmap the var because defmulti won't allow you to redef. …
How to debug a specific Gatsby package on build
I got an error and needed to get verbose logs for a particular package during a Gatsby build. I came across this issue on GitHub with reference to a DEBUG env var that can be set to get better logs.
How to write stdout both to the terminal and a file
Below I use the tee command to write the output of an script to both to the terminal and to a log file.
How to sort your package.json dependencies
is short hand for and . "example" is just the name of a package. You can use it verbatim because it will most likely not be in your package.json. Your packages are sorted by running npm remove even if the package "example" doesn't exist. Thanks to …
Name CSS Split Chunks using MiniCssExtractPlugin
React: 17.0.2 Webpack: 5.67.0 Webpack CLI: 4.9.1 mini-css-extract-plugin 2.5.3 Snippet Objective Bust the cache for CSS files that are emitted on build using Webpack 5 with Split Chunks. Set up one or more CSS files inside a React component. A sing…
How to recover a file from another branch in Git
Where branch can be any ref including a branch name, tag, HEAD. Thanks to this Stack Overflow reference.
How to see the contents of stashed changes in Git
Where is the indexed location of the item in the stash. Find all items in the stash using: https://stackoverflow.com/questions/3573623/is-it-possible-to-preview-stash-contents-in-git https://stackoverflow.com/questions/10725729/see-whats-in-a-stas…
How to kill processes running on localhost (macOS)
Motivation Sometimes a process, like a web server or running Clojure REPL, closes unexpectedly but the port is never released. I'd need to find that process and kill it so that I can rightfully claim my port back. Find the process It will return som…
How to find text anywhere in your Git repository from the very beginning
Stack Overflow - Search all of Git history for a string Stack Overflow - How to grep Git commit diffs or contents for a certain word
Why you will see the error 'Loading chunk \d+ failed'
This includes cases where the file has been renamed. More Stack Overflow: , show all commits including merges
How to use a different email address in Git in sub directories
I want to override my personal email address I use for Git with my work email address in my work directory without manually changing it each time.
How to search through all files in your web application in Google Chrome
I am running Version 97.0.4692.71 (Official Build) (arm64) to date. Why? Use this feature to find text in any resource served by the web server. It's handy for searching for things where the location is sometimes uncertain. How There are two ways I …
How to sort stories alphabetically in Storybook (6.2)
How to reference a local Webpack npm package
With the help of this question and answer from Stack Overflow: Install the local npm package using the file path. Check node_modules to see the installed package. (or depending on the requirements) && (in this example the package exists in the pare…