Skip to content

Instantly share code, notes, and snippets.

View DavidArsene's full-sized avatar

DavidArsene

  • Bucharest
  • 03:43 (UTC +03:00)
View GitHub Profile
@DavidArsene
DavidArsene / nixpkgs-filter.user.js
Created April 29, 2026 08:19
nixpkgs filter userscript
// ==UserScript==
// @name nixpkgs filter
// @version 2026-03-24
// @description make commit history readable
// @author DavidArsene
// @match https://github.com/NixOS/nixpkgs/commits/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=github.com
// @grant none
// @run-at document-idle
// ==/UserScript==
@DavidArsene
DavidArsene / uninit.kt
Created March 11, 2026 13:54
Set a Kotlin `lateinit var` back to null ;)
(object {
private lateinit var demo: String
fun something() {
demo = "test"
println(demo) // test
// Regular Java reflection, no Kotlin magic, but isn't name safe
uninit("demo") // in `this`
@DavidArsene
DavidArsene / default.nix
Last active April 28, 2026 11:25
Wrap a nixpkgs flake input to always have allowUnfree enabled.
#? Redirect to our flake.nix
import (builtins.getFlake "nixpkgs")
@DavidArsene
DavidArsene / fetch-kconfig-sparse.sh
Created February 21, 2026 19:48
Clone the linux repo but only the files required for kconfig (make *config)
#!/usr/bin/env bash
set -euo pipefail
BRANCH="v6.19"
git clone --depth 1 --filter blob:none --no-checkout --ref-format reftable --branch $BRANCH https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git linux
git -C linux sparse-checkout set --no-cone /scripts/kconfig/ '*Kconfig*'
git -C linux checkout
@DavidArsene
DavidArsene / ublock-restore-no-malware-prot.json
Created November 28, 2025 14:18
uBlock Origin dotfile for easy sharing. No malware, phishing etc. lists as those double the filter count.
{
"timeStamp": 1764339026966,
"version": "1.67.0",
"userSettings": {
"importedLists": [],
"popupPanelSections": 31,
"suspendUntilListsAreLoaded": true
},
"selectedFilterLists": [
"user-filters",
{
CapabilityFileSharing: "https://tailscale.com/cap/file-sharing",
CapabilityAdmin: "https://tailscale.com/cap/is-admin",
CapabilityOwner: "https://tailscale.com/cap/is-owner",
// feature enabled/available
CapabilitySSH: "https://tailscale.com/cap/ssh",
// some SSH rule reach this node
CapabilitySSHRuleIn: "https://tailscale.com/cap/ssh-rule-in",
// feature enabled
@DavidArsene
DavidArsene / wplace.sh
Last active September 1, 2025 13:48
Download image tiles from Wplace. Uses wget and imagemagick.
#!/usr/bin/env bash
set -euo pipefail
# How to use:
# Look at network requests for s0/tiles, then first number is latitude, second is longitude.
[[ $# -ne 5 ]] && { echo "Usage: $0 <dir> <lat_start> <lat_end> <lon_start> <lon_end>"; exit 1; }
dir="$1"
lat_start="$2"
lat_end="$3"
@DavidArsene
DavidArsene / fastfetch-nixos-generation.sh
Last active January 5, 2026 20:20
{ "type": "command", "text": "~/.config/fastfetch/fastfetch-nixos-generation.sh", "key": "Generation" },
#!/usr/bin/env bash
pushd "/nix/var/nix/profiles" > /dev/null
function gen-to-num() {
if [[ "$1" =~ system-([0-9]+)-link ]]; then
echo "${BASH_REMATCH[1]}"
fi
}
@DavidArsene
DavidArsene / nvwsllib.ps1
Created June 18, 2025 18:44
Remove WSL libs from NVIDIA driver. Use NVCleanInstall with disable telemetry to rebuild signature
Clear-Content -Path .\Display.Driver\* -Filter "lib*" -Verbose
@DavidArsene
DavidArsene / Cleanup-EFI.ps1
Last active June 10, 2025 19:49
Remove most languages from EFI partition. TODO fonts
mountvol S: /S
Get-ChildItem S:\EFI\Microsoft\Boot -Filter '??-*' | Where-Object Name -CNE 'en-US' | Remove-Item -Recurse
mountvol S: /D