Skip to content

Instantly share code, notes, and snippets.

View au5ton's full-sized avatar
😶‍🌫️
Working on closed-source stuff

Austin Jackson au5ton

😶‍🌫️
Working on closed-source stuff
View GitHub Profile
@OrionReed
OrionReed / dom3d.js
Last active April 19, 2025 12:06
3D DOM viewer, copy-paste this into your console to visualise the DOM topographically.
// 3D Dom viewer, copy-paste this into your console to visualise the DOM as a stack of solid blocks.
// You can also minify and save it as a bookmarklet (https://www.freecodecamp.org/news/what-are-bookmarklets/)
(() => {
const SHOW_SIDES = false; // color sides of DOM nodes?
const COLOR_SURFACE = true; // color tops of DOM nodes?
const COLOR_RANDOM = false; // randomise color?
const COLOR_HUE = 190; // hue in HSL (https://hslpicker.com)
const MAX_ROTATION = 180; // set to 360 to rotate all the way round
const THICKNESS = 20; // thickness of layers
const DISTANCE = 10000; // ¯\\_(ツ)_/¯
@missinglink
missinglink / codes.json
Last active November 13, 2024 00:17
ISO 3166 Country Code to ISO 639 'Official Language Codes' for each country
{
"AD": "ca",
"AE": "ar-AE,fa,en,hi,ur",
"AF": "fa-AF,ps,uz-AF,tk",
"AG": "en-AG",
"AI": "en-AI",
"AL": "sq,el",
"AM": "hy",
"AN": "nl-AN,en,es",
"AO": "pt-AO",
// Turn all HTML <a> elements into client side router links, no special framework-specific <Link> component necessary!
// Example using the Next.js App Router.
import { useRouter } from 'next/navigation';
import { useEffect } from 'react';
function useLinkHandler() {
let router = useRouter();
useEffect(() => {
let onClick = e => {
@TonyGravagno
TonyGravagno / zodDefaultInstance.ts
Last active May 5, 2025 05:23
Create a default object from a Zod schema
import { z } from 'zod'
/**
* @summary Function returns default object from Zod schema
* @version 23.05.15.2
* @link https://gist.github.com/TonyGravagno/2b744ceb99e415c4b53e8b35b309c29c
* @author Jacob Weisenburger, Josh Andromidas, Thomas Moiluiavon, Tony Gravagno
* @param schema z.object schema definition
* @param options Optional object, see Example for details
* @returns Object of type schema with defaults for all fields
@ryanlintott
ryanlintott / LayoutThatFits.swift
Last active December 8, 2023 15:14
An alternative to ViewThatFits. Updated version can be found here: https://github.com/ryanlintott/LayoutThatFits
//
// LayoutThatFits.swift
// WWDC22Experiments
//
// Created by Ryan Lintott on 2022-06-08.
//
import SwiftUI
struct LayoutThatFits: Layout {
@kierancrown
kierancrown / confetti.swift
Created March 9, 2022 14:53
Confetti Animation in SwiftUI
import Foundation
import SwiftUI
enum ConfettiShape {
case rectangle
case circle
}
enum ConfettiPosition {
case foreground
@jamietre
jamietre / docker-compose.yml
Last active May 5, 2025 00:22
Script to start WSL and bind localhost to WSL IP
# Example docker-compose.yml for plex.
version: "2"
services:
plex:
image: plexinc/pms-docker:plexpass
runtime: nvidia
container_name: "plex"
restart: always
hostname: "MY-PLEX"
volumes:
# IDA (disassembler) and Hex-Rays (decompiler) plugin for Apple AMX
#
# WIP research. (This was edited to add more info after someone posted it to
# Hacker News. Click "Revisions" to see full changes.)
#
# Copyright (c) 2020 dougallj
# Based on Python port of VMX intrinsics plugin:
# Copyright (c) 2019 w4kfu - Synacktiv
@beefan
beefan / rem-widget-scriptable.js
Created November 26, 2020 04:37
REM Sleep Helper Widget
// SleepyTime
// when to set your alarm if you go to bed now
// wake up in between REM cycles to feel rested
//
const REM_CYCLE_LENGTH = 90
let widget = new ListWidget()
buildWidget()
// for debugging, allows script to run in app
@kevinkub
kevinkub / scriptable-line-chart.js
Last active August 23, 2024 05:31
Simple line chart class for https://scriptable.app 📈
class LineChart {
// LineChart by https://kevinkub.de/
constructor(width, height, values) {
this.ctx = new DrawContext();
this.ctx.size = new Size(width, height);
this.values = values;
}
_calculatePath() {