Skip to content

Instantly share code, notes, and snippets.

@Moraxyc
Moraxyc / pinching-five-fingers-niri-overview.py
Created June 2, 2025 05:49
Pinching with five fingers to activate Niri Overview
import json
import logging
import os
import signal
import socket
import sys
import time
from select import select
from evdev import InputDevice, ecodes, list_devices
@dramforever
dramforever / nixenv.zsh
Last active March 14, 2024 17:45
nixenv
declare -A nixenv_paths
nadd() {
setopt local_options err_return pipefail
local out out_paths
for installable in "$@"; do
local with_outputs="$installable^*"
if [[ "$installable" = *"^"* ]]; then
with_outputs="$installable"
fi
@datakurre
datakurre / minecraft-bedrock-server.nix
Last active August 21, 2024 03:50
Minecraft Bedrock Server NixOS module
{ config, lib, pkgs, ... }:
let
libCrypto = with pkgs; stdenv.mkDerivation rec {
name = "${pname}-${version}";
pname = "minecraft-bedrock-server-libcrypto";
version = "1.16-201.02";
src = fetchurl {
url = "https://minecraft.azureedge.net/bin-linux/bedrock-server-1.16.201.02.zip";
@danbst
danbst / README.adoc
Created September 5, 2019 20:14
Pure Nix Minecraft launcher. For every MC version!

Pure Nix Minecraft launchers

  1. Download .nix file

  2. Run:

    $ nix run -f all-minecrafts.nix versions.v1_8_9.client -c minecraft
  3. Enjoy (…​power of fixed-output derivations)!

@CMCDragonkai
CMCDragonkai / nix_inputs.md
Last active May 26, 2025 05:48
Understanding Nix Inputs #nix

Understanding Nix Inputs

Every Nix derivation produces a Nix store output that has 3 things:

  • Executables
  • Libraries
  • Data

Executables are always exported using the PATH environment variable. This is pretty much automatic.

@schonfinkel
schonfinkel / Setup.md
Last active March 2, 2024 16:58
Spacemacs config for Proof General

Tutorial

This is a Spacemacs config, I only use it for Coq + Proof General.

Instalation

  • Make sure you have Emacs & Coq installed
  • Install Proof General
cd ~/.emacs.d/private/local
@zedongh
zedongh / .zshrc
Last active April 25, 2019 08:03
zsh config
source $HOME/antigen.zsh
antigen use oh-my-zsh
antigen bundles <<EOF
npm
node
docker
cabal
pyenv
@KillyMXI
KillyMXI / graphemeCountExample.hs
Last active April 16, 2020 07:41
Haskell grapheme cluster examples
import Data.Text.ICU
import qualified Data.Text as T
graphemeClustersCount :: LocaleName -> T.Text -> Int
graphemeClustersCount loc = length . breaks (breakCharacter loc)
testStr = "😀éé"
main :: IO ()
main = print $ graphemeClustersCount Current $ T.pack $ testStr
@joshschmelzle
joshschmelzle / remap-capslock-to-control-win10.md
Last active May 30, 2025 19:28
Remap Caps Lock to Control on Windows 10

Ways to remap caps lock to control on Windows 10

These methods in this gist worked for me on my U.S.-based keyboard layouts. I am unsure about other layouts. If you have problems, revert your changes; delete the registry key you created (and reboot).

Update: you should probably scroll down to approach 4 where I suggest using Microsoft PowerToys Keyboard Manager.

Approach 1. Manually through regedit

Navigate to and create a new binary value in HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout named Scancode Map.

@paulirish
paulirish / what-forces-layout.md
Last active June 5, 2025 13:25
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent