Skip to content

Instantly share code, notes, and snippets.

View etodd's full-sized avatar

Evan Todd etodd

View GitHub Profile
@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
@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 / util.gd
Created June 15, 2026 16:33
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, target: float, duration: float, delta: float) -> float:
return lerpf(current, target, 1.0 - pow(0.01, delta / duration))