Skip to content

Instantly share code, notes, and snippets.

View jeremy-code's full-sized avatar

Jeremy Nguyen jeremy-code

View GitHub Profile
@jeremy-code
jeremy-code / README.md
Created August 8, 2026 04:31
eslint-plugin-import-x quick fixes for false positive warnings

Default export misidentified as named type export

// Using exported name 'DOMPurify' as identifier for default export. (import-x/no-named-as-default)
import DOMPurify from "dompurify"; // DOMPurify's exported name is a type, not the default export
import { default as DOMPurify } from "dompurify";
 jeremy@MacBookAir  /opt/homebrew/Library/Taps/homebrew/homebrew-cask/Casks   hashicorp-licenses  brew audit --cask --online consul vagrant
==> Downloading and extracting artifacts
==> Downloading https://releases.hashicorp.com/consul/2.0.2/consul_2.0.2_darwin_arm64.zip
Already downloaded: /Users/jeremy/.cache/Homebrew/downloads/8c0eecb602561f0f7ec945a61d69b247127857db7f96c92a8f6b64d9086ba1a8--consul_2.0.2_darwin_arm64.zip
==> Downloading https://releases.hashicorp.com/consul/2.0.2/consul_2.0.2_darwin_arm64.zip
Already downloaded: /Users/jeremy/.cache/Homebrew/downloads/8c0eecb602561f0f7ec945a61d69b247127857db7f96c92a8f6b64d9086ba1a8--consul_2.0.2_darwin_arm64.zip
==> Downloading and extracting artifacts
==> Downloading https://releases.hashicorp.com/vagrant/2.4.9/vagrant_2.4.9_darwin_arm64.dmg
Already downloaded: /Users/jeremy/.cache/Homebrew/downloads/5a95fce5f3d93143e56b6c3c6e79c3cd4948e9b706f89333202df41b7f60b912--vagrant_2.4.9_darwin_arm64.dmg
@jeremy-code
jeremy-code / error.log
Created July 30, 2026 04:57
octokit fetch
Error: Disallowed operation called within global scope. Asynchronous I/O (ex: fetch() or connect()), setting a timeout, and generating random values are not allowed within global scope. To fix this error, perform this operation within a handler. https://developers.cloudflare.com/workers/runtime-apis/handlers/
at #constructTimer (node-internal:internal_timers:56:15)
at new Timeout (node-internal:internal_timers:52:43)
at setInterval (node-internal:internal_timers:120:12)
at Group._startAutoCleanup (assets/router-FcHgbQWJ.js:15988:44)
at new Group (assets/router-FcHgbQWJ.js:15919:11)
at createGroups (assets/router-FcHgbQWJ.js:16591:18)
at Array.throttling (assets/router-FcHgbQWJ.js:16625:29)
at new Octokit$1 (assets/router-FcHgbQWJ.js:13689:108)
at new OctokitWithDefaults (assets/router-FcHgbQWJ.js:13633:5)
@jeremy-code
jeremy-code / README.md
Created June 21, 2026 03:28
Enabling `--require-sha` on all Homebrew casks checksum verifiable in Brewfile

Enabling --require-sha on all Homebrew casks checksum verifiable in Brewfile

You may want to set --require-sha as a default option in your Homebrew casks for extra security, either with the environment variable HOMEBREW_CASK_OPTS="--require-sha" or adding cask_args require_sha: true to your Brewfile.

The thing is, many casks do not have a SHA256 checksum since their download link is not versionable. This includes: chromium, google-chrome, logi-options+ (Ventura+), onyx, spotify. For more information, see Homebrew/homebrew-cask#147305. This will lead to this error:

...
==> Verifying checksum for '89947a18e10d5bbda8e2b5d15a60b6823353f019ea1a4b74e3d9c4f91248776e--chromium.rb'
==> Checking cask has checksum
@jeremy-code
jeremy-code / error.log
Created June 9, 2026 06:35
tanstack-radix-rsc
$ vite build
[1/5] analyze client references...
vite v8.0.16 building rsc environment for production...
✓ 16 modules transformed.
✓ built in 57ms
[2/5] analyze server references...
vite v8.0.16 building ssr environment for production...
✓ 288 modules transformed.
✓ built in 379ms
[3/5] build rsc environment...
@jeremy-code
jeremy-code / README.sh
Created June 9, 2026 03:24
Get last accessed/last modified/creation date of file with stat in macOS
TZ=UTC stat -f '%Sa' -t "%Y-%m-%dT%H:%M:%SZ" ./path/to/file.txt # last accessed
TZ=UTC stat -f '%Sm' -t "%Y-%m-%dT%H:%M:%SZ" ./path/to/file.txt # last modified
TZ=UTC stat -f '%SB' -t "%Y-%m-%dT%H:%M:%SZ" ./path/to/file.txt # created
@jeremy-code
jeremy-code / npm.svg
Created June 7, 2026 07:50
NPM logo SVG using only polygon
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

react-diff-viewer-continued colors turned into tailwind css colors. I commented out the grays so you can use your own. Might want to remove black/white too

@jeremy-code
jeremy-code / useBreakpoint.tsx
Created May 26, 2026 05:47
useBreakpoint.tsx
import { useSyncExternalStore } from "react";
type Breakpoint = "sm" | "md" | "lg" | "xl" | "2xl";
type BreakpointWithUtility = Breakpoint | `max-${Breakpoint}`;
const useBreakpoint = (breakpoint: BreakpointWithUtility) => {
const breakpointValue = window
.getComputedStyle(document.body)
.getPropertyValue(