Skip to content

Instantly share code, notes, and snippets.

@stevecooperorg
stevecooperorg / extract-clips.py
Created May 2, 2025 11:21
Ludosport video sharing scripts, 2025-05-01
#!/usr/bin/env python3
#
# Script: extract_clips.py
# Purpose: Extract multiple clips from a video file using faster keyframe-based
# seeking, hardware-accelerated H.265 (hevc_videotoolbox), and specified audio filters.
# Ensures QuickTime compatibility by tagging the video track as hvc1.
import subprocess
import os
from typing import List, Tuple

md2pdf

A tool to convert Markdown files to PDF using Pandoc and Typst.

Requirements

These three programs should be in your path;

  • Python 3
  • Pandoc
import mailbox
def extract_from(mbox_file):
mbox = mailbox.mbox(mbox_file)
for message in mbox:
print(message['from'])
if __name__ == "__main__":
import sys
#!/bin/bash
# create a RAMDISK like so `create-ram-disk 6` to create a 6Gb ramdisk.
# diagnostic information is written to STDERR: the name of the newly-created disk is written to STDOUT
# from https://stackoverflow.com/a/47354885/6722
set -e
FILEPATH="${BASH_SOURCE[0]}"
FILE=$(basename "${FILEPATH}")
DIR="$(cd "$(dirname "${FILEPATH}")" && pwd)"
@stevecooperorg
stevecooperorg / Compressor.cs
Created February 20, 2017 23:49
Compressor.cs -- resize a bitmap to within 5% of a target size
using System;
using System.Collections.Generic;
using System.Drawing; // include System.Drawing.dll
using System.Drawing.Drawing2D;
using System.Drawing.Imaging;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
@stevecooperorg
stevecooperorg / gulpfile.js
Last active January 20, 2017 21:52
A simple gulp file which lints and runs jasmine tests
/*
cd ~/IdeaProects/foo
rm package.json
rm -rf node_modules
npm init -y
npm install gulp --save-dev
npm install jshint --save-dev
npm install gulp-jshint --save-dev
npm install gulp-watch --save-dev
npm install jasmine --save-dev
@stevecooperorg
stevecooperorg / Program.cs
Created December 16, 2014 15:07
Lesson 3 - objects and classes
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HelloPerson
{
class Program
{
@stevecooperorg
stevecooperorg / Program.cs
Created December 2, 2014 14:12
Lesson 2 - functions and enums
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HelloPerson
{
@stevecooperorg
stevecooperorg / Program.cs
Created November 20, 2014 13:23
C# lesson 1a
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HelloPerson
{
class Program
{
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HelloStuff
{
class Program
{