Skip to content

Instantly share code, notes, and snippets.

View benaryorg's full-sized avatar

Katze benaryorg

View GitHub Profile
@benaryorg
benaryorg / flake.nix
Created February 27, 2024 20:29
Firefox 123.0 X cursor issue
# reproduces the issue mentioned in https://github.com/NixOS/nixpkgs/pull/289987
{
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11";
inputs.nixpkgs-good.url = "github:NixOS/nixpkgs/477c559e96e15e993a523173e9ea5ef6a04f6885";
inputs.nixpkgs-bad.url = "github:NixOS/nixpkgs/a56230f51fe59a583b0ed7e688e7a1dc1802f4a3";
outputs = { nixpkgs, nixpkgs-good, nixpkgs-bad, ... }:
{
nixosConfigurations.test = nixpkgs.lib.nixosSystem
{
@benaryorg
benaryorg / main.rs
Last active October 5, 2023 18:40
Markdown parsing (link and parenthesis)
// see fediverse thread: https://astolfo.social/notes/9kgqfhd4f9gqlh39
//
// Written by @benaryorg with the idea of enforcing balanced parens in links, following guideline:
//
// I think the easiest, best, and most incorrect solution would be to enforce balanced parens in the links.
use ::
{
nom::
{
@benaryorg
benaryorg / pishock
Last active August 29, 2023 22:19
pishock shocking CLI for zsh
#!/usr/bin/env zsh
set -e
usage() {
cat <<END
Usage: $0 [-v] [-i INTENSITY] [-d DURATION]
Uses configuration files in XDG directories to shock using the pishock API.
Create a symlink to this file called "user-shock" where "user" is a name you choose.
@benaryorg
benaryorg / README.md
Created February 6, 2022 13:32
How to convert source code to a format suitable for pasting into Mumble('s source code tab).

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?

use canrun::
{
collections::lvec::
{
LVec,
lvec,
member,
},
var, LVar, Goal, unify, all,
};
@benaryorg
benaryorg / run
Last active March 4, 2021 08:49
Risk of Rain 2 server proton runit service
#!/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

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
#!/usr/bin/env zsh
IFS=$'\t'
set -e
while
read -rd $'\t' cmd
do
case "${cmd}" in
HELO)
@benaryorg
benaryorg / unlink-dir.c
Created July 17, 2020 01:24
figuring out some things regarding directories
#include <stdio.h>
union fi
{
unsigned i;
float f;
};
int main(void)
{