Skip to content

Instantly share code, notes, and snippets.

View svandragt's full-sized avatar
💪
+11 −272,086

Sander van Dragt svandragt

💪
+11 −272,086
View GitHub Profile
@svandragt
svandragt / check_busy.md
Last active November 26, 2025 09:35
Google Calendar - Busy or free

Google Calendar Busy Check

A small Python script that reports your current availability from Google Calendar, using uv inline dependencies.

It outputs:

  • Busy until HH:MM — you are currently in a meeting that counts as busy.
  • Free until HH:MM — you are not busy, and the next busy meeting starts at that time.
  • Free — no busy meetings ahead in the look-ahead window.
@svandragt
svandragt / generate-datasource.sh
Created November 18, 2025 12:03
Generate a JetBrains .idea/dataSources.xml file from the output of Altis local server
#!/bin/bash
# Capture the output of the command
OUTPUT=$(composer server db info)
# Extracting the necessary values using grep and awk
DB_NAME=$(echo "$OUTPUT" | grep "Database:" | awk '{print $2}')
DB_USER=$(echo "$OUTPUT" | grep "User:" | awk '{print $2}')
DB_PASSWORD=$(echo "$OUTPUT" | grep "Password:" | awk '{print $2}')
DB_HOST=$(echo "$OUTPUT" | grep "Host:" | awk '{print $2}')
@svandragt
svandragt / tabtime.html
Created August 25, 2025 09:21
TabTime
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Time</title>
<style>
body {
font-family: sans-serif;
display: flex;
justify-content: center;
<?php
const REST_NAMESPACE = 'test/v1';
add_action( 'rest_api_init', function () {
register_rest_route( REST_NAMESPACE, '/test', [
'methods' => 'GET',
'callback' => 'handle_rest_test',
'permission_callback' => '__return_true',
] );
@svandragt
svandragt / userChrome.css
Created May 22, 2025 14:12
Firefox userChrome optimised for the compact connaisseur
/* Make it easier to find active tab */
.tab-background {
&:is([selected], [multiselected]) {
border-top: 1px solid #444 !important;
}
}
/* Thinner pins, even in compact */
.tab-content {
padding: 0 4px !important;
@svandragt
svandragt / github-viewer.py
Last active May 6, 2025 16:03
Open pull request viewer
#!/usr/bin/env python
# /// script
# requires-python = ">=3.10"
# dependencies = [
# "pyperclip",
# "requests",
# ]
# ///
import os
import json
@svandragt
svandragt / open-links.py
Last active June 2, 2025 15:31
Open text links in browser tabs
@svandragt
svandragt / jira-ticket.py
Created April 23, 2025 12:56
JIRA Ticket Checker Script
# /// script
# requires-python = ">=3.10"
# dependencies = [
# "pyperclip",
# "requests",
# ]
# ///
import os
import requests
import subprocess
@svandragt
svandragt / devbox.json
Last active April 14, 2025 15:41
DevBox bootstrap for Godot compilation
{
"$schema": "https://raw.githubusercontent.com/jetify-com/devbox/0.14.1/.schema/devbox.schema.json",
"env": {
"SCRIPT_AES256_ENCRYPTION_KEY": "<your encryption key here>"
},
"packages": [
"uv@latest",
"python@3.13"
],
"shell": {
@svandragt
svandragt / git-cai.sh
Created February 16, 2025 21:08
Git Commit AI logs
#!/usr/bin/env bash
# filename: ~/bin/git-cai
# example: git cai
#
# Copies an AI-generated summary of a commit to the clipboard before opening the commit dialog.
# Requires commitmsg and copy aliases
# uvx llm keys set gemini
# Detect the OS type
if [[ "$OSTYPE" == "darwin"* ]]; then