Skip to content

Instantly share code, notes, and snippets.

View cellularmitosis's full-sized avatar

Jason Pepas cellularmitosis

View GitHub Profile
@cellularmitosis
cellularmitosis / README.md
Last active March 16, 2024 04:36
Jason Pepas' Technical Blog
@cellularmitosis
cellularmitosis / factorio.md
Last active March 7, 2024 03:43
Some notes on Factorio

Factorio notes

Some notes on the game Factorio.

Pre-belt Engineering

Red Science

Stage 1:

@cellularmitosis
cellularmitosis / README.md
Last active February 26, 2024 08:53
Basic Zener diode voltage regulator
@cellularmitosis
cellularmitosis / Makefile
Last active February 21, 2024 18:05
Compilation speed: tcc vs gcc (sudoku.c)
a.out: sudoku.c
gcc -std=c89 -Wall -Werror -Os sudoku.c -o a.out
ccbench:
@cat /proc/cpuinfo | grep 'model name' | head -n1
@tcc -v || true
@gcc --version | head -n1
@echo
@tcc sudoku.c
time tcc sudoku.c 2>&1 && mv a.out a.out.tcc
@cellularmitosis
cellularmitosis / Makefile
Created May 4, 2023 04:35
Snake in C and SDL 1.2, revisited
SDL=$(shell sdl-config --cflags --libs)
default: snake run
run: snake
./snake
snake: snake.c
gcc -std=c99 -Wall -Werror -O2 $(SDL) snake.c -o snake
@cellularmitosis
cellularmitosis / README.md
Last active January 21, 2024 04:38
Factorio icon set scripts

Here is a script I use to crop out 64x64 item icons from the Factorio icon mini-sprite-sheet png's.

@cellularmitosis
cellularmitosis / README.md
Last active January 14, 2024 02:50
"EZOFF": Easy offsets and keepouts for Marlin firmware
@cellularmitosis
cellularmitosis / EmojiPointersDemo.swift
Created August 15, 2018 18:11
Representing pointer values as emoji can be useful for "visually" debugging certain issues, like cell reuse, etc.
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
let window = UIWindow(frame: UIScreen.main.bounds)
@cellularmitosis
cellularmitosis / README.md
Last active December 2, 2023 02:30
Matching a string literal using regex

Blog 2019/9/1

<- previous | index | next ->

Matching a string literal using regex

When implementing a regex-based lexer / tokenizer, coming up with a regex which matches string literals can be a bit tricky.

@cellularmitosis
cellularmitosis / README.md
Last active December 1, 2023 13:11
Trivial rect filling SDL2 benchmark in Golang and Python

Blog 2020/4/19

<- previous | index | next ->

Trivial rect filling SDL2 benchmark in Golang and Python

I threw together a few trivial benchmarks to compare the rect filling performance of golang vs. python.