Skip to content

Instantly share code, notes, and snippets.

Avatar

Katze benaryorg

View GitHub Profile
@benaryorg
benaryorg / README.md
Created Feb 6, 2022
How to convert source code to a format suitable for pasting into Mumble('s source code tab).
View README.md

What?

Sometimes you just want to paste some source code into Mumble and have the others be able to read it properly.

Why?

But sometimes you're also like me and don't mind going two extra steps to give those peers some syntax highlighting.

And then?

View main.rs
use canrun::
{
collections::lvec::
{
LVec,
lvec,
member,
},
var, LVar, Goal, unify, all,
};
@benaryorg
benaryorg / run
Last active Mar 4, 2021
Risk of Rain 2 server proton runit service
View run
#!/bin/sh
# Copyright (c) 2021 benaryorg <binary@benary.org>
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
View README.md

How to use?

Call the script with .eml files as parameters and it'll print all the Patreon links on stdout, separated by newlines. On stderr it will print all the files which did not contain links to posts, e.g. direct message notifications from content creators.

If you want to read all your unread patreon posts without having to scroll down too far (which is really awful on patreon.com), you could save all your unread emails (e.g. in Thunderbird, note: in Thunderbird this will mark them as read) to a directory and then do that:

./this_script.py *.eml | xargs -n 1 xdg-open
View lxd-pdns-pipe.sh
#!/usr/bin/env zsh
IFS=$'\t'
set -e
while
read -rd $'\t' cmd
do
case "${cmd}" in
HELO)
@benaryorg
benaryorg / unlink-dir.c
Created Jul 17, 2020
figuring out some things regarding directories
View unlink-dir.c
View float.c
#include <stdio.h>
union fi
{
unsigned i;
float f;
};
int main(void)
{
View keybase.md

Keybase proof

I hereby claim:

  • I am benaryorg on github.
  • I am katze (https://keybase.io/katze) on keybase.
  • I have a public key whose fingerprint is 6668 5437 4A5D 8843 7FA4 6B44 7A06 724E 5B00 E546

To claim this, I am signing this object:

View discard.c
// somewhat performant discard service I guess.
// listens on localhost:1337 (it's not port 9 since I prefer non-priv users)
//
// compile with something like that:
// clang -Wall -Wextra -Werror -pedantic -std=c11 -O2 -o discard discard.c
#include <err.h>
#include <fcntl.h>
#include <netdb.h>
#include <stdlib.h>