View is_z80.sh
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
#!/bin/bash | |
# is_z80 - guess if a binary is z80 or 8080 | |
# from frequency of two-byte Z80 instructions | |
# scruss, 2023-02 | |
# this might need gnu awk. Needs bc for sure | |
file="$1" | |
if | |
[ "$#" -eq 0 ] |
View hootnanny-cleaned_up.py
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
#!/usr/bin/env python3 | |
# hootnanny.py - simulate Hoot-Nanny / Magic Designer drawing toy | |
# Currently hard-coded to output figure "25KM" in HP-GL, | |
# a simple but somewhat obsolete plotting language. | |
# Output figures as close to actual sizes as I could manage. | |
# All dimensions in inches, unfortunately, but HP-GL is bilingual. | |
# scruss, 2022-02 - code cleanup - 2022-12 | |
# Licence: CC-BY-SA - share freely, but credit me and make your | |
# improvements freely available for all | |
# -*- coding: utf-8 -*- |
View chamfer_extrude.scad
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
module chamfer_extrude(height = 2, angle = 10, center = false) { | |
/* | |
chamfer_extrude - OpenSCAD operator module to approximate | |
chamfered/tapered extrusion of a 2D path | |
(C) 2019-02, Stewart Russell (scruss) - CC-BY-SA | |
NOTE: generates _lots_ of facets, as many as | |
6 * path_points + 4 * $fn - 4 |
View STBEESSP.BAS
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
10 REM St Bees - scruss, 2022-06 - SPO256-AL2 emu on RC2040, CP/M MBasic | |
20 KAL$="PA1PA2PA3PA4PA5/OY/AY/EH/KK3/PP/JH/NN1/IH/TT2/RR1/AX/MM/TT1/DH1/IY/EY/DD1/UW1/AO/AA/YY2/AE/HH1/BB1/TH/UH/UW2/AW/DD2/GG3/VV/GG1/SH/ZH/RR2/FF/KK2/KK1/ZZ/NG/LL/WW/XR/WH/YY1/CH/ER1/ER2/OW/DH2/SS/NN2/HH2/OR/AR/YR/GG2/EL/BB2/" | |
30 ALV$="00*01*02*03*04*05*06*07*08**09*10*11**12*13**14**15*16*17**18**19*20*21**22**23*24*25**26*27**28**29*30*31**32*33**34**35*36**37*38*39**40*41**42**43*44*45*46*47*48*49**50*51**52**53*54**55*56**57**58*59*60*61**62*63***" | |
40 DEF FNLOOKUP$(N$)=LEFT$(RIGHT$(ALV$,LEN(KAL$)-INSTR(KAL$,N$)+1),2) | |
50 READ PHON$,TEXT$ | |
60 IF PHON$="end" THEN GOTO 175 | |
70 PRINT "(";TEXT$;")" | |
80 WHILE (LEN(PHON$)>0) | |
90 SPCPOS%=INSTR(PHON$," ") | |
100 IF SPCPOS%=0 THEN P$=PHON$:PHON$="" ELSE P$=LEFT$(PHON$,SPCPOS%-1):PHON$=RIGHT$(PHON$,LEN(PHON$)-SPCPOS%) |
View collatz-memo.pl
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
#!/usr/bin/env perl | |
# collatz-memo.pl | |
# run time: appx 7 s | |
# output: max: 8400511 steps: 685 | |
use v5.20; | |
use strict; | |
use warnings; | |
my ( $maxsteps, $maxval, $n, $steps, $x ) = qw/0 0 0 0 1/; | |
my @s; |
View quakerdate.sh
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
#!/usr/bin/env bash | |
# quakerdate - use GNU date to generate Quaker (Society of Friends) | |
# customary date format. Any args will be passed as the date to print | |
# scruss, 2022-09 | |
# Mon 26 Sep 2022 -> Second day, the twenty-sixth of ninth month 2022 | |
ordinals=(none First Second Third Fourth Fifth Sixth Seventh Eighth \ | |
Ninth Tenth Eleventh Twelfth Thirteenth Fourteenth \ | |
Fifteenth Sixteenth Seventeenth Eighteenth Nineteenth \ | |
Twentieth Twenty-first Twenty-second Twenty-third \ |
View art_data.c
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
/* Copyright (c) 1987 Bellcore | |
* All Rights Reserved | |
* Permission is granted to copy or use this program, EXCEPT that it | |
* may not be sold for profit, the copyright notice must be reproduced | |
* on copies, and credit should be given to Bellcore where it is due. | |
* BELLCORE MAKES NO WARRANTY AND ACCEPTS NO LIABILITY FOR THIS PROGRAM. | |
*/ | |
/* $Header: art_data.c,v 4.2 88/06/22 14:37:09 bianchi Exp $ | |
$Source: /tmp/mgrsrc/demo/misc/RCS/art_data.c,v $ | |
*/ |
View ThePrimeMinisterWontResign-OliverDarkshire.py
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
#!/usr/bin/env python3 | |
# | |
# Implementation of Oliver Darkshire's one page RPG | |
# "The Prime Minister Won't Resign", published 2022-07-08 | |
# https://twitter.com/deathbybadger/status/1545372201402114049 | |
# | |
# written in deliberately simple python by scruss, 2022-07 | |
# -*- coding: utf-8 -*- | |
import random |
View computer_literacy_helvetica_outline.ps
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
%!PS-Adobe-2.0 | |
%%BoundingBox: 36 400 286 550 | |
%%HiResBoundingBox: 35.999999 399.995988 286.001991 550.007983 | |
%%Title: modified from Blue Book Program 16, on page 203 | |
%%EndComments | |
% scruss, 2022-05 | |
% see https://stardot.org.uk/forums/viewtopic.php?f=3&t=24845 | |
/makeoutlinedict 7 dict def |
View esc-pos-image.py
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
#!/usr/bin/env python3 | |
# esc-pos-image.py - print image files given as command line arguments | |
# to simple ESC-POS image on stdout | |
# scruss - 2014-07-26 - WTFPL (srsly) | |
# - 2021-01-09 (made python3 compatible - tvm Carko!) | |
# if you want a proper CUPS driver for a 58mm thermal printer | |
# that uses this command set, go here: | |
# https://github.com/klirichek/zj-58 |
NewerOlder