Skip to content

Instantly share code, notes, and snippets.

@rioki
rioki / build_detect_platform
Last active Dec 27, 2015
leveldb Windows port
View build_detect_platform
#!/bin/sh
#
# Detects OS we're compiling on and outputs a file specified by the first
# argument, which in turn gets read while processing Makefile.
#
# The output will set the following variables:
# CC C Compiler path
# CXX C++ Compiler path
# PLATFORM_LDFLAGS Linker flags
# PLATFORM_LIBS Libraries flags
View entity_component_node.cpp
class Entity
{
private:
void add_component(Component* c)
{
components.push_back(c);
c->entity = this;
}
View gl4scafold.c
#include <stdio.h>
#include <SDL.h>
#include <SDL_image.h>
#include <GL/glew.h>
#include <glt.h>
#define TITLE "OpenGL 4.0 Scaffold"
#define WIDTH 1024
#define HEIGHT 768
@rioki
rioki / uv-bundle.bat
Created Feb 25, 2017
libuv Visual Studio Bundle generator
View uv-bundle.bat
echo off
rem
rem libuv Visual Studio Bundle generator
rem Copyright 2017 Sean Farrell
rem
rem DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
rem Version 2, December 2004
rem
rem Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
@rioki
rioki / Makefile
Created Oct 26, 2012
Ultimate C++ Library Makefile
View Makefile
PACKAGE = myproj
VERSION = 0.0.0
CXX ?= g++ -std=c++0x
CXXFLAGS += -Iinclude -DVERSION=\"$(VERSION)\"
LDFLAGS +=
prefix ?= /usr/local
headers = $(wildcard include/*.h)
lib_hdr = $(wildcard src/*.h)
View ObjParser.cpp
//
// OBJ Parser
//
// Copyright (c) 2014 Sean Farrell
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
View main.c
#include <stdio.h>
#include "test.h"
int register_parse_tests();
int main(int argc, char*argv[])
{
int r = 0;
r = register_parse_tests();
View ThreadPool.cpp
//
// Copyright (c) 2015 Sean Farrell
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
View round_robin.h
// Copyright 2019 Sean Farrell <sean.farrell@rioki.org>
// This work is free. You can redistribute it and/or modify it under the
// terms of the Do What The Fuck You Want To Public License, Version 2,
// as published by Sam Hocevar. See http://www.wtfpl.net/ for more details.
#ifndef _ROUND_ROBIN_H_
#define _ROUND_ROBIN_H_
#include <array>
View PidController.cpp
// PID Controller
// Copyright 2017 Sean Farrell <sean.farrell@rioki.org>
//
// This program is free software. It comes without any warranty, to
// the extent permitted by applicable law. You can redistribute it
// and/or modify it under the terms of the Do What The Fuck You Want
// To Public License, Version 2, as published by Sam Hocevar.
// See http://www.wtfpl.net/ for more details.
#include "PidController.h"