Skip to content

Instantly share code, notes, and snippets.

View malkia's full-sized avatar

Dimiter 'malkia' Stanev malkia

View GitHub Profile
@malkia
malkia / .emacs
Created April 11, 2012 22:34
.emacs
(server-start)
(require 'package)
(package-initialize)
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
@malkia
malkia / safe_array.lua
Created April 24, 2012 17:18 — forked from stevedonovan/safe_array.lua
This defines an array with strict bounds checking. It is also impossible to set any existing index to a nil value, so the array remains free of holes. The table functions will not work on such arrays because they are userdata, giving an extra layer of pro
local function out_of_range(i,n)
if type(i) == 'number' then
if i > 0 and i <= n then return true
else error('out of range',3)
end
else
error 'cannot index array by non-number type'
end
end
@malkia
malkia / winxp-sp3-msvcrt.exports
Created June 6, 2012 00:33
Windows XP 2002 Professional MSVCRT.DLL exports (depends c:\windows\system32\msvcrt.dll)
__non_rtti_object::__non_rtti_object(class __non_rtti_object const &)
__non_rtti_object::__non_rtti_object(char const *)
bad_cast::bad_cast(char const * const *)
bad_cast::bad_cast(char const * const &)
bad_cast::bad_cast(class bad_cast const &)
bad_cast::bad_cast(char const *)
bad_typeid::bad_typeid(class bad_typeid const &)
bad_typeid::bad_typeid(char const *)
exception::exception(char const * const &)
exception::exception(class exception const &)
@malkia
malkia / lua51-x86-msvcrt.imports
Created June 6, 2012 00:36
Imports of all msvcrt.dll functions from lua51.dll
_CIcosh
_CIsinh
_CItanh
_XcptFilter
__CxxFrameHandler
__badioinfo
__dllonexit
__lc_codepage
__lc_collate_cp
__lc_handle
@malkia
malkia / dotkey.lua
Created June 6, 2012 23:04
Returns the value of a dot encoded key from the table t
local dotkey = {}
----------------------------------------------------------
-- Returns the value of a dot encoded key from the table t
-- Returns nil if the key is not found.
-- Example: local t = { one = { two = 12 } }
-- print( dotkey.get( t, "one.two" ) ) -- prints 12
function dotkey.get(t, key)
local b, s, p = string.byte, string.sub, 1
for i=1, key:len()+1 do
@malkia
malkia / ray-stack.lua
Created July 5, 2012 05:21 — forked from geoffleyland/ray-stack.lua
Raytrace avoiding vector objects
local sqrt = math.sqrt
local huge = math.huge
local delta = 1
while delta * delta + 1 ~= 1 do
delta = delta * 0.5
end
-- vectors -------------------------------------------------------------------
@malkia
malkia / ray-object.lua
Created July 5, 2012 05:21 — forked from geoffleyland/ray-object.lua
Raytrace using vector objects
local sqrt = math.sqrt
local huge = math.huge
local delta = 1
while delta * delta + 1 ~= 1 do
delta = delta * 0.5
end
-- vectors -------------------------------------------------------------------
@malkia
malkia / bolo-again.txt
Created September 19, 2012 06:46
bolo again
OpenGL - glfw, regal, cairo
GLESv2 - egl, gles2, cairo-gles2
@malkia
malkia / ProFi.lua
Created December 2, 2012 07:59 — forked from perky/ProFi.lua
ProFi, a simple lua profiler that works with LuaJIT and prints a pretty report file in columns.
--[[
ProFi v1.3, by Luke Perkin 2012. MIT Licence http://www.opensource.org/licenses/mit-license.php.
Example:
ProFi = require 'ProFi'
ProFi:start()
some_function()
another_function()
coroutine.resume( some_coroutine )
ProFi:stop()
#include <type_traits>
#include <iostream>
#include <cassert>
#include <cstdint>
#include "murmur3_32_constexpr.hpp"
// Add compilers here
#define UNKNOWN -1
#define GCC 0
#define CLANG 1