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 / tsconfig.json
Created April 20, 2024 23:32
TSConfig Cheat Sheet with Comments
{
"compilerOptions": {
/* Visit https://aka.ms/tsconfig.json to read more about this file */
/* Projects */
"target": "ES2022",
"lib": ["ES2022", "DOM", "DOM.Iterable"],
"moduleDetection": "force",
/* Modules */
@jeremy-code
jeremy-code / _Importexport Raycast preferences with GIt history.md
Last active March 13, 2025 04:05
Import/export Raycast preferences with GIt history

Raycast has a feature to import/export preferences in a .rayconfig file format. This isn't ideal for use in a dotfiles-esque Git repository since it would be difficult to compare changes with a compressed file. Also, unfortunately, syncing is only possible on a pro subscription and only through Raycast's cloud service.

To get a more useful JSON file from the .rayconfig (example shown in example.rayconfig.json), you will have to first have to export a decrypted version. Go to Settings > Extensions > Raycast > Export Settings & Data and under "Export Password," which by default is 12345678, you will want to delete that.

After that, run the "Export Settings & Data" command. You should be able to export all of the preferences (Settings, Extensions, Floating Notes, Script Directories, Snippets) except Quicklinks without setting a password.

Then, in terminal, run gzip --decompress --keep --suffix .rayconfig NAME_OF_FILE.rayconfig and you should get a JSON file similar to example.rayconfig.json.

After that,

Some brief explorations of getStaticValue() from @eslint-community/eslint-utils (or in this case, the typed version from @typescript-eslint/utils". Intending to update this later with better examples (and code) once I get more time.

@jeremy-code
jeremy-code / README.md
Last active February 14, 2025 22:38
eslint-plugin-react-refresh/next.js

I needed a place to put this and it didn't feel deserving of its own package or repo, hence here it is.

eslint-plugin-react-refresh settings for Next.js for rule "react-refresh/only-export-components" exports in Next.js.

For more information, see Next.js: Introduction > Architecture > Fast Refresh#How It Works

FYI some other exports that are not here because they shouldn't be alongside JSX are:

[
@jeremy-code
jeremy-code / config.xml
Created March 13, 2025 00:35
Folding@home IP addresses/IP ranges config file
<!--
This is the `config.xml` for a Folding@Home client that explicitly specifies the
IP addresses of the servers it is allowed to connect to. IP addresses are from
{@link https://apps.foldingathome.org/serverstats}.
-->
<!-- This config uses only IP addresses -->
<config>
<allow value="34.72.228.44"/> <!-- stxfahwork01.silicontx.com -->
<allow value="44.205.73.79"/> <!-- mskcc2.foldingathome.org -->
@jeremy-code
jeremy-code / README.md
Created March 25, 2025 05:49
GnuPG Permissions Configuration

GnuPG Permissions Configuration

TL;DR

If you only care about getting rid of the warning:

# Use root to make the user the owner of the GPG homedir and the GPG config file
sudo chown $USER ~/.gnupg ~/.gnupg/gpg.conf

# Set directory to allow the user to read, write and search (execute)
@jeremy-code
jeremy-code / README.md
Created April 2, 2025 18:04
Docker Compose Configs Permissions

TL;DR: I think config files by default are root:root (UID 0, GID 0) and user and group readable (0440)

Here's the Docker documentation: Services top-level elements > Attributes > configs. Of note is:

uid and gid: The numeric uid or gid that owns the mounted config file within the service's task containers. Default value when not specified is USER.

mode: The permissions for the file that is mounted within the service's task containers, in octal notation. Default value is world-readable (0444). Writable bit must be ignored. The executable bit can be set.

In Configs top-level elements, it is stated

@jeremy-code
jeremy-code / README.md
Created April 4, 2025 23:53
ZSH path setting
@jeremy-code
jeremy-code / README.md
Created April 11, 2025 21:35
Watch output of `defaults read`

I'm experimenting with matching changes made in the System Settings app with the output of defaults read, and I made this quick script for help with that.

It's not perfect -- namely, defaults read outputs in OpenStep format which is very much not machine parseable, but the alternative is using defaults export which requires you to list a domain, which would be much more complicated (though not impossible using defaults domains).

You will probably need to add more or less ignored_lines depending on what apps you use.

@jeremy-code
jeremy-code / README.md
Last active April 13, 2025 03:50
macOS `spctl` Hidden Commands

Per spctl's man page (x-man-page://spctl), it recognizes a few commands for a main operation:

spctl --assess [-t type] [-] file ...
spctl --global-enable
spctl --global-disable
spctl --disable-status
spctl --status