Skip to content

Instantly share code, notes, and snippets.

View wlinds's full-sized avatar
🍍

Akilles William Lindstedt wlinds

🍍
View GitHub Profile
@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 / 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 / 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 / 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 / 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 / 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));
}
})();