Skip to content

Instantly share code, notes, and snippets.

View ssokolow's full-sized avatar

Stephan Sokolow ssokolow

View GitHub Profile
w-e-w /
Last active May 22, 2024 07:38
Stable Diffusion web UI txt2img img2img api example script
from datetime import datetime
import urllib.request
import base64
import json
import time
import os
webui_server_url = ''
out_dir = 'api_out'
This python script will find flatpak deduplication size stats.
Made with :heart: by powpingdone#3611, or just powpingdone on github.
Explaination for output:
'no dedupe': The size that the ostree repository would take up if files were not deduplicated.
'dedupe': The actual size of the ostree repository.
'singlet': The size of all files that are referenced once.
'orphan': The size of all files not referenced (ie, only one hard link).
Kestrer /
Created October 17, 2020 05:35
A guide on how to write hygienic Rust macros

How to Write Hygienic Rust Macros

Macro hygiene is the concept of macros that work in all contexts; they don't affect and aren't affected by anything around them. Ideally all macros would be fully hygienic, but there are lots of pitfalls and traps that make it all too easy to accidentally write unhygienic macros. This guide attempts to provide a comprehensive resource for writing the most hygienic macros.

Understanding the Module System

First, a little aside on the details of Rust's module system, and specifically paths; it is

Ben-PH /
Last active June 6, 2020 02:56
Comaprison of C and Rust syscalls on startup/shutdown.


For some situations, understanding system calls made during processes start-up and shut-down can be valuable. For example, consider a shell-scripts long-running hot loop that runs a very short-running process. Thus it is perhaps reasonable to hypothesise that a difference in system calls during process start-up/shut-down has a non-negligable impact on the run time of said hot-loop.

This write-up looks at how C and Rust programs differ in terms of system-calls for start-up/shutdown. It is not intended as a performance analysis and only looks at one target system.

At the end, we take a quick look at using statically linked libraries by building with # cargo build --target x86_64-unknown-linux-musl --release and removing even more syscalls by removing the main function


cellularmitosis /
Last active May 8, 2024 16:36
QEMU PowerPC G4 OS X Tiger (10.4) setup
shakna-israel /
Created January 30, 2020 03:50
Let's Destroy C

Let's Destroy C

I have a pet project I work on, every now and then. CNoEvil.

The concept is simple enough.

What if, for a moment, we forgot all the rules we know. That we ignore every good idea, and accept all the terrible ones. That nothing is off limits. Can we turn C into a new language? Can we do what Lisp and Forth let the over-eager programmer do, but in C?

goranmoomin /
Last active December 3, 2020 11:34
actix-service Cell::get_mut() is unsound
bb010g / 000-actix-logs
Last active November 9, 2022 06:53
actix/actix-net#83, actix/actix-net#87
HenningTimm /
Last active May 4, 2024 03:48
Memory profiling Rust code with heaptrack in 2019
robey / apple1-rom.txt
Last active May 22, 2023 03:49
apple 1 ROM disassembly
; the "monitor ROM" of an apple 1 fit in one page (256 bytes).
; this is my attempt to take the disassembled code, give names to the
; variables and routines, and try to document how it worked.
; an apple 1 had 8KB of RAM (more, if you hacked on the motherboard), and a
; peripheral chip that drove the keyboard and video. the video was run by a
; side processor that could treat the display as an append-only terminal that