Skip to content

Instantly share code, notes, and snippets.

View etodd's full-sized avatar

Evan Todd etodd

View GitHub Profile
@etodd
etodd / clean_vtt.py
Last active August 1, 2026 15:43
YouTube VTT cleaning script
#!/usr/bin/env python3
# Forked and improved version of https://github.com/anandiamy/Batch-Single-Clean-Youtube-Vtt/blob/main/single_clean.py
# Remove duplicated lines from a .vtt file generated by youtube-dl when
# downloading auto-subs from a Youtube video using the --write-auto-sub option
# This script only prints the lines so save the edited subs as:
#
# python this_script.py original_sub.vtt new_sub.vtt
@etodd
etodd / util.gd
Last active August 13, 2026 17:25
My GDScript utility functions
class_name Util
extends Node
## Call this function every frame to move the given value toward the target in
## a smooth, springy, FRAMERATE INDEPENDENT way, such that it will take
## "duration" to reach within 1% of the target.
##
## Credit: https://x.com/FreyaHolmer/status/1757836988495847568
static func smooth_toward(
current: float,
@etodd
etodd / test.c
Last active October 24, 2024 16:28
dump route table on macos
// stolen from https://stackoverflow.com/a/11265543
#include <stdio.h>
#include <stdlib.h>
#include <err.h>
#include <sys/param.h>
#include <sys/sysctl.h>
#include <sys/socket.h>
#include <netinet/in.h>
@etodd
etodd / CurrentSettings.vssettings
Last active March 8, 2017 16:22
Visual Studio settings
<UserSettings><ApplicationIdentity version="15.0"/><ToolsOptions><ToolsOptionsCategory name="Environment" RegisteredName="Environment"><ToolsOptionsSubCategory name="Import and Export Settings" RegisteredName="Import and Export Settings" PackageName="Visual Studio Environment Package"><PropertyValue name="TrackTeamSettings">false</PropertyValue><PropertyValue name="TeamSettingsFile"/><PropertyValue name="AutoSaveFile">%vsspv_settings_directory%\CurrentSettings.vssettings</PropertyValue></ToolsOptionsSubCategory><ToolsOptionsSubCategory name="Documents" RegisteredName="Documents" PackageName="Visual Studio Environment Package"><PropertyValue name="ShowMiscFilesProject">false</PropertyValue><PropertyValue name="AutoloadExternalChanges">false</PropertyValue><PropertyValue name="CheckForConsistentLineEndings">true</PropertyValue><PropertyValue name="SaveDocsAsUnicodeWhenDataLoss">false</PropertyValue><PropertyValue name="InitializeOpenFileFromCurrentDocument">true</PropertyValue><PropertyValue name="ReuseSavedAct