Skip to content

Instantly share code, notes, and snippets.

// Play with ?ts=<N> in the URL to see the effects of tabs vs spaces.
#define $ /* this macro is purposely blank as a countermeasure to editors that don't support mixed leading tabs/spaces */
switch( v ) {
case A, B:
$ C, D:
// ... code ...
}
@NotKyon
NotKyon / how to compile programs on macOS catalina.md
Created October 22, 2019 03:24
How to compile programs on macOS Catalina
clang++ -isysroot `xcrun --show-sdk-path` -o blah.out blah.cpp
/* read a string from a program's output */
char *mk_com_readprogf(const char *format, ...) {
static char cmd[32768];
static char buf[4096];
static char *out = NULL;
size_t n = 0, m = 0;
FILE *fp = (FILE *)0;
va_list args;
va_start(args, format);
#include <stdio.h>
#include <assert.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <new>
#include <thread>
#include <atomic>
@NotKyon
NotKyon / tile.c
Last active December 12, 2017 08:01
/*
*/
/*
*/ //========================================//
/* // TILE - MINI-ENGINE (TEST) // Tile-1
*/ // (C) Aaron J. Miller, 2012 // GPLv3
/* //========================================//
*/
/*
*/ //this software comes with absolutely no warranty//
@NotKyon
NotKyon / rendering_frames.md
Last active May 8, 2017 02:56
Rendering Frames

Preamble

What this is

This is a document detailing the planned approach for a rendering system I intend to implement, the reasons driving the approach, and the general rationale for the new design.

Who should read this

If you're interested in rendering APIs and want to look at different approaches, this document might be for you. I'm not claiming to be an expert in any field, especially not one as diverse and dynamic as rendering approaches, so treat everything here like I'm building a wall to keep good technology out and making you pay for it. In other words, consider whether better ways might exist and whether either of us are biased toward something.

@NotKyon
NotKyon / gist:4f87cec72c3041b483102e068cc95e62
Created December 3, 2016 02:03
Kill all processes holding a given resource.
lsof | grep "name of file" | egrep -v "COMMAND PID USER" | awk '${print $2}' | sort -n | uniq | xargs kill -9