This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 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") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def git-link-yank %{ | |
nop %sh{ | |
url="$(git remote get-url origin | sed -e 's/:/\//' -e 's/git@/https:\/\//' -e 's/\.git//')/blob" | |
branch="/$(git status -b --porcelain=v2 | grep branch.oid | cut -d ' ' -f 3)" | |
top=$(git rev-parse --show-toplevel | sed 's/\//\\\//g') | |
path=$(echo -n "$kak_buffile" | sed "s/$top//") | |
line1="#L$(echo $kak_selection_desc | sed 's/\..*$//')" | |
line2="-L$(echo $kak_selection_desc | cut -d ',' -f 2 | sed 's/\..*$//')" | |
printf "%s%s%s%s" "$url" "$branch" "$path" "$line1" "$line2" | xsel -b | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\ 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\ 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 ! ; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\ Here lies a true exercise for my Forth studies. | |
\ Translated from pseudo-code data:text/plain;base64,Tm90ZSAxOiBBbGwgdmFyaWFibGVzIGFyZSAzMiBiaXQgdW5zaWduZWQgaW50ZWdlcnMgYW5kIGFkZGl0aW9uIGlzIGNhbGN1bGF0ZWQgbW9kdWxvIDIzMgpOb3RlIDI6IEZvciBlYWNoIHJvdW5kLCB0aGVyZSBpcyBvbmUgcm91bmQgY29uc3RhbnQga1tpXSBhbmQgb25lIGVudHJ5IGluIHRoZSBtZXNzYWdlIHNjaGVkdWxlIGFycmF5IHdbaV0sIDAg4omkIGkg4omkIDYzCk5vdGUgMzogVGhlIGNvbXByZXNzaW9uIGZ1bmN0aW9uIHVzZXMgOCB3b3JraW5nIHZhcmlhYmxlcywgYSB0aHJvdWdoIGgKTm90ZSA0OiBCaWctZW5kaWFuIGNvbnZlbnRpb24gaXMgdXNlZCB3aGVuIGV4cHJlc3NpbmcgdGhlIGNvbnN0YW50cyBpbiB0aGlzIHBzZXVkb2NvZGUsCiAgICBhbmQgd2hlbiBwYXJzaW5nIG1lc3NhZ2UgYmxvY2sgZGF0YSBmcm9tIGJ5dGVzIHRvIHdvcmRzLCBmb3IgZXhhbXBsZSwKICAgIHRoZSBmaXJzdCB3b3JkIG9mIHRoZSBpbnB1dCBtZXNzYWdlICJhYmMiIGFmdGVyIHBhZGRpbmcgaXMgMHg2MTYyNjM4MAoKSW5pdGlhbGl6ZSBoYXNoIHZhbHVlczoKKGZpcnN0IDMyIGJpdHMgb2YgdGhlIGZyYWN0aW9uYWwgcGFydHMgb2YgdGhlIHNxdWFyZSByb290cyBvZiB0aGUgZmlyc3QgOCBwcmltZXMgMi4uMTkpOgpoMCA6PSAweDZhMDllNjY3CmgxIDo9IDB4YmI2N2FlODUKaDIgOj0gMHgzYzZlZjM3MgpoMyA6PSAwe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 = ( |
NewerOlder