This file contains hidden or 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
10 ' nevergon.bas | |
20 PLAY "t114" | |
30 ' we're no strangers to love | |
40 PLAY "l8 deffge. l16 d l2 c. l4 p4." | |
50 ' you know the rules and so do i | |
60 PLAY "l8 ddef l4 d l8 c>c p8 c< l2 g " | |
70 ' a full commitment's what i'm thinking of | |
80 PLAY "l8 p4 ddefdfg p8 ed l4 c. p4." | |
90 ' you wouldn't get this from any other guy | |
100 PLAY "l8 ddefd l4 c l8 ggga l4 g p4 " |
This file contains hidden or 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
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
import sys | |
from PIL import Image | |
import PIL.ImageOps | |
import numpy as np | |
# give usage and exit if no arguments | |
if len(sys.argv) == 1: |
This file contains hidden or 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
alias beats='echo '\''@'\''$(TZ=GMT-1 date +'\''(%-S + %-M * 60 + %-H * 3600) / 86.4'\''|bc)' |
This file contains hidden or 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
// asanoha pattern - scruss, 2025-06 | |
// pic: https://xoxo.zone/@scruss/114617440365223683 | |
h=30; | |
r32=sqrt(3)/2; | |
eps=1e-4; | |
spot_dia = 2*h/25; | |
module up_triang() { | |
translate([cos(30)*(h/2)/r32,sin(30)*(h/2)/r32])for(i=[0:2]) { |
This file contains hidden or 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
// hoot-nanny paper - scruss, 2022-02 | |
$fn = 192; | |
in = 25.4; | |
paper_diameter = in * (5 + 3 / 4); // 146.050 mm | |
hole_diameter = in / 4; // 6.350 mm | |
hole_pcd = in * (5 + 29 / 32); // 150.019 mm | |
difference() { | |
circle(d = paper_diameter); |
This file contains hidden or 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
// do simpler n-gons print more quickly? | |
// scruss, 2025-03 - OpenSCAD | |
// after: https://fosstodon.org/@linux_mclinuxface/114151938845634308 | |
// n-gon area, given n and radius | |
function a(n, r) = (1 / 2) * n * r * r * sin(360 / n); | |
// n-gon radius, given n and area | |
function r(n, a) = sqrt(2 * a / (n * sin(360 / n))); | |
height = 10; |
This file contains hidden or 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
// kite for rotation square thingy - scruss, 2025-02 | |
/* | |
ECHO: "b:", 14.4721 | |
ECHO: "h:", 5.52786 | |
ECHO: "h+b:", 20 | |
ECHO: "(h+b)^2:", 400 | |
ECHO: "b-h:", 8.94427 | |
ECHO: "(b-h)^2:", 80 | |
ECHO: "Part area:", 80 |
This file contains hidden or 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
# benchmark Mandelbrot set (aka Brooks-Matelski set) on OLED | |
# scruss, 2025-01 | |
# MicroPython | |
# -*- coding: utf-8 -*- | |
from machine import Pin, I2C, idle, reset, freq | |
# from os import uname | |
from sys import implementation | |
from ssd1306 import SSD1306_I2C |
This file contains hidden or 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
REM --- Music | |
REM --- Reads easy to generate music commands and plays them. | |
REM --- Any four voice song can be played by simply changing the | |
REM --- DATA statements after the label Song: | |
DEFINT A-Z | |
REM --- Display Picture | |
OPEN "MusicPict" FOR INPUT AS 1 | |
PICTURE (100,50),INPUT$(LOF(1),1) |
This file contains hidden or 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
# -*- coding: utf-8 -*- | |
# scruss, 2024-12 | |
# MicroPython | |
""" | |
a very simple Cheerlights MQTT client for MicroPython | |
Uses Peter Hinch's MicroPython Asynchronous MQTT library | |
— https://github.com/peterhinch/micropython-mqtt/ | |
Install it with: | |
mpremote mip install github:peterhinch/micropython-mqtt |
NewerOlder