Skip to content

Instantly share code, notes, and snippets.

View stianhoiland's full-sized avatar

Stian Gudmundsen Høiland stianhoiland

View GitHub Profile
#include <assert.h>
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define new(a, n, t) (t *)alloc(a, n, sizeof(t), _Alignof(t))
#define S(s) (Str){(uint8_t *)s, sizeof(s)-1}
@benob
benob / stbttf.h
Last active October 7, 2024 09:47
Example for using stb_truetype with SDL2 renderer. Only supports ASCII characters.
#ifndef __STBTTF_H__
#define __STBTTF_H__
#include <SDL2/SDL.h>
#include "stb_rect_pack.h"
#include "stb_truetype.h"
/* STBTTF: A quick and dirty SDL2 text renderer based on stb_truetype and stdb_rect_pack.
* Benoit Favre 2019
@tomdaley92
tomdaley92 / makefile
Last active November 4, 2024 06:49
Generic makefile for C/C++ programs
# Thomas Daley
# September 13, 2021
# A generic build template for C/C++ programs
# executable name
EXE = app
# C compiler
CC = gcc
@lolzballs
lolzballs / HelloWorld.java
Created March 22, 2015 00:21
Hello World Enterprise Edition
import java.io.FileDescriptor;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintStream;
public class HelloWorld{
private static HelloWorld instance;
public static void main(String[] args){
instantiateHelloWorldMainClassAndRun();
@cbarrett
cbarrett / SSMutableIndexPathSet.h
Created July 19, 2011 18:04
Represent a set of index paths
//
// SSMutableIndexPathSet.h
// MutableIndexPathSet Test
//
// Created by Colin Barrett on 11/19/10.
// Copyright 2010 __MyCompanyName__. All rights reserved.
//
#import <Foundation/Foundation.h>