Skip to content

Instantly share code, notes, and snippets.

@axel-angel
axel-angel / spotify_to_youtube.py
Last active September 15, 2025 08:12
Convert spotify urls to youtube urls with Spotdl
#!/usr/bin/env python3
# requirements: pip install spotdl
import sys, os, json
from spotdl import Spotdl
from spotdl.types.song import Song
from argparse import ArgumentParser
from tqdm.auto import tqdm
@axel-angel
axel-angel / find.json
Created September 14, 2025 20:57
structured manpage: find
{
"name": "find",
"short_desc": "search for files in a directory hierarchy",
"usage_format": "find [-H] [-L] [-P] [-D debugopts] [-Olevel] [starting-point...] [expression]",
"flags": [
{
"short": "-H",
"long": null,
"short_desc": "Do not follow symbolic links, except while processing command line arguments",
"argument": null,
@axel-angel
axel-angel / fzf-jobs-widget.zsh
Last active September 21, 2025 11:56
fzf-jobs-widget for zsh
#!/usr/bin/zsh
j() { # 1 line per job, always
for id cmd in "${(@kv)jobtexts}"; do
echo "${(r:3:)id} $cmd [${jobdirs[$id]}]";
done
}
fzf-jobs-widget() {
local selected num
@axel-angel
axel-angel / git_auto_commit.sh
Created August 24, 2025 19:31
Git auto commit script (shell)
#!/bin/sh
# Auto-commit script with safety checks
set -e
if [ -z "$1" ]; then
echo "Missing directory argument";
exit 1;
else
cd "$1"; shift;
fi;
@axel-angel
axel-angel / qmk_ps2_mouse_as_pointing_device_driver.patch
Created August 1, 2024 14:14
QMK PS2 mouse as pointing device so it works for splits
diff --git a/drivers/ps2/ps2_mouse.c b/drivers/ps2/ps2_mouse.c
index ef1a0e26f9..b2dafb1f3c 100644
--- a/drivers/ps2/ps2_mouse.c
+++ b/drivers/ps2/ps2_mouse.c
@@ -29,6 +29,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
/* ============================= MACROS ============================ */
static report_mouse_t mouse_report = {};
+#if defined(POINTING_DEVICE_DRIVER_ps2_mouse)
+static report_mouse_t mouse_report_buffer = {};
#!/bin/zsh
# relative history
relative_histfile() {
searchdir="$(readlink -f $PWD)";
# default values
if [ -z "$HISTDIR" ]; then
HISTDIR="$HOME/.histfiles/";
fi
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <time.h>
typedef unsigned char byte_t;
double timestamp_now() {
struct timespec t_time;
double m_time;

query (raw): bitcoin, kelly-detwil, megawatt, mining, cryptocurrency, electricity, yearly, constraint, cost, energy, pool, datacenter, block, consumption, solving, math, amount, viability, transaction, blockchain, Blockchain input DB: ../word2vec.data/articles_prod_2016-07-25_hydrated_250k.json.gz opts: {:min-match 3, :ws-weights nil, :min-cosine 0.8}

  • 6.40117905309144 Blockchain A-Z: Everything You Need to Know About the Game-Changing Tech Beneath Bitcoin

TV product placement off to slow start

  • article-score=0.2361 match-score=0.448 uuid=5c59f5e7fa505166a2f639deb9d096f6bf0d9be3
  • http://www.theguardian.com/media/2011/aug/27/tv-product-placement
  • has: Made Simple
  • not: product placement, channel 4, mediaguardian, placement, placement deal, findmypast, catton, tv product, 3353, 020 3353, 020, deal, product, channel, show david, fat salt, intern televis, materialis, thing hold, make televis, pritchard, david charlesworth, catwalk competit, placement agenc, yesterdai call

Jordan Brand Store Opens on State Street

@axel-angel
axel-angel / convnet_test.py
Last active January 4, 2019 13:26
Caffe script to compute accuracy and confusion matrix
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Author: Axel Angel, copyright 2015, license GPLv3.
import sys
import caffe
import numpy as np
import lmdb
import argparse