Skip to content

Instantly share code, notes, and snippets.

@ohazi
ohazi / oop.c
Created July 11, 2021 07:02
"Object Oriented Programming" in C
#include <stdint.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
/* This is an example of an object system for C that supports single
@ohazi
ohazi / queue.h
Last active October 27, 2021 07:56
Single producer, single consumer, lock-free queue
#include <stdint.h>
#include <stddef.h>
#include <string.h>
#include <stdatomic.h>
#define NUM_BLOCKS 16
#define BLOCK_SIZE 256
#define SUCCESS 0
#define FAILURE 1

Keybase proof

I hereby claim:

  • I am ohazi on github.
  • I am ohazi (https://keybase.io/ohazi) on keybase.
  • I have a public key ASDJeE0yx3uuA7_5vdDOb3lqwFsXY_enll9hc0clvpf4_Ao

To claim this, I am signing this object:

@ohazi
ohazi / n6check.sh
Created November 13, 2014 21:24
Send yourself an SMS when Nexus 6 is in stock
#!/bin/bash
N6_BLUE_64="https://play.google.com/store/devices/details/Nexus_6_64GB_Midnight_Blue?id=nexus_6_blue_64gb"
while true
do
n6_blue_data=$(wget $N6_BLUE_64 -O - 2> /dev/null)
sanity_check=$(echo $n6_blue_data | wc -c)
if [ $sanity_check -le 50000 ]
then