Skip to content

Instantly share code, notes, and snippets.

iskolbin

Block or report user

Report or block iskolbin

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View liquid_celluar.h
#ifndef LIQUID_CELLUAR_H_
#define LIQUID_CELLUAR_H_
#ifndef LC_NO_STDLIB
#include <stdlib.h>
#define LC_MALLOC malloc
#define LC_FREE free
#else
#ifndef LC_MALLOC
#error "No stdlib mode, but LC_MALLOC not defined"
@iskolbin
iskolbin / unpacker.sh
Created Mar 28, 2018
Texture packer unpacker (jq and imagmagick (convert) required)
View unpacker.sh
#!/bin/bash
if [ -z $1 ]; then
echo "Atlas cropper 2018 v666 by Ilya Kolbin"
echo "Usage: ./crop_atlas.sh <atlas.json> <output_path>"
echo "Atlas is json like {"frames":{<filename>:<frame>:{x,y,w,h}}}"
fi
IMG=$(cat $1 | jq -j ".meta.image")
View AtlasSplit.py
#!/usr/bin/env python
from PIL import Image
import os
import sys
from xml.dom import minidom
def main():
if len( sys.argv ) < 2:
@iskolbin
iskolbin / pairingheap.lua
Created Feb 28, 2018
Persistent Pairing Heap in Lua
View pairingheap.lua
local PairingHeap = {}
function PairingHeap.make()
return {}
end
function PairingHeap.merge( self, other )
if not self or self[2] == nil then
return other
elseif not other or other[2] == nil then
@iskolbin
iskolbin / define.js
Created May 10, 2017
Tiny AMD define implementation only for fast prototyping purposes. Working only in browsers
View define.js
(function(){var b=window;b.define=function(c,a,d){a=[,b[c]||{}].concat(a.slice(2).map(function(a){b[a]=b[a]||{};return b[a]}));d.apply(null,a);b[c]=a[1]}})();
@iskolbin
iskolbin / luabsp.lua
Created Jul 19, 2016
Lua BSP room generation
View luabsp.lua
local unpack, floor, random = table.unpack or unpack, math.floor, math.random
local Bsp = {}
function Bsp.splitTree( x, y, w, h, l, kwargs )
local maxlevel = kwargs.maxlevel or 4
local deviation = kwargs.leafdeviation or 0.1
if w < 4 or h < 4 or l > maxlevel then
return {x,y,w,h}
else
You can’t perform that action at this time.