Skip to content

Instantly share code, notes, and snippets.

@z3tt
z3tt / basic-gauge-ggplot.R
Created July 23, 2025 15:30
A basic gauge chart made with ggplot2 + coord_radial()
library(ggplot2)
value <- 7.3
ggplot() +
# Add gap to bottom
coord_radial(
start = 4/3 * pi, # 240°
end = 2/3 * pi, # 120°
expand = FALSE
@ramnes
ramnes / center_window.py
Created February 5, 2021 22:16
Qtile hook to center all floating windows, until more sensible defaults or a better solution are available
@hook.subscribe.float_change
def center_window():
client = qtile.current_window
if not client.floating:
return
screen_rect = qtile.current_screen.get_rect()
center_x = screen_rect.x + screen_rect.width / 2
center_y = screen_rect.y + screen_rect.height / 2
@ityonemo
ityonemo / test.md
Last active December 8, 2025 03:51
Zig in 30 minutes

A half-hour to learn Zig

This is inspired by https://fasterthanli.me/blog/2020/a-half-hour-to-learn-rust/

Basics

the command zig run my_code.zig will compile and immediately run your Zig program. Each of these cells contains a zig program that you can try to run (some of them contain compile-time errors that you can comment out to play with)

@mcattarinussi
mcattarinussi / gpg-ssh-setup.md
Last active December 8, 2025 21:47
A setup guide to use a personal gpg key for ssh authentication

GPG - SSH setup

Generating the master key

Here we create the master key. We want only Certify capability: we use the master key only to create the subkeys, Sign - Encrypt - Authenticate capabilities will be assigned to the subkeys.

Run the following command to start the master key generation process. Select the set your own capabilities creation process (type 8)

  ▶ gpg --full-generate-key --expert

gpg (GnuPG) 2.2.9; Copyright (C) 2018 Free Software Foundation, Inc.

@Tras2
Tras2 / cloudflare-ddns-update.sh
Last active November 27, 2025 13:33
A bash script to update a Cloudflare DNS A record with the external IP of the source machine
#!/bin/bash
# A bash script to update a Cloudflare DNS A record with the external IP of the source machine
# Used to provide DDNS service for my home
# Needs the DNS record pre-creating on Cloudflare
# Proxy - uncomment and provide details if using a proxy
#export https_proxy=http://<proxyuser>:<proxypassword>@<proxyip>:<proxyport>
# Cloudflare zone is the zone which holds the record

Jelly Beans Terminal Color Theme

https://ptpb.pw/qUwt.png

Terminal Colors

@lnattrass
lnattrass / get_tds_cert.py
Last active September 24, 2025 15:39
A terrible way to connect to MS SQL Server and dump the certificate as a PEM
import sys
import pprint
import struct
import socket
import ssl
from time import sleep
# Standard "HELLO" message for TDS
prelogin_msg = bytearray([ 0x12, 0x01, 0x00, 0x2f, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x06, 0x01, 0x00, 0x20,
0x00, 0x01, 0x02, 0x00, 0x21, 0x00, 0x01, 0x03, 0x00, 0x22, 0x00, 0x04, 0x04, 0x00, 0x26, 0x00,