Skip to content

Instantly share code, notes, and snippets.

View roblogic's full-sized avatar
💭
probably playing code golf

Rob Papesch roblogic

💭
probably playing code golf
  • Auckland, NZL
  • 14:16 (UTC +13:00)
View GitHub Profile
@roblogic
roblogic / static
Created November 4, 2020 23:39
fun with @ish_app -- fill screen with technicolor spew
#!/bin/zsh
P=(' ' █ ░ ▒ ▓)
while :;do
printf "\e[9$(( ( RANDOM % 7 ) + 1 ))m\e[$[RANDOM%$LINES+1];$[RANDOM%$COLUMNS+1]f${P[$RANDOM%5]}"
done
@roblogic
roblogic / patt
Last active October 12, 2020 05:22
pattern matcher for doing simon shuker's code-cracker in the nz herald. ".txt" uses data from https://github.com/dolph/dictionary/blob/master/unix-words
#!/bin/sh
[ "$1" ] || { echo "pattern?"; exit; }
patt="$1"
grep -E "^$patt$" *.txt | awk -F: '{print $2}'| sort -u | paste - - - - -
@roblogic
roblogic / .profile
Last active October 12, 2020 05:02
my jazzy iSH profile for iPhone
uname -v
neofetch --off
#resize
set -o vi
export PS1="\w$ "
alias l="ls -alp"
alias ll="ls -alptr|tail -20"
alias ls="ls -p"
rap(){ echo "$(fortune)" \
|tr -d '\t'|tr '\n' ' ' \
@roblogic
roblogic / stan.user.css
Last active February 8, 2024 00:11
messing about with a blog's CSS
/* ==UserStyle==
@name TheStandard ReArranger
@description Change fonts and rearrange random things for fun and $$$
@namespace https://github.com/roblogic
@version 0.1.1-groovy
@author roblogic
@license unlicense
@preprocessor stylus
==/UserStyle== */
@roblogic
roblogic / CP437.md
Last active June 23, 2025 16:19
Code Page 437 / Extended ASCII

CP437 is a ubiquitous character set that appears somewhat obsolete, but is still found everywhere. Usually seen in BIOS, there are no fancy fonts here. Here's the charset, using UTF-8 equivalents.

································ !"#$%&'()*+,-./0123456789:;<=>?
@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~�
ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐
└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ 

Found this useful bash script on stackoverflow.

((!$1))&&<<<"Congratulations on your new baby! :D"&&exit
y=$[$1<0?2:2*$1] a=${(l:y:: $:)} b=${(l:y+1::-:)}
(($1>0))&&echo "$a\n${a//$/|}"
echo "$b\n${b//-/~}\n$b"
43232122 Cossack dancer
___
(_*_)
\(o_O)
(] [)>
(" ")
while read w; do
i=
for ((n=1;i++<#w;n++))[[ $w[i] != $w[i+1] ]]&&printf $n$w[i]&&n=0
echo
done < <(echo "heeeello\nwoooorld")
setopt FORCE_FLOAT
m=$1 n=$1 a=$#
for x ((t+=x))&&m=$[x>m?x:m]&&n=$[x<n?x:n]
s=$[2*(a>2?(t-m-n)/(a-2):t/a)]
<<<$[(s^0+(s-s^0>.5?1:0))/2]
@roblogic
roblogic / btoz85
Last active May 28, 2020 03:23
Z85 encoding implemented in Zsh.. Input: binary string (length 32). Output: Z85 ascii-encoded string (length 5). Spec: https://rfc.zeromq.org/spec:32/Z85/
#!/bin/zsh
# Version 0.00.01 - bare bones only
# Binary to Ascii conversion, using Z85 encoding algorithm
# Similar to Ascii85, few different characters, doesn't use ascii code table
# https://www.johndcook.com/blog/2019/03/05/base85-encoding/
# https://rfc.zeromq.org/spec:32/Z85/
# Example: (input must be 32 characters)
# input 01001101011000010110111000100000
# base85 24 73 80 78 61