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
| echo '++++[->++++<]>[-<+++++>>+++++++>++<<]<------.>>+++++.--.+.>.<[-<+>>>+ | |
| <<]>[--<++>>-<]>---.+++++++++++++.+.<<<.>>>-------.---.<<<--.>.>>+++.-------.++.++ | |
| [->+<<+>]>++++++.<<.<<.>[-<<->>]<<++++.[>>>--<<<-]>>>+.' | sed -E 's/(.)/\1\n/g' | | |
| awk 'BEGIN{print "BEGIN{p=0;"}END{print "}"}/\./{print "printf \"%c\",a[p]"}/ | |
| \+/{print "a[p]++"}/-/{print "a[p]--"}/</{print "p--"}/>/{print "p++"}/\[/{print | |
| "while(a[p]){"}/\]/{print "}"}' | awk -f /dev/fd/0 |
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
| #!/bin/rc | |
| # This script was written entirely out of perversity: | |
| # it is LLM code-completion for acme under Plan 9. | |
| # It will attempt to fill in a chunk of code under the cursor, | |
| # in acme | |
| # under Plan 9 | |
| # using only tools available in Plan 9 | |
| # to talk to ollama. | |
| # I have mixed the sacred and the profane. | |
| # You just put it in the tag in the acme window, and then you |
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/awk | |
| # Friend on fedi just showed me https://github.com/xonixx/makesure , I speculated that you could do make in ~10 lines of awk. | |
| # You basically can: 9 lines, not counting comments. | |
| # File format is a subset of make, "targ1: dep1 ... depN\n\tline1\n\tline2\ntarg2: ..." | |
| # Invocation is different: `make.awk 'targ=whatever' Makefileish` | |
| # To run it on Plan 9, change /usr/bin/awk to /bin/awk and "stat -c %Y" to just "mtime" | |
| # I have not executed this code; it is a stunt-hack. I just thought it would be funny. | |
| BEGIN{if(!length(targ))targ="all"} | |
| /^\t/{if(length(cur) < 1) { print "no targ"; exit }; ts[cur] = ts[cur] "&&" $0; next } | |
| !NF{cur=""; next} |
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
| conky.config = { | |
| border_width = 1, | |
| cpu_avg_samples = 2, | |
| default_color = 'white', | |
| minimum_width = 5, | |
| default_graph_width = 200, | |
| default_graph_height = 40, | |
| default_gauge_width = 200, | |
| alignment = 'top_left', | |
| background = false, |
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
| BEGIN { | |
| # X40-X44 is accidental overdose. | |
| # X60-X64 is intentional (i.e., suicide) | |
| # Y10-Y14 is unknown intent. | |
| for(i = 0; i < 5; i++) { | |
| cs["X4" i]++ | |
| cs["X6" i]++ | |
| cs["Y1" i]++ | |
| } | |
| for(i in cs) |
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
| # This gives you the ability to do | |
| # git tag -a -m '1.0' 1.0 | |
| # make upload-release-1.0 | |
| # Written off the top of my head and not tested. | |
| # Use at your own peril. | |
| .PHONY: release | |
| release: | |
| mkdir -p release |
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
| class SomeMiddleware | |
| attr_accessor :app | |
| def initialize app | |
| # The arguments passed to use() will end up here. | |
| self.app = app | |
| end | |
| def call env | |
| # This gets called when there's a request. It |
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
| #!/dis/sh | |
| load std regex | |
| drx = '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]' | |
| cfn = `{ls tw-days|sort -r|sed 1q} | |
| dn = `{basename $cfn .log} | |
| echo -n > $cfn | |
| sed -n ( | |
| '/^! day changed, ' ^ $dn ^ '/,$ { s///g; s/$/\n/; p; }' |
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
| implement A; | |
| include "sys.m"; sys: Sys; | |
| include "draw.m"; | |
| A: module { | |
| init: fn(nil: ref Draw->Context, nil: list of string); | |
| }; | |
| init(nil: ref Draw->Context, nil: list of string) |
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
| I was waiting for a Linux kernel to build. It seems to take | |
| longer to configure a new kernel every time, like the number | |
| of options have been steadily increasing. I thought I might | |
| be hallucinating, you know? Maybe I have just gotten | |
| impatient and the bloat wasn't that bad. Or maybe it is | |
| the case that the options have gotten horribly numerous and | |
| increasingly arcane. In any case, I did this: | |
| for m in $list_of_linux_machines_here; do | |
| ssh $m wc -l '/usr/src/linux-*/.config' |
NewerOlder