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:
I hereby claim:
To claim this, I am signing this object:
| // 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> |
| #!/usr/bin/env vim | |
| option=value |
| use std::io::BufRead; | |
| use std::io::BufReader; | |
| use std::io::Write; | |
| use std::net::Ipv4Addr; | |
| use std::net::TcpListener; | |
| use std::net::TcpStream; | |
| fn main() -> std::io::Result<()> | |
| { | |
| let listen = try!(TcpListener::bind(("::",1337))); |
| #!/usr/bin/env zsh | |
| curl -sf https://me.benary.org \ | |
| | jq -f <(tail -n +$(( ${LINENO} + 2 )) ${(%):-%N}) | |
| exit | |
| # BEGIN JQ SCRIPT | |
| "\(.me.name[0]) (\(.me.pronoun))" |
| #!/usr/bin/env zsh | |
| # you can then forward the port pretty well using ssh -NR | |
| # port to listen on | |
| port=1337 | |
| ### | |
| # | |
| # print error to stderr and return negative error code for chaining |
| #!/usr/bin/env zsh | |
| artist="${1?}" | |
| title="${2?}" | |
| album="${3?}" | |
| awesome-client <<END | |
| naughty = require("naughty") | |
| naughty.notify({title="MoC",text=$(jq -R . <<<"#np ${artist} – ${title} (${album})")}) | |
| END |
| extern crate regex; | |
| use std::env; | |
| use std::fs::File; | |
| use std::io::BufRead; | |
| use std::io::BufReader; | |
| use std::time::Instant; | |
| use regex::Regex; |
| #!/usr/bin/env python3 | |
| import sys | |
| def xor_to(to,cur=0,acc=0): | |
| cur+=1 | |
| if cur > to: | |
| return acc | |
| acc^=cur |
| #include <stdio.h> | |
| #include <assert.h> | |
| #include <stdlib.h> | |
| #define xor_to(x) _xor_to((x),0,0) | |
| long long _xor_to(long long to,long long cur,long long acc) | |
| { | |
| cur+=1; | |
| if(cur > to) | |
| { |