Skip to content

Instantly share code, notes, and snippets.

View termermc's full-sized avatar

Ian termermc

View GitHub Profile
@termermc
termermc / Show.tsx
Created November 22, 2024 06:47
Solid.js TSX component to PHP template function transpiler (proof of concept)
import { Component, JSX } from 'solid-js'
type ShowProps = {
when: boolean,
children: JSX.Element
fallback?: JSX.Element
}
/**
* Polyfill for the Solid.js `Show` component that works with Bake.
@termermc
termermc / wireguard_port_forward.sh
Created March 21, 2022 15:04
Port forwarding through Wireguard (script to be run on the server)
#!/usr/bin/env bash
# Usage: ./wireguard_port_forward.sh <client IP> <server IP> <port>
# Example: ./wireguard_port_forward.sh 10.0.0.2 10.0.0.1 8080
# Script must be run as root
CLIENT=$1
SERVER=$2
PORT=$3
@termermc
termermc / ffprobe_output_definitions.js
Last active April 29, 2025 10:50
Definition and explanation of FFprobe (FFmpeg's probe tool) JSON output (JavaScript JSDoc definition comments and TypeScript type definitions)
// These definitions are my best attempt at documenting the output of FFprobe using the "-print_format json" option
// The descriptions come mostly out of experience, deduction, and the very sparse documentation of the outputs
// Not all fields will be present (it depends on the file), but fields that are definite are not marked as optional
// Sample probe:
// ffprobe -v quiet -print_format json -show_format -show_streams -show_chapters -show_error my_file.mp4
/**
* @typedef FFprobeDisposition
* @property {number} default 1 if the default track
* @property {number} dub 1 if a dub track