Skip to content

Instantly share code, notes, and snippets.

View BitStream.pas
unit BitStream;
interface
uses fgl;
type
TBitReader = class
private
FBuffer: PByte;
View stb.c
#define STB_IMAGE_IMPLEMENTATION
#define STB_IMAGE_WRITE_IMPLEMENTATION
#define STBI_ONLY_PNG
#define STBI_ONLY_JPEG
#define STBI_ONLY_BMP
#define STBI_ONLY_GIF
#include "stb_image.h"
#include "stb_image_write.h"
@urraka
urraka / st-alt-hook.c
Created Jul 8, 2015
Keyboard hook for preventing SublimeText from focusing menu when pressing ALT on windows.
View st-alt-hook.c
// gcc -DHOOKDLL -shared -o bin/st-alt-hook.dll st-alt-hook.c
// gcc bin/st-alt-hook.dll -mwindows st-alt-hook.c -o bin/st-alt-hook.exe
#include <windows.h>
#ifdef HOOKDLL
// *************** DLL ***************
static HHOOK hKeyboardHook = 0;
@urraka
urraka / -usage-.php
Last active Mar 25, 2019
Twig extension for correct indentation of the output.
View -usage-.php
<?php
require_once 'vendor/autoload.php'; // or however you load Twig
require_once 'Lexer.php';
require_once 'Indent.php';
$twig = new Twig_Environment(new Twig_Loader_Filesystem('templates'));
$twig->addExtension(new Indent_Twig_Extension());
$twig->setLexer(new Indent_Twig_Lexer($twig));
View .skel2d
skeleton
bone l50
@[red] :circle d30 t0 f#F00
@[blue] :circle d30 t0 f#00F
@line :path
L 0,0:handle
bone.handle
anim "test" 20fps
bone 40:sio
View build.makefile.mk
# overridable variables:
# * project -> defaults to parent dir basename
# * src-root -> defaults to src
# * out-root -> defaults to bin
# * debug -> define it to anything for debug mode
# * platform -> possible values are win32,osx,linux,ios,iossim
# * inc, inc-* -> where * is the platform
# * lib, lib-* -> where * is the platform
# * flg, flg-* -> where * is the platform
# * ios.version -> installed sdk version
@urraka
urraka / build.mk
Last active Aug 29, 2015
makefile for building c/c++ projects
View build.mk
# overridable variables:
# * project -> defaults to parent dir basename
# * src-root -> defaults to src
# * out-root -> defaults to bin
# * debug -> define it to anything for debug mode
# * platform -> possible values are win32,osx,linux,ios,iossim
# * inc, inc-* -> where * is the platform
# * lib, lib-* -> where * is the platform
# * flg, flg-* -> where * is the platform
# * ios.version -> installed sdk version
View triangulate.h
// 2D triangulation using ear clipping by urraka
//
// Usage:
// std::vector<vec2> polygon;
// std::vector<int> result = math::triangulate<int>(polygon);
//
// * vec2 is anything that has float x,y
// * result is a list of indices that point to the polygon vector (a triangle is defined every 3 indices).
#include <vector>