Skip to content

Instantly share code, notes, and snippets.

@gkbrk
gkbrk / encode-json.py
Created December 3, 2019 03:08
JSON Encoder - unbird example
def check_encode(value):
import json
return json.loads(encode(value)) == value
def encode(value):
if isinstance(value, bool):
if value:
return "true"
else:
@gkbrk
gkbrk / server.c
Created June 25, 2021 22:31
Chat server using the poll() API
#include <arpa/inet.h>
#include <poll.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/socket.h>
#include <unistd.h>
@gkbrk
gkbrk / main.c
Last active January 15, 2022 00:02
Thanos-snap half of your files out of existence
#define _XOPEN_SOURCE 500
#include <assert.h>
#include <dirent.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/types.h>
@gkbrk
gkbrk / Program.cs
Created December 26, 2023 08:35
RBU time signal demodulator
// Leo's RBU time signal demodulator (2023-12-25)
// Copyright (C) 2023 Gokberk Yaltirakli (gkbrk.com)
// - https://en.wikipedia.org/wiki/RBU_(radio_station)
// - https://www.sigidwiki.com/wiki/RBU
// Tune to 66.0 kHz
// http://websdr.ewi.utwente.nl:8901/?tune=66.0
// To compile, just `dotnet build -c Release`. To run, `dotnet run -c Release`.