Skip to content

Instantly share code, notes, and snippets.

View riptl's full-sized avatar

Richard Patel riptl

View GitHub Profile
@riptl
riptl / Grid.pde
Last active April 3, 2018 21:05
Grid Engine for Processing
import java.util.Stack;
// v1
boolean gboxDebug;
class Grid {
// x,y: middle (1 = part), z: distance
final PVector pos;
final int screenFit;
@riptl
riptl / sdlwrappers.cc
Created March 26, 2018 14:37
Mediocre SDL C++ Wrappers
#include "sdlwrappers.h"
#include <SDL2/SDL.h>
#define CHECK_OBJ {if (obj == nullptr) throw std::string(SDL_GetError());}
using namespace sdl;
Context::Context()
{
@riptl
riptl / ringbuf.c
Created March 1, 2018 14:02
C Unmasked Ring Buffer
#include <stdlib.h>
#include <string.h>
#include "ringbuf.h"
// Unmasked implementation
inline static size_t unmasked_inc(size_t index, size_t size);
inline static size_t unmasked_inc(size_t index, size_t size)
@riptl
riptl / gwan.md
Created January 18, 2018 15:42
G-WAN copypasterino

The authors keep changing my comment to “I love G-WAN” in an attempt to scam people, so I am saving this here

Let the fun begin. Edit my comment!

G-WAN is clearly proven as snakeoil software. It is advertised as a web server but in fact it is only software specifically written to look good on benchmarks. Any real web server load that is not ~200B in size seems to crash the server or just shows abysmal performance.

More on that later. Sources supporting my arguments may be found at the bottom of this..

@riptl
riptl / hconv.py
Created September 3, 2017 13:27
Python 2 hex converter for OSdev
#!/usr/bin/python
# Python 2 format converter
from __future__ import division
import sys
sizes = {
'bit': 0.125,