Skip to content

Instantly share code, notes, and snippets.

View disouzam's full-sized avatar
🚲
Working on pycalphad and mutation testing in my free time, mostly

Dickson Souza disouzam

🚲
Working on pycalphad and mutation testing in my free time, mostly
View GitHub Profile
@disouzam
disouzam / quickxor.py
Created August 14, 2026 14:06 — forked from randomaccess3/quickxor.py
A vibe coded version of Microsoft's QuickXOR hash example code
# https://learn.microsoft.com/en-us/onedrive/developer/code-snippets/quickxorhash?view=odsp-graph-online
# Usage: python C:\tools\quickxor.py -f file --base64
# This will present the hash of the file as you would see it in the OneDrive databases.
import argparse
import base64
MASK64 = 0xFFFFFFFFFFFFFFFF
class QuickXorHash:
@disouzam
disouzam / prepare-commit-msg
Last active July 21, 2026 12:22
Prepare commit message - Hook
#!/bin/sh
# Source - https://stackoverflow.com/a/68879891
# Posted by CarloDePieri, modified by community. See post 'Timeline' for change history
# Retrieved 2026-07-19, License - CC BY-SA 4.0
echo -e "\nRunning prepare-commit-msg hook..."
echo "First parameter: $1"
echo "Second parameter: $2"
echo "Third parameter: $3"
@disouzam
disouzam / better-todo-tree.vscode.json
Last active July 14, 2026 11:28
Better Todo Tree VS Code extension settings
{
"better-todo-tree.general.tags": [
"BUG",
"HACK",
"FIXME",
"TODO",
"XXX",
"[ ]",
"[x]",
"noqa"
@disouzam
disouzam / git_cmd.sh
Created June 29, 2026 11:55
Get markdown summary of merge commits
#!/bin/bash
function gitmd() {
local ref="${1:-HEAD}"
local outfile="$2"
# Colors (terminal only)
local BOLD="\033[1m"
local RESET="\033[0m"
local CYAN="\033[36m"
@disouzam
disouzam / check_status_periodically.sh
Created June 28, 2026 16:15
Scripts to run and monitor Cosmic Ray execution (being built for pycalphad)
#!/bin/bash
# This script checks the status of mutation testing at a configurable interval (default: 90 seconds).
interval_seconds="${1:-90}"
if ! [[ "$interval_seconds" =~ ^[0-9]+$ ]] || [[ "$interval_seconds" -le 0 ]]; then
echo "Usage: $0 [interval_seconds]"
exit 1
fi
prev_complete=""
@disouzam
disouzam / Microsoft.PowerShell_profile.ps1
Last active June 12, 2026 15:05
PowerShell profile and functions
# https://lazyadmin.nl/powershell/powershell-profile/
# Set Default location
Set-Location C:\
function Install-Python-Dependencies {
# https://www.w3tutorials.net/blog/utf8-script-in-powershell-outputs-incorrect-characters/
# Set output encoding to UTF-8
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
# Set input encoding to UTF-8 (for reading user input with non-ASCII chars)
@disouzam
disouzam / wsl-setup.ps1
Last active August 17, 2026 11:28
WSL Setup script snippets
# Step 1 - List all valid distributions that can be installed using WSL.
wsl --list --online
# NAME FRIENDLY NAME
# AlmaLinux-8 AlmaLinux OS 8
# AlmaLinux-9 AlmaLinux OS 9
# AlmaLinux-Kitten-10 AlmaLinux OS Kitten 10
# AlmaLinux-10 AlmaLinux OS 10
# Debian Debian GNU/Linux
# FedoraLinux-43 Fedora Linux 43
# FedoraLinux-42 Fedora Linux 42
@disouzam
disouzam / Unblock-Files.ps1
Created April 5, 2026 23:25
Unblock File Preview in Windows Explorer
# https://learn.microsoft.com/en-us/answers/questions/5682431/how-to-make-the-previewer-work-again
Get-ChildItem . -Recurse | Unblock-File
@disouzam
disouzam / HaltonSequencer.cs
Created March 2, 2026 01:42 — forked from michael-sacco/HaltonSequencer.cs
A demonstration of Halton Sequencing Quasirandom Noise
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
// Note that the Halton bases must consist of coprime integers.
// Learn more about the Halton sequence: https://en.wikipedia.org/wiki/Halton_sequence
// Learn more about low discrepancy sequences: https://en.wikipedia.org/wiki/Low-discrepancy_sequence
// Learn more about coprime numbers: https://en.wikipedia.org/wiki/Coprime_integers
@disouzam
disouzam / microgpt.py
Created March 1, 2026 21:35 — forked from karpathy/microgpt.py
microgpt
"""
The most atomic way to train and run inference for a GPT in pure, dependency-free Python.
This file is the complete algorithm.
Everything else is just efficiency.
@karpathy
"""
import os # os.path.exists
import math # math.log, math.exp