Skip to content

Instantly share code, notes, and snippets.

@jstarcher
jstarcher / EndeavourOS-Nvidia-fixes.md
Created July 9, 2024 02:44
Stable Nvidia + Wayland on EndeavourOS (Arch) with working Suspend

This guide was created for EndeavourOs Endeavour Release which if using the Online installer, as of July 2024, will provide Plasma 6.1 and Nvidia 555 drivers. This guide shows using Grub but will work with systemd-boot as well if you follow steps for kernel params.

  1. Create file /etc/modprobe.d/nvidia.conf with the following contents
options nvidia_drm modeset=1
options nvidia_drm fbdev=1
options nvidia NVreg_EnableGpuFirmware=0
options nvidia NVreg_PreserveVideoMemoryAllocations=1 NVreg_TemporaryFilePath=/var/tmp
@heysanil
heysanil / unhide-files.sh
Created March 13, 2024 02:00
Bash script to recursively hide all files in a directory and its subdirectories
#!/bin/bash
# Function to recursively process files and folders
process_directory() {
local directory="$1"
# Loop through each item in the directory
for item in "$directory"/*; do
# Check if the item is a file
if [[ -f "$item" ]]; then
@alexaandru
alexaandru / chi.go
Created February 14, 2024 16:40
Chi-like syntactic sugar layer on top of stdlib http.ServeMux
// Chi-like syntactic sugar layer on top of stdlib http.ServeMux.
package main
import (
"net/http"
"slices"
)
type (
middleware func(http.Handler) http.Handler
@mfenniak
mfenniak / immich.nix
Last active September 20, 2024 20:58
NixOS configuration for Immich, based upon upstream docker-compose.yml
{ config, ... }:
let
immichHost = "immich.example.com"; # TODO: put your immich domain name here
immichRoot = "/tank/immich"; # TODO: Tweak these to your desired storage locations
immichPhotos = "${immichRoot}/photos";
immichAppdataRoot = "${immichRoot}/appdata";
immichVersion = "release";
immichExternalVolume1 = "/tank/BackupData/Google Photos/[email protected]"; # TODO: if external volumes are desired

Setting up qemu VM using nix flakes

Did you know that it is rather easy to setup a VM to test your NixOs configuration?

Create simple flake:

# flake.nix
{
  inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
@kconner
kconner / macOS Internals.md
Last active October 8, 2025 16:45
macOS Internals

macOS Internals

Understand your Mac and iPhone more deeply by tracing the evolution of Mac OS X from prelease to Swift. John Siracusa delivers the details.

Starting Points

How to use this gist

You've got two main options:

@moe93
moe93 / unUpvoteReddit.js
Created March 30, 2023 04:54
Remove reddit upvotes in bulk
// A script to remove reddit upvotes in bulk
//
// _______ INSTRUCTIONS _______
// ____________________________
// Go to old reddit and navigate to "upvoted" tab then run this script in the command panel.
// Once the page refreshes, re-run script.
//
// If you feel like automating this script, have at it, I am too lazy to do it.
//
// AUTHOR : Mohammad Odeh
@IgnisDa
IgnisDa / devcontainer.sh
Last active October 1, 2025 06:28
Helix devcontainer
#!/usr/bin/env bash
set -e
remove_flag=""
if [ "$1" = "true" ]; then
remove_flag="--remove-existing-container"
fi
# Generate certificate
@matthewpi
matthewpi / README.md
Last active August 30, 2025 08:46
Nix on Fedora

NixOS on Fedora

Please note that these instructions are not offically supported or condoned by Nix and are not guaranteed to always work, but from my testing everything seems to work perfectly fine.

These steps may not be required if NixOS/nix#2374 is resolved.

SELinux

These commands are required for both Fedora Workstation and Fedora Silverblue

Karabiner layouts for symbols and navigation

Gavin Sinclair, January 2022

Introduction

I use Karabiner (configured with Gosu) to make advanced key mappings on my Apple computer. Karabiner allows you to create “layers”, perhaps simulating those on a programmable mechanical keyboard. I make good use of these layers to give me easy access (home-row or nearby) to all symbols and navigational controls, and even a numpad.

The motivation is to keep hand movement to a minimum. Decades of coding on standard keyboards has unfortunately left me with hand and wrist pain. I will soon enough own a small split keyboard which will force me to use layers to access symbols etc., so this Karabiner solution, which has evolved over months, is a training run for that.