Skip to content

Instantly share code, notes, and snippets.

View timbenniks's full-sized avatar
😀

Tim Benniks timbenniks

😀
View GitHub Profile
@timbenniks
timbenniks / AI_Agent_migrate_to_void_Zero_Toolchain.md
Last active August 23, 2025 02:07
Migrate any TypeScript Library to the Void Zero Toolchain using an AI agent

🤖 AI Agent Instructions: Migrate TypeScript Library to Void Zero Toolchain

Agent Role: You are tasked with migrating any TypeScript library from its current build system to the high-performance Void Zero toolchain. Follow these instructions systematically.

🎯 Mission Overview

Transform any TypeScript library (regardless of current setup) to use:

  • TSDown for both JavaScript bundling AND TypeScript declarations (primary approach)
  • Oxlint for linting (optional, can keep existing)
@timbenniks
timbenniks / enhance.js
Created September 9, 2022 13:55
Query Contentful items by tags with Uniform Enhancers
import { enhance, EnhancerBuilder } from "@uniformdev/canvas";
import { createClient } from "contentful"
const contentfulTutorialListByTagsEnhancer = async ({ component }) => {
const { tags, limit } = component.parameters
const client = createClient({
space: process.env.CONTENTFUL_SPACE_ID,
environment: process.env.CONTENTFUL_ENVIRONMENT,
accessToken: process.env.CONTENTFUL_ACCESS_TOKEN
@timbenniks
timbenniks / static.php
Created May 19, 2016 19:53
Script to render static resources through PHP
<?php
$file = $_GET[ 'file' ];
$ext = $_GET[ 'ext' ];
$filename = $file.'.'.$ext;
header( 'Date: ' . gmdate( 'D, d M Y H:i:s GMT' ) );
header( 'Expires: ' . gmdate( 'D, d M Y H:i:s', strtotime( '+ 10 years' ) ) . ' GMT' );
header( 'Last-Modified: ' . gmdate( 'D, d M Y H:i:s', filemtime( $filename ) ) . ' GMT' );
header( 'Cache-Control: public, max-age=315360000' );
header( 'Pragma: ' );
@timbenniks
timbenniks / Simple horizontal drag
Created November 3, 2011 17:03
I am creating a very simple horizontal draggable script. How can I add containment? Any tips?
$(function()
{
$('.drag').bind('mousedown', function(mouseDownEvent)
{
mouseDownEvent.preventDefault();
var dragger = $(this),
mouseDownPageX = mouseDownEvent.pageX,
draggerOnMouseDownLeftPos = dragger.position().left,
leftPos,