Skip to content

Instantly share code, notes, and snippets.

View lf94's full-sized avatar
🏔️
Hey how's it going

49fl lf94

🏔️
Hey how's it going
View GitHub Profile
@lf94
lf94 / mecrisp-led.fth
Last active May 8, 2024 23:12
WeAct STM32F103C8T6
\ pins
: port.b $40010C00 ;
: port.b.odr port.b $C + ;
: pb2.init 8 lshift port.b ;
: pb2.out 2 lshift port.b.odr ;
\ device
: blue-led.init %0010 pb2.init ! ;
: blue-led.on -1 pb2.out ! ;
: blue-led.off 0 pb2.out ! ;
@lf94
lf94 / fabyu.zig
Created May 6, 2024 14:12
A time-based terminal subtitle player written in Zig.
const std = @import("std");
const io = std.io;
const fs = std.fs;
const mem = std.mem;
const fmt = std.fmt;
const time = std.time;
const math = std.math;
const process = std.process;
pub fn main() !void {
\ Here lies a true exercise for my Forth studies.
\ Translated from pseudo-code data:text/plain;base64,Tm90ZSAxOiBBbGwgdmFyaWFibGVzIGFyZSAzMiBiaXQgdW5zaWduZWQgaW50ZWdlcnMgYW5kIGFkZGl0aW9uIGlzIGNhbGN1bGF0ZWQgbW9kdWxvIDIzMgpOb3RlIDI6IEZvciBlYWNoIHJvdW5kLCB0aGVyZSBpcyBvbmUgcm91bmQgY29uc3RhbnQga1tpXSBhbmQgb25lIGVudHJ5IGluIHRoZSBtZXNzYWdlIHNjaGVkdWxlIGFycmF5IHdbaV0sIDAg4omkIGkg4omkIDYzCk5vdGUgMzogVGhlIGNvbXByZXNzaW9uIGZ1bmN0aW9uIHVzZXMgOCB3b3JraW5nIHZhcmlhYmxlcywgYSB0aHJvdWdoIGgKTm90ZSA0OiBCaWctZW5kaWFuIGNvbnZlbnRpb24gaXMgdXNlZCB3aGVuIGV4cHJlc3NpbmcgdGhlIGNvbnN0YW50cyBpbiB0aGlzIHBzZXVkb2NvZGUsCiAgICBhbmQgd2hlbiBwYXJzaW5nIG1lc3NhZ2UgYmxvY2sgZGF0YSBmcm9tIGJ5dGVzIHRvIHdvcmRzLCBmb3IgZXhhbXBsZSwKICAgIHRoZSBmaXJzdCB3b3JkIG9mIHRoZSBpbnB1dCBtZXNzYWdlICJhYmMiIGFmdGVyIHBhZGRpbmcgaXMgMHg2MTYyNjM4MAoKSW5pdGlhbGl6ZSBoYXNoIHZhbHVlczoKKGZpcnN0IDMyIGJpdHMgb2YgdGhlIGZyYWN0aW9uYWwgcGFydHMgb2YgdGhlIHNxdWFyZSByb290cyBvZiB0aGUgZmlyc3QgOCBwcmltZXMgMi4uMTkpOgpoMCA6PSAweDZhMDllNjY3CmgxIDo9IDB4YmI2N2FlODUKaDIgOj0gMHgzYzZlZjM3MgpoMyA6PSAwe
@lf94
lf94 / bad.py
Created January 16, 2024 02:41
import cadquery as cq
# Parameters for the bearing
outer_diameter = 22.0 # Outer diameter of the bearing
inner_diameter = 8.0 # Inner diameter of the bearing
width = 7.0 # Width of the bearing
ball_diameter = 4.0 # Diameter of the bearing balls
number_of_balls = 7 # Number of balls in the bearing
# Create the outer race
outer_race = (
cq.Workplane("XY")
@lf94
lf94 / weird.py
Created January 16, 2024 01:07
weird.py
import cadquery as cq
# Parameters for the cylinder
cylinder_height = 50.0
cylinder_radius = 20.0
# Parameters for the rectangular cutouts
cutout_width = 5.0
cutout_height = 10.0
cutout_depth = 10.0
# Create the base cylinder
cylinder = cq.Workplane("XY").cylinder(cylinder_height, cylinder_radius)
@lf94
lf94 / bad.py
Created January 16, 2024 00:06
Prompt: A flowerpot of 10 cm diameter
import cadquery as cq
# Parameters
diameter = 10.0 # Diameter of the flowerpot
height = 10.0 # Height of the flowerpot
thickness = 0.5 # Wall thickness of the flowerpot
bottom_thickness = 0.5 # Bottom thickness of the flowerpot
# Create the outer shell of the flowerpot
outer_shell = cq.Workplane("XY").circle(diameter / 2).extrude(height)
# Create the inner cavity by offsetting the outer shell inwards
inner_shell = (
@lf94
lf94 / ps2-lights-opening.c
Created August 4, 2023 15:24
PS2 OSDSYS opening sequence lights circles
static void
DrawLights(void)
{
int l, i, j, k;
vif1SetZWrite(0);
vif1SetZTest(0);
vif1SetTexture(&textures[TEXID_CRBL]);
for(l = 0; l < 4; l++) {
GitHub changed the world of open-source.
In the beginning it brought together the disconnected programmers who always wanted to work on something with other like-minded people.
In the present it's no longer the foreground. Businesses and professionals connect and the profiles become a bragging ground.
The GH PR system is stretched to its limits. During the early days this was ok: PRs were few and far between. It worked.
I've changed, and so has GitHub. As I grow older I care more about my impact and personal data responsibility. I care about FOSS work being used for profit.
WHEN WILL BROWSERS BE COMPLETE?
A short exploration into the end game of web browsers.
This article may seem to be about bashing Google but it isn't. It's just about
reflecting on the current state and how much longer we should see ourselves
here.
So what is the Web? Well we can agree the Web is a conglomerate of standards
proposed by the W3C. So what do those standards define?
Theorem andb_eq_orb :
forall (b c : bool),
(andb b c = orb b c) ->
b = c.
Proof.
intros b c.
destruct b eqn:Eb.
- destruct c eqn:Ec.
+ reflexivity.