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 / example.txt
Created April 18, 2025 03:25
Encoding Error Example
Héllo 🌍
root@b52c99f486ca:/src/scripts# emcc -v -lembind --emit-tsd ../output/test.d.ts ../module/test.cpp -sVERBOSE=1
/emsdk/upstream/bin/clang -target wasm32-unknown-emscripten -fignore-exceptions -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr --sysroot=/emsdk/upstream/emscripten/cache/sysroot -DEMSCRIPTEN -Xclang -iwithsysroot/include/fakesdl -Xclang -iwithsysroot/include/compat -v -c ../module/test.cpp -o /tmp/emscripten_temp_g66u0n1f/test_0.o
clang version 21.0.0git (https:/github.com/llvm/llvm-project 553da9634dc4bae215e6c850d2de3186d09f9da5)
Target: wasm32-unknown-emscripten
Thread model: posix
InstalledDir: /emsdk/upstream/bin
(in-process)
"/emsdk/upstream/bin/clang-21" -cc1 -triple wasm32-unknown-emscripten -emit-obj -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name test.cpp -mrelocation-model static -mframe-pointer=none -ffp-contract=on -fno-rounding-math -mconstructor-aliases -target-cpu generic -fvisibili
@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
@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
Created April 4, 2025 23:53
ZSH path setting
@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 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 / 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
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:

[

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.