Skip to content

Instantly share code, notes, and snippets.

View Tom5521's full-sized avatar
💭
Writing an interpreter in Go

Tom Tom5521

💭
Writing an interpreter in Go
View GitHub Profile
@Kvn0l
Kvn0l / config.json
Last active July 30, 2025 06:17
SwayNC config
{
"$schema": "/etc/xdg/swaync/configSchema.json",
"positionX": "right",
"positionY": "top",
"control-center-margin-top": 2,
"control-center-margin-bottom": 2,
"control-center-margin-right": 1,
"control-center-margin-left": 0,
"notification-icon-size": 48,
"notification-body-image-height": 160,
@pojntfx
pojntfx / main.sh
Last active August 31, 2025 10:56
Cross-compile and package GTK4/libadwaita apps for Windows from Linux with MSYS2 and WINE
#!/bin/bash
# Install native dependencies
sudo dnf update -y
sudo dnf install -y curl wine
# Install MSYS2
curl -L -o /tmp/msys2.exe 'https://github.com/msys2/msys2-installer/releases/download/2021-11-30/msys2-base-x86_64-20211130.sfx.exe'
wine64 /tmp/msys2.exe x -y -oC:/
@sar
sar / nix-ui.md
Created June 12, 2021 00:40 — forked from edolstra/nix-ui.md
Nix UI

General notes

  • nix-channel and ~/.nix-defexpr are gone. We'll use $NIX_PATH (or user environment specific overrides configured via nix set-path) to look up packages. Since $NIX_PATH supports URLs nowadays, this removes the need for channels: you can just set $NIX_PATH to e.g. https://nixos.org/channels/nixos-15.09/nixexprs.tar.xz and stay up to date automatically.

  • By default, packages are selected by attribute name, rather than the name attribute. Thus nix install hello is basically equivalent to nix-env -iA hello. The attribute name is recorded in the user environment manifest and used in upgrades. Thus (at least by default) hello won't be upgraded to helloVariant.

    @vcunat suggested making this an arbitrary Nix expression rather than an attrpath, e.g. firefox.override { enableFoo = true; }. However, such an expression would not have a key in the user environment, unlike an attrpath. Better to require an explicit flag for this.

TBD: How to deal with search path clashes.

@maratori
maratori / .golangci.yml
Last active December 29, 2025 10:16
Golden config for golangci-lint
# ==================================================================================================
#
# NOTICE
#
# This gist is no longer maintained. It was moved to repo:
#
# https://github.com/maratori/golangci-lint-config
#
# Full history and all v2 releases are preserved in the repo.
#
@probonopd
probonopd / Wayland.md
Last active January 2, 2026 19:13
Think twice about Wayland. It breaks everything!

Think twice before abandoning X11. Wayland breaks everything!

tl;dr: Wayland is not "the future", it is merely an incompatible alternative to the established standard with a different set of priorities and goals.

Wayland breaks everything! It is binary incompatible, provides no clear transition path with 1:1 replacements for everything in X11, and is even philosophically incompatible with X11. Hence, if you are interested in existing applications to "just work" without the need for adjustments, then you may be better off avoiding Wayland.

Wayland solves no issues I have but breaks almost everything I need. Even the most basic, most simple things (like xkill) - in this case with no obvious replacement. And usually it stays broken, because the Wayland folks mostly seem to care about Automotive, Gnome, maybe KDE - and alienating e

@jerblack
jerblack / Elevate when needed in Go.md
Last active September 19, 2025 03:39
Relaunch Windows Golang program with UAC elevation when admin rights needed.

I'm buiding a command line tool in Go that has an option to install itself as a service on Windows, which it needs admin rights for. I wanted to be able to have it reliably detect if it was running as admin already and if not, relaunch itself as admin. When the user runs the tool with the specific switch to trigger this functionality (-install or -uninstall in my case) they are prompted by UAC (User Account Control) to run the program as admin, which allows the tool to relaunch itself with the necessary rights.

To detect if I was admin, I tried the method described here first:
https://coolaj86.com/articles/golang-and-windows-and-admins-oh-my/
This wasn't accurately detecting that I was elevated, and was reporting that I was not elevated even when running the tool in CMD prompt started with "Run as Administrator" so I needed a more reliable method.

I didn't want to try writing to an Admin protected area of the filesystem or registry because Windows has the ability to transparently virtualize those writes

@gustawho
gustawho / arch-linux-instalacion.md
Last active February 24, 2025 18:14
Guía de Instalación de Arch Linux

Guía de Instalación de Arch Linux

El objetivo de este documento es orientar a quien sea que tenga la intención de instalar Arch Linux, por los motivos que sean. Aunque se tienen como prioridad a los nuevos usuarios, se espera que sea de utilidad a cualquiera persona, sin importar su nivel de experiencia. Aunque se ha realizado con las mejores intenciones, los errores y desinformaciones no siempre pueden evitarse. Una disculpa adelantada si esto provoca cualquier inconveniente, ¡las correcciones y recomendaciones son bienvenidas!

La estructura y el flujo de esta guía son de tal forma que, según el autor, proveen una serie de instrucciones naturales para que el resultado final de la instalación y configuración de Arch Linux sea equiparable a lo análogo de cualquier otra distribución o sistema operativo. Al principio de cada sección se ofrecen enlaces a la Wiki y a otros sitios (📌) y, aunque no necesariamente se tratarán de referencias, en la mayoría de los casos dichas entradas ofrecen soporte y una mayor p

@rb-dahlb
rb-dahlb / opengl-fix-hd-graphics-windows-10.md
Last active December 26, 2025 20:12
OpenGL fix for Intel HD Graphics 3000 on Windows 10

Fix for Open GL on Intel HD Graphics 3000 - Windows 10

The drivers for Intel HD Graphics 3000 in Windows 10 does not expose all Open GL capabilities of the GPU. So software relying on Open GL features not present in Open GL 1.1 will not work. Using older versions of Windows or Linux might work since the chip have more features than the driver exposes.

The fix is to add a compatibility shim using the Windows ADK software.

1. Download and install Windows ADK

Link: https://docs.microsoft.com/en-us/windows-hardware/get-started/adk-install

@jarun
jarun / Termux_from_Ubuntu.md
Last active March 7, 2025 02:04
How to connect to Termux from Ubuntu desktop

In this example, we will setup a SSH server on Termux (for Android) and connect to the server from Ubuntu desktop. However, a similar procedure should work with any SSH server.

  1. Generate your ssh key pair on your desktop

    $ ssh-keygen
    
  2. Check your desktop IP address (say, 192.168.0.100)

  3. Run ssh server on your desktop

  4. Copy the file to Termux over SCP

$ scp arun@192.168.0.100:~/.ssh/id_rsa.pub ~/.ssh/authorized_keys

@nictuku
nictuku / gist:c9858a4fe2c7b92a01da2e635b7c147c
Created July 3, 2018 23:56
All valid GOOS and GOARCH values
$ go tool dist list
android/386
android/amd64
android/arm
android/arm64
darwin/386
darwin/amd64
darwin/arm
darwin/arm64
dragonfly/amd64