Skip to content

Instantly share code, notes, and snippets.

View wlinds's full-sized avatar
🍍

Akilles William Lindstedt wlinds

🍍
View GitHub Profile
@wlinds
wlinds / discord-channel-download.js
Created February 27, 2026 14:11
Download all files in a Discord channel
(async () => {
const allDownloadAs = document.querySelectorAll('a[aria-label="Download"][role="button"]');
for (const a of allDownloadAs) {
const cloneA = a.cloneNode(true);
document.body.appendChild(cloneA);
cloneA.click();
document.body.removeChild(cloneA);
await new Promise(r => setTimeout(r, 800));
}
})();
@wlinds
wlinds / soundcloud_watcher.py
Last active February 7, 2026 19:55
SoundCloud Watcher for OpenClaw - Track your SoundCloud account
#!/usr/bin/env python3
"""
SoundCloud Watcher - cron script for tracking your SoundCloud account
and getting notified about new releases from artists you care about.
Features:
- Follower change detection (new/lost followers by name)
- Track engagement tracking (who liked, repost counts)
- New release detection from a curated artist list
- Dormant artist throttling (skip inactive artists to save API calls)
@wlinds
wlinds / gbq_pg.py
Created December 19, 2025 09:03
CLI Util: GBQ / PostgreSQL | CLI tool for transferring data between Google BigQuery and PostgreSQL
"""
GBQ-Utils: CLI tool for transferring data between Google BigQuery and PostgreSQL
REQ:
pip install pandas pandas-gbq psycopg2-binary python-dotenv google-cloud-bigquery sqlalchemy
CONFIG:
1. database.ini - PostgreSQL connection settings (host, port, user, sslmode)
2. .env file - DB_PASSWORD and DB_NAME (defaults to 'default_pool')
3. Google Cloud credentials - Uses default application credentials (gcloud auth)
@wlinds
wlinds / csv_to_postgres.py
Created March 20, 2025 12:30
Script to import data from csv to postgres
# Config:
#
# database.ini:
# [postgresql]
# host = your_host
# port = your_port
# user = your_username
#
# .env file:
# DB_PASSWORD=your_password
@wlinds
wlinds / openapi_to_excel.py
Created February 4, 2025 15:27
openapi_to_excel.py
import json
import requests
import pandas as pd
def openapi_to_excel(url, output_file):
response = requests.get(url)
spec = response.json()
first_path = next(iter(spec['paths']))
print(f"Example path structure for {first_path}:")
@wlinds
wlinds / clean_it.py
Created September 2, 2024 21:29
Python CLI tool to remove files based on file extension
import os, fnmatch, argparse
def clean_it(root_dir, file_extension):
"""
Walks through all subdirs of the given directory and deletes files with the specified extension.
Also removes any empty directories left after the file deletion.
:param root_dir: The root directory to start the search from.
:param file_extension: The file extension to look for and delete.
"""
@wlinds
wlinds / move_vital_preset.sh
Created August 27, 2024 22:26
fswatch: Change default Vital user preset folder (macOS)
#!/bin/bash
# Silly workaround for keeping user preset folder on top in Vital library.
DEST_DIR="$HOME/Library/Mobile Documents/com~apple~CloudDocs/Audio/Vital/_User/Presets"
SOURCE_DIR="$HOME/Library/Mobile Documents/com~apple~CloudDocs/Audio/Vital/User/Presets"
fswatch -0 "$SOURCE_DIR" | while read -d "" event; do
if [[ "$event" == *.vital ]]; then
mv "$event" "$DEST_DIR/"
echo "Moved $event to $DEST_DIR"
@wlinds
wlinds / triss.py
Created August 14, 2024 19:08
AB Svenska Spel - Triss Lottery Probability (Spoiler: You don't win)
import numpy as np
# https://www.svenskaspel.se/triss/spelguide/triss-30
prizes = np.array([
(1, 2765000),
(4, 300000),
(6, 265000),
(2, 100000),
(3, 50000),
(8, 20000),
@wlinds
wlinds / stylesheet.css
Created July 3, 2024 13:52
Boilerplate CSS - Light Mode
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Helvetica', sans-serif;
}
@wlinds
wlinds / timestamp.py
Created July 2, 2024 21:27
Easy timestamp creation
import os, keyboard, time, json, threading
def format(elapsed):
ms = int((elapsed * 1000) % 1000)
seconds = int(elapsed % 60)
minutes = int((elapsed // 60) % 60)
hours = int((elapsed // 3600) % 24)
return f"{hours:02}:{minutes:02}:{seconds:02}.{ms:03}"
def record():