Skip to content

Instantly share code, notes, and snippets.

View zgrep's full-sized avatar

Arthur zgrep

View GitHub Profile
@zgrep
zgrep / shopping.html
Last active December 24, 2023 06:09
A poorly written tool for sorting out receipts. Has Walmart receipt import.
<!DOCTYPE html>
<meta charset='utf-8' />
<title>Shopping</title>
<style>
* { margin: 0; padding: 0; }
body {font-family: sans-serif; }
body > div {
display: flex;
width: 100%;
@zgrep
zgrep / bcaes.md
Last active January 4, 2021 21:28
Birthday Cake Age Encoding Standard

Birthday Cake Age Encoding Standard '20

In this day and age, it becomes nigh-on impossible to encode a person's age, by way of candles in a cake, as they get older. The more years a person accrues whilst staying alive, the more candles are necessary to represent their age! This standard aims to create a solution to the problem at hand, by switching from a unary representation of the age, to a binary representation.

This standard is backwards compatible with BCAES17: a valid BCAES17 birthday cake is a valid BCAES20 birthday cake.

Victim

The victim is (or victims are) hereby considered to be the person (or persons) whose birthday is (or birthdays are) currently being celebrated.

@zgrep
zgrep / tex2svg.pl
Last active February 18, 2017 18:13
Turns tex into svg... poorly.
#!/usr/bin/env perl
use warnings;
no warnings 'experimental';
use strict;
use v5.16;
my ($type, $border);
$ARGV[0] = 'nope' unless $ARGV[0];
@zgrep
zgrep / maljson.py
Last active February 3, 2017 19:31
A malcompliant JSON parser. It parses any JSON, especially the kind of JSON that isn't actually JSON.
#!/usr/bin/env python3
# Strings.
escapes = {
't': '\t',
'r': '\r',
'n': '\n',
'b': '\b',
'f': '\f',
@zgrep
zgrep / simplyroot.py
Last active August 24, 2020 18:37
It's an IRC bot that's a root shell.
#!/usr/bin/env python3
from time import sleep
from socket import socket
from subprocess import Popen, STDOUT, PIPE, TimeoutExpired
from random import randrange, choice
import ssl
import os
import signal
<!DOCTYPE html><html>
<style>
* {
margin: 0;
padding: 0;
}
body {
font-family: "Helvetica Neue", "Arial", sans-serif;
width: 700px;
@zgrep
zgrep / xml.py
Last active July 20, 2016 21:53
An XML generator thing for Python. Nice and simple. http://zgrep.org/xml.py
#!/usr/bin/env python3
# A super simple XML thing, made of two classes and a function.
# No error checking, just the bare minimum you need, plus a little extra.
def sanitize(s):
return s.replace('&', '&amp;')\
.replace('>', '&gt;')\
.replace('<', '&lt;')\
.replace("'", '&apos;')\
@zgrep
zgrep / quine.md
Last active December 10, 2016 20:11
quine

Keybase proof

I hereby claim:

  • I am zgrep on github.
  • I am zgrep (https://keybase.io/zgrep) on keybase.
  • I have a public key ASB18taC_U2tut6p9yy5iWNzPdrCdRVF6Q0OTV-9JEifVgo

To claim this, I am signing this object:

@zgrep
zgrep / wss.p6
Last active August 29, 2015 14:27
Worse Style Sheets
#!/usr/bin/env perl6
# Worse Style Sheets
# A few, small additions to CSS.
#
# some {{ >>
# thing { >> some thing {
# does: stuff; >> does: stuff;
# } >> }
# kitten: meow; >> kitten: meow;