Skip to content

Instantly share code, notes, and snippets.

View alessioc42's full-sized avatar
🏐
I am too old for this stuff.

Alessio Caputo alessioc42

🏐
I am too old for this stuff.
View GitHub Profile
/**
* This is a parser for the rapla planning tool. It fetches the HTML of the rapla page and extracts the events from it.
*
* Rapla: https://github.com/rapla/rapla
*/
import { parse } from "node-html-parser";
export type Event = {
start: Date;
@alessioc42
alessioc42 / keywordcut.py
Last active February 23, 2026 11:45
Tool to cut a bunch of videos by subtitle keywords
import os
import glob
import subprocess
import argparse
from moviepy import VideoFileClip, concatenate_videoclips
import pysubs2
def extract_subtitles(mkv_file, subtitle_index):
"""Extract subtitles from MKV file."""
base_name = os.path.splitext(os.path.basename(mkv_file))[0]
@alessioc42
alessioc42 / pattern_generator.js
Last active July 29, 2025 17:18
Create a honeycomb like SVG pattern
// Canvas dimensions
const CANVAS_WIDTH = 1080*2;
const CANVAS_HEIGHT = 1080*2;
// Triangle dimensions
const TRIANGLE_SIZE = 50; // Size of each triangle (side length)
const TRIANGLE_SPACING = 0; // Additional spacing between triangles
// Colors and styling
const STROKE_COLOR = '#888888'; // Color of triangle outlines
@alessioc42
alessioc42 / schulportal_knowledgebase_crawler.ts
Created June 23, 2025 09:52
Crawl all articles from the knowledgebase for offline FTS
import { parse } from "node-html-parser";
import { writeFileSync } from "fs";
const rootURL = "https://support.schulportal.hessen.de/knowledgebase.php";
const outDir = "data";
type categoryId = string;
type articleId = string;
let categoryIds = new Set<categoryId>();
@alessioc42
alessioc42 / sph_images_inverted.js
Created February 13, 2024 12:07
School Portal Hesse: compare all school images with the inverted image
const Jimp = require('jimp');
async function getSchools() {
let response = await fetch("https://startcache.schulportal.hessen.de/exporteur.php?a=schoollist");
let data = await response.json();
let result = [];
for (let i = 0; i < data.length; i++) {
for (let j = 0; j < data[i].Schulen.length; j++) {