Skip to content

Instantly share code, notes, and snippets.

View fwcd's full-sized avatar

fwcd fwcd

View GitHub Profile
@ashtonmeuser
ashtonmeuser / DOOM.ts
Last active March 5, 2025 22:43
DOOM in a bookmarklet
// bookmarklet-title: DOOM
// bookmarklet-about: Take a break. Kill some demons. The entirety of the 1993 classic DOOM shoehorned into a bookmarklet. Some browsers are snobby about executing nearly 10 MB of raw JS from the favorites bar 🙄 in which case you can opt to fetch the DOOM binary rather than embed it.
import Modal from '/ashtonmeuser/0613e3aeff5a4692d8c148d7fcd02f34/raw/d6dd01eaab665a14bded5487a8c03b6bb7197388/Modal.ts';
import binary from 'https://cdn.jsdelivr.net/gh/ashtonmeuser/godot-wasm-doom/doom.wasm';
const embed = false; // bookmarklet-var(boolean): embed
const uuid: string = ''; // bookmarklet-var(uuid): uuid
type Size = { x: number, y: number };
@LeoNatan
LeoNatan / LNHiddenStrings.hh
Last active September 3, 2024 09:37
Hidden Strings
/**
The MIT License (MIT)
Copyright (c) 2024 Léo Natan
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@FreyaHolmer
FreyaHolmer / GpuPrinter.cginc
Last active May 24, 2025 08:58
A unity shader .cginc to draw numbers in the fragment shader - see the first comment below for example usage!
///////////////////////////////////////////////////////////////////////////////
// ABOUT: A unity Shader .cginc to draw numbers in the fragment shader
// AUTHOR: Freya Holmér
// LICENSE: Use for whatever, commercial or otherwise!
// Don't hold me liable for issues though
// But pls credit me if it works super well <3
// LIMITATIONS: There's some precision loss beyond 3 decimal places
// CONTRIBUTORS: yes please! if you know a more precise way to get
// decimal digits then pls lemme know!
// GetDecimalSymbolAt() could use some more love/precision
@zmwangx
zmwangx / self-hosted-gitlab-manually-confirm-user-email.md
Created June 7, 2024 12:50
Manually confirm user email with `gitlab-rails console`
  • Run gitlab-rails console;

  • Find the user:

    user = User.User.find_by_username('username')
  • Look at the list of emails and find the one you want to confirm:

@veekaybee
veekaybee / normcore-llm.md
Last active June 3, 2025 00:18
Normcore LLM Reads

Anti-hype LLM reading list

Goals: Add links that are reasonable and good explanations of how stuff works. No hype and no vendor content if possible. Practical first-hand accounts of models in prod eagerly sought.

Foundational Concepts

Screenshot 2023-12-18 at 10 40 27 PM

Pre-Transformer Models

How to install game-porting-toolkit (aka proton for macOS)

You also might wanna just use Whisky which does this automatically

This guide works on macOS 13.4+ using Command Line Tools for XCode 15 Beta!

What is this?

In the recent WWDC, Apple announced and released the "game porting toolkit", which upon further inspection this is just a modified version of CrossOver's fork of wine which is a "compatibility layer" that allows you to run Windows applications on macOS and Linux.

@kconner
kconner / macOS Internals.md
Last active May 30, 2025 01:09
macOS Internals

macOS Internals

Understand your Mac and iPhone more deeply by tracing the evolution of Mac OS X from prelease to Swift. John Siracusa delivers the details.

Starting Points

How to use this gist

You've got two main options:

@meeech
meeech / a_help-osx-borked-my-nix.md
Last active May 13, 2025 11:41
Some steps to (hopefully) help you fix your Nix install on OS X after an upgrade.

Apple Borked my Nix!

Ok, so you've had nix (home-manager) working fine. Then Apple tells you it's time to update.

Ok. Reboot. Oops. It has now broken your Nix setup. Here's some stuff to work through. YMMV.

Note: This is what worked for me, who was just using nix + home-manager. The upgrade that I last did that caused all these issues was 12.3.X > 12.4

Useful Links

@henrik242
henrik242 / airtag-to-gpx-sync.sh
Last active May 22, 2025 14:11
Read AirTag data from the FindMy.app cache and convert to GPX
#!/usr/bin/env bash
#
# Reads AirTag data from the FindMy.app cache and converts it to a daily GPX file
#
# Rsyncs the data to a web accessible folder that can be displayed with e.g.
# https://gist.github.com/henrik242/84ad80dd2170385fe819df1d40224cc4
#
# This should typically be run as a cron job
#

Motivation

Swift’s type system supports a number of different ways of taking a function or type and abstracting it. Usually, this is done by adding a generic parameter and an associated set of constraints. Similarly, a function that takes a particular type of argument can be abstracted to any number of those arguments by making it variadic with triple-dot (...) syntax. Today, both of these features are permitted separately: you can define a generic function that takes a variable number of arguments, such as

func debugPrint<T>(_ items: T...) 
  where T: CustomDebugStringConvertible
{   
  for (item: T) in items {
    stdout.write(item.debugDescription)