Skip to content

Instantly share code, notes, and snippets.

View lf94's full-sized avatar
🏔️
Archived

49fl lf94

🏔️
Archived
  • Internet
View GitHub Profile
-- If LuaRocks is installed, make sure that packages installed through it are
-- found (e.g. lgi). If LuaRocks is not installed, do nothing.
pcall(require, "luarocks.loader")
-- Standard awesome library
local gears = require("gears")
local awful = require("awful")
require("awful.autofocus")
-- Widget and layout library
local wibox = require("wibox")
require-module x11
set global windowing_modules x11
colorscheme black-on-white
# Don't show startup changelog
set-option global startup_info_version 99999999999
# Instead of wrapping on column 80, indicate where it is
# so we know when to "carriage return" like in the days
@lf94
lf94 / git-link-yank.kak
Created October 6, 2024 20:53
Generate GitHub URLs from code selections
\ lf94 / [email protected]
\ I git turmites in me house
\ 2-state 2-color turmite
\ check a condition is true otherwise abort
: assert ( bool -- ) <> abort" not equal" ;
0 constant state.0
1 constant state.1
@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 = (