Skip to content

Instantly share code, notes, and snippets.

View dfrankland's full-sized avatar
🏕️
Catching Pokemon

Dylan Frankland dfrankland

🏕️
Catching Pokemon
View GitHub Profile
@narskidan
narskidan / von_nuemann_vm.ts
Created October 15, 2023 06:35
Pancho triggering my autism
const MEMORY_SIZE = 1_000_000;
type Memory = any[]
type registerName = 'stackPointer'
| 'instructionPointer'
| 'returnValue'
| 'general';
interface Processor {
halted: boolean;
@thepwrtank18
thepwrtank18 / keys.md
Last active December 21, 2024 10:07
Windows XP/2003 Product Keys

DEPRECATION NOTICE

Consider this gist to be deprecated. It's full of information that may or may not be correct, given recent findings. Consider the in-development PIDDatabase, and UMSKT, instead: https://umskt.github.io/PIDDatabase-viewer https://github.com/UMSKT/UMSKT

Windows XP/2003 Product Keys

These keys have been tested to work. These are a combination of keys from Chinese websites, trial keys inside ISO's, auto-activate keys in OEM ISO's, and directly from Microsoft's website, all aggregated for your convenience.

Usage

In order to use these keys, you need the right edition of Windows XP/2003. Not just Home/Pro/Enteprise/etc, whether it's a Retail, OEM or Volume version. There's a clear cut way to check this.

@steveruizok
steveruizok / visibility-polygon.ts
Created November 21, 2022 23:49
Get a visibility polygon (for shadow casting).
// segments are all of the segments in all of the shapes in the scene
// point is light point
// viewport is top left, top right, bottom right, bottom left
function getVisibilityPolygon(segments: Segment[], point: Point, viewport: Point[]) {
const brokenSegments: Segment[] = []
const viewportMinCorner = viewport[0]
const viewportMaxCorner = viewport[2]
@redbar0n
redbar0n / routing-ideas.mdx
Last active July 18, 2024 12:12
Routing ideas

a thread where we can discuss some crazy routing ideas a bit out in the open branching out from the previous discussion on filesystem routes over at: https://discord.com/channels/815937377888632913/1014946079965454366

so, first of all, it seems there is a close alignment between how vite-plugin-ssr and router5 handles routing:

I recommend watching this router5 talk from 2:45 - 7:50 https://youtu.be/hblXdstrAg0?t=165 since it's really key to how I think about view / state separation, and I think of routing as a state separate from the view. (After all, and especially in a client-rendered app, what page it is showing is certainly a major part

@rsaryev
rsaryev / prisma-utils.ts
Last active May 28, 2024 11:27
Prisma analogue migrate rest command only programmatically, for testing purposes.
import { Prisma, PrismaClient } from '@prisma/client';
import { exec } from 'child_process';
import * as util from 'util';
const execPromisify = util.promisify(exec);
const prisma = new PrismaClient();
const tables = Prisma.dmmf.datamodel.models
.map((model) => model.dbName)
.filter((table) => table);
@jmatsushita
jmatsushita / README
Last active December 14, 2024 15:01
Setup nix, nix-darwin and home-manager from scratch on an M1 Macbook Pro
###
### [2023-06-19] UPDATE: Just tried to use my instructions again on a fresh install and it failed in a number of places.
###. Not sure if I'll update this gist (though I realise it seems to still have some traffic), but here's a list of
###. things to watch out for:
### - Check out the `nix-darwin` instructions, as they have changed.
### - There's a home manager gotcha https://github.com/nix-community/home-manager/issues/4026
###
# I found some good resources but they seem to do a bit too much (maybe from a time when there were more bugs).
# So here's a minimal Gist which worked for me as an install on a new M1 Pro.
@Phate6660
Phate6660 / rust recommendations and alternatives.md
Last active May 29, 2024 12:35
My growing list of Rust programs to use.
@freeekanayaka
freeekanayaka / oximeter-ha.go
Last active May 31, 2020 05:37
Sample pulse oximeter with Dqlite and Go
package main
import (
"context"
"database/sql"
"fmt"
"io"
"log"
"math/rand"
"net/http"
@maxhawkins
maxhawkins / public_printer.md
Last active October 28, 2019 05:46
How to Make Your Printer Public

tweet

How to Make Your Printer Public

This September I decided to share my laser printer so anyone on the internet could send me printed messages.

Within a few days I got hundreds of fun print-outs from people all over the world.

Using Google Cloud Print, you can easily make your printer public too. Here's how to do it: