Skip to content

Instantly share code, notes, and snippets.

@paskozdilar
paskozdilar / promisify.ts
Last active September 10, 2024 07:36
Promise-based wrapper around @grpc/grpc-js API.
/**
* Promise-based wrapper around @grpc/grpc-js API.
*
*
* USAGE:
*
* let client: grpc.Client;
*
* // unary
* let response: ResponseType = await UnaryCall(client, client.unaryMethod, request)
@paskozdilar
paskozdilar / detect-mp3-bitrate.sh
Last active August 21, 2024 14:14
Detect true mp3 bitrate
#!/usr/bin/env bash
set -euo pipefail
function main() {
# Check for argument
if [ $# -ne 1 ]
then
echo "usage: $0 INFILE"
exit 1
@paskozdilar
paskozdilar / middleware.go
Last active April 20, 2024 21:40
TCP line-based middleware in Go
package main
/**
* Simple line-based TCP middleware.
*
* Server protocol:
* send: "server"
* send: server_id
* LOOP:
* recv: request
* send: response
@paskozdilar
paskozdilar / main.c
Created February 18, 2024 20:48
Random Dungeon Generator - de-obfuscated
/**
* NetHack-style dungeon generator.
*
* De-obfuscated version of:
* https://gist.github.com/munificent/b1bcd969063da3e6c298be070a22b604
*
* Modify the #define parameters to change the dungeon and cave size.
*/
#include <time.h>
#include <stdio.h>

Keybase proof

I hereby claim:

  • I am paskozdilar on github.
  • I am paskozdilar (https://keybase.io/paskozdilar) on keybase.
  • I have a public key ASDM5FmiVa4Ui6DalXMaw7KUiwXR9FGGym-Cg-CZc_S9xQo

To claim this, I am signing this object: