Skip to content

Instantly share code, notes, and snippets.

View m-rey's full-sized avatar
🏳️‍⚧️
Hack the planet!

Mæve Rey m-rey

🏳️‍⚧️
Hack the planet!
  • Nuremberg, Germany
View GitHub Profile
@frozolotl
frozolotl / banger-config.json
Last active December 8, 2023 11:18
My Banger configuration for Kagi
{
"luckyBangUrl": "https://kagi.com/search?q=!+%q",
"siteFormat": "site:%d",
"orOperator": "OR",
"bangPrefix": "!",
"luckyBang": "!",
"siteBangSep": "@",
"superLuckyBangPrefix": "!!",
"multiBangDelim": ";",
"multiSiteBangDelim": ",",
@HaleTom
HaleTom / aria2-trackers-update
Last active June 22, 2024 08:17
Update aria2.conf with 20 "best" BitTorrent trackers
#!/bin/bash
# Update the bt-tracker= line in aria2.conf
# Any bt-tracker= lines are removed and and a new one added at the bottom of the file
# Updates at: https://gist.github.com/HaleTom/fe873dc2f3c5bd14f7418efefc2b91a8
# Inspiration: https://github.com/wuyuansushen/aria2c_TrackersList
set -euo pipefail
shopt -s failglob
@raxityo
raxityo / DrawSparkline.js
Last active July 10, 2023 14:54
Draw Sparkline chart, converted by ChatGPT from https://alexplescan.com/posts/2023/07/08/easy-svg-sparklines/
// Define the default fill and stroke colors
const defaultFill = "#dcfce7";
const defaultStroke = "#bbf7d0";
// Define the stroke width
const strokeWidth = 4;
/**
* Draws a sparkline SVG based on the given width, height and points
* @param {number} width - The width of the SVG element
#include <stdio.h>
#include <stdint.h>
// Philips Sonicare NFC Head Password calculation by @atc1441 Video manual: https://www.youtube.com/watch?v=EPytrn8i8sc
uint16_t CRC16(uint16_t crc, uint8_t *buffer, int len) // Default CRC16 Algo
{
while(len--)
{
crc ^= *buffer++ << 8;
int bits = 0;
do
@yzdbg
yzdbg / auto-dr.md
Last active November 3, 2023 17:11

Automating Daily Reports, because fuck it, really...

Each day at our company, developers are required to document their activities, painstakingly jotting down their daily work and future plans. A monotonous chore that I just really dislike.

So now, there's a scribe for that :

auto-dr-

Code

@hyperupcall
hyperupcall / settings.jsonc
Last active June 26, 2024 18:59
VSCode config to disable popular extensions' annoyances (telemetry, notifications, welcome pages, etc.)
// I'm tired of extensions that automatically:
// - show welcome pages / walkthroughs
// - show release notes
// - send telemetry
// - recommend things
//
// This disables all of that stuff.
// If you have more config, leave a comment so I can add it!!
{
@andre-st
andre-st / backup-reinstall.sh
Last active January 13, 2024 16:44
Script creates udev and systemd configuration files for my auto-starting backup system. Beware: backup program is missing here!
#!/usr/bin/env bash
##############################################################################
#
# Manual configuration:
#
readonly IS_TEST=false
readonly CRYPTNAME=cryptback
readonly SOURCE_DIR=/mnt/data
readonly BACKUP_DIR=/mnt/backup
@solarkraft
solarkraft / syncthing-automerge.py
Created December 30, 2022 18:00
Monitors a Syncthing-synced directory and tries to merge conflicting files (based on https://www.rafa.ee/articles/resolve-syncthing-conflicts-using-three-way-merge/). Probably adaptable for other directory types, but only tested with Logseq (works for me™️).
import os
import time
import re
import subprocess
from watchdog.observers import Observer
from watchdog.events import FileSystemEventHandler
def get_relative_path(path):
return os.path.relpath(path)
@Gaelan
Gaelan / README.md
Last active August 29, 2023 04:13
ChatGPT passes the 2022 APCSA free response section

ChatGPT passes the 2022 AP Computer Science A free response section

For fun, I had ChatGPT take the free response section of the 2022 AP Computer Science A exam. (The exam also has a multiple-choice section, but the College Board doesn't publish this.) It scored 32/36.

Methodology

  • For each question, I pasted in the full text of the question and took the response given.
  • I tried each question once and took the response given: no cherry-picking. For readability, I've added indentation in some cases, and included method signatures where they were provided in the question and ChatGPT only provided a body. I've added question numbers; any other comments are ChatGPT's.
  • Many questions have examples containing tables or diagrams; because those don't translate well to plain text, I excluded those tables/diagrams and any text that referenced them.
  • I excluded the initial instructions at the top of th