Skip to content

Instantly share code, notes, and snippets.

View brimonk's full-sized avatar
🖥️
Programming like it's 1971

Brian Chrzanowski brimonk

🖥️
Programming like it's 1971
View GitHub Profile
@brimonk
brimonk / wordle.c
Created June 5, 2022 06:33
My Wordle Solver (Probably Buggy)
// Brian Chrzanowski
// 2022-06-05 02:04:34
//
// My Wordle Solver.
//
// I'd been meaning to write one of these for a while. Basically, we slurp up the entire wordlist,
// and we literally just throw away words if they don't match the Worlde word.
#include <stdio.h>
#include <stdlib.h>
@brimonk
brimonk / more_meta_programming.c
Created November 30, 2021 06:47
A Small, Metaprogramming Example in C
// Brian Chrzanowski
// 2021-11-30 00:06:44
//
// This is just a small demonstration that with the help of the C Preprocessor, and some macros, we
// can approach some meta programming things that get compile-time checked by the compiler. It isn't
// as elegant as something like Jai, but in theory, you could execute something like this at the
// very start of the program.
//
// If C supported more things out of the box to facilitate metaprogramming, this could could get a
// lot nicer, but that's what it is.
// Brian Chrzanowski
// 2021-09-16 01:56:12
//
// take a screenshot and upload it to my server
//
// This is 100% throw away code. I wouldn't want this to be installed on anyone else's computers
// becuase I don't fully understand the whole bitmap, screen device context, chicanery that's
// going on.
//
// INSTRUCTIONS
@brimonk
brimonk / distance.sh
Created September 9, 2021 19:19
Basically a small `dc` script that computes the distance between two points.
#!/usr/bin/env sh
dc -e "? ? - 2 ^ ? ? - 2 ^ + v p"
@brimonk
brimonk / debugify.html
Created March 23, 2021 20:07
I was debugging some stuff in control-flow hell at work, and thought this might be useful. `eval()` outside of `<script>` tags doesn't work, but apparently it's just fine inside them.
<html>
<script>
function addone(v) { return v + 1; }
function debugify(fn) {
console.log("debugifying");
let source = fn.toString();
let parts = source.split(" ");
let decl = parts[1];
@brimonk
brimonk / imbuilder.ts
Last active March 21, 2021 09:31
just a little "immediate mode" experiment
// Brian Chrzanowski
// 2021-03-21 04:20:30
//
// Just a small HTML Form builder kind of a thing, no styling. This could obviously
// be extended to things other than HTML if you just replaced the `toHtml()` method
// and maybe standardized a little bit more on the sorts of tags / elements you want
// to stick into the builder.
class Builder {
/*
* Wed Mar 25, 2020 13:29
*
* Set the Windows Clipboard Type from the Content
* -t <type>
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
/*
* Wed Mar 25, 2020 13:29
*
* Set the Windows Clipboard Type from the Content
* -t <type>
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
/*
* Brian Chrzanowski
* Fri Dec 06, 2019 18:43
*
* A small test to see if molt_gfquad_m is the problem in the simulation.
*
* Outputs
* 0.500000
* 0.539522
* 0.575920
@brimonk
brimonk / brianbuild.c
Created August 9, 2019 04:59
A Trial Run Building Program to Replace Makefiles
/*
* Brian Chrzanowski
* Fri Aug 09, 2019 00:58
*
* Brian's Cool Builder (bcb)
*
* TODO
* 1. Add more wait end conditions, in 'recompile'
* 2. Add the ".d" dependency files
* 3. Add a mechanism to clean up the source tree