Skip to content

Instantly share code, notes, and snippets.

@nemolize
nemolize / workaround.md
Last active August 14, 2024 04:44
How to fix blackout issue with the wayland desktop session

Solution 1: set option in grub file

add nvidia-drm.modeset=1 to GRUB_CMDLINE_LINUX variable in /etc/default/grub

Example line:

GRUB_CMDLINE_LINUX="nvidia-drm.modeset=1"

then perform update-grub to apply the setting.

@nemolize
nemolize / starship.toml
Created August 11, 2024 16:17
starship.toml nemolize's configuration
"$schema" = 'https://starship.rs/config-schema.json'
#disabled_format = """
#$c\
#$cmake\
#$cobol\
#$crystal\
#$daml\
#$dart\
#$deno\
@nemolize
nemolize / EnablePasswordLessLogin.reg
Created August 7, 2024 02:11
Enable password less login on windows
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\PasswordLess\Device]
"DevicePasswordLessBuildVersion"=dword:00000000
const MAX_CONCURRENCY = 2;
const useTaskQueue = () => {
const triggers = useRef<Function[]>([]);
const runningTasksRef = useRef(new Set<Function>());
const dispatchTriggers = useCallback(() => {
const runningTaskSize = runningTasksRef.current.size;
if (runningTaskSize >= MAX_CONCURRENCY) return;
@nemolize
nemolize / init-mise-with-zplug.zsh
Last active May 13, 2024 02:37
Initialize `mise` with zplug example script
# Initialize `mise` with zplug example script
# https://mise.jdx.dev/
if ! type "mise" > /dev/null; then
echo "mise is not installed. Installing mise..."
curl https://mise.run | sh
fi
eval "$(~/.local/bin/mise activate zsh)"
if ! mise which usage > /dev/null 2>&1; then
echo "mise usage is not installed. Installing usage with mise..."
@nemolize
nemolize / minist-10-samples.ipynb
Created September 25, 2023 12:59
minist-10-samples.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nemolize
nemolize / minist.ipynb
Created September 25, 2023 12:45
MINIST.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nemolize
nemolize / take-nth-of-grouped-args.sh
Last active July 4, 2022 03:29
Example of arg splitting for parallel execution
#!/usr/bin/env bash
ARGS='a b c d e' # replace this with your test file paths
GROUP_SIZE=2
NTH_OF_GROUPS=2
# outputs "c d"
echo "${ARGS}" | xargs -n "${GROUP_SIZE}" echo | sed -n "${NTH_OF_GROUPS}p"
@nemolize
nemolize / homebrew-permissions-issue.md
Created March 6, 2022 17:06 — forked from irazasyed/homebrew-permissions-issue.md
Homebrew: Permissions Denied Issue Fix (OS X / macOS)

Homebrew Permissions Denied Issues Solution

sudo chown -R $(whoami) $(brew --prefix)/*

@nemolize
nemolize / grayscale.glsl
Created February 20, 2022 17:03
Gray scale window fragment GLSL shader works with Picom compositor
/* To get this shader working, Run picom like the following
picom --glx-fshader-win "$(cat ~/.config/picom/gs.glsl)"
NOTE: You need to set the backend to "glx" to get this working.
*/
uniform float opacity;
uniform bool invert_color;
uniform sampler2D tex;
void main() {