Skip to content

Instantly share code, notes, and snippets.

@luizen
luizen / click-all-load-more-buttons.js
Last active June 7, 2025 22:06
Click "Load More" button until no more items are available
const sleepNow = (delay) => new Promise((resolve) => setTimeout(resolve, delay));
async function repeatedLoadMore() {
for (let i = 1; i <= 50; i++) {
await sleepNow(5000);
console.log(`Iteration ${i}: Attempting to click the load more button...`);
var button = document.querySelector('a[data-testid=load-more-button]');
if (button) {
console.log("Button found, clicking it.");
button.click();
@luizen
luizen / beatport-playlist-extractor.md
Created May 14, 2025 15:51
Beatport playlist extractor

Beatport Playlist Extractor

Execute this in the browser console while visiting a playlist page like https://www.beatport.com/genre/techno-raw-deep-hypnotic/92/top-100

// Find all .container elements
const containers = document.querySelectorAll('.container');

// Collect details (song, artist, and additional info) from each container
const details = Array.from(containers).map(container => {

AIFF to MP3

This is an iTerm2 snippet that uses ffmpeg to convert all AIFF files in a given folder to their corresponding MP3s

Dependencies

  • ffmpeg

Config

@luizen
luizen / docker-cleanup.ps1
Created May 14, 2025 15:35
A collection of utility scripts for Docker on Windows
Write-Output "-------------------"
Try
{
Write-Output "--> Stopping all containers..."
docker stop $(docker ps -a -q) 2>&1 | out-null
Write-Output "--> Deleting all stopped containers..."
docker rm $(docker ps -a -q) 2>&1 | out-null
@luizen
luizen / delete-vscode-uninstalled-extension-folders.ps1
Created May 14, 2025 15:26
Powershell script to delete left overs (folders) of unused (uninstalled) VS Code extensions
# Requires System.Data.SQLite assembly and VS Code to be installed
# Check if the assembly is already loaded
if (-not ([System.Reflection.Assembly]::LoadWithPartialName("System.Data.SQLite"))) {
# Attempt to load the assembly from the specified path
$assemblyPath = "C:\Program Files (x86)\Common Files\Red Gate\SQLite\System.Data.SQLite.DLL"
if (Test-Path $assemblyPath) {
Add-Type -Path $assemblyPath
} else {
Write-Error "System.Data.SQLite assembly not found at the specified path: $assemblyPath"