Skip to content

Instantly share code, notes, and snippets.

View perky's full-sized avatar

Luke perky

View GitHub Profile
@perky
perky / ShapeHexagon.lua
Created June 8, 2012 16:03
ShapeHexagon
ShapeHexagon = Attribute('ShapeHexagon')
local _sin60 = math.sin( math.rad( 60 ) )
local _sin30 = math.sin( math.rad( 30 ) )
local _cos30 = math.cos( math.rad( 30 ) )
function ShapeHexagon:onInit( sideLength )
self:build( sideLength or 1 )
end
@perky
perky / ProFiReportExample.txt
Created May 30, 2012 20:38
An example of a report generated by ProFi.lua
Total Time: 0.417766
| FILE : FUNCTION : LINE : TIME : RELATIVE : CALLED |
| ./FEZ/src/ControllerManager.lua : update : 0172 : 0.418 : 99.99% : 0000001 |
| ./FEZ/src/ControllerManager.lua : updateEntities : 0176 : 0.418 : 99.98% : 0000001 |
| controllers/FogOfWarController.lua : updateEntity : 0039 : 0.400 : 95.85% : 0001044 |
| ./FEZ/src/ComponentCache.lua : _fogOfWar : 0010 : 0.228 : 54.62% : 0001284 |
| controllers/FogOfWarController.lua : updateEntityFogPARTIAL : 0056 : 0.153 : 36.67% : 0001044 |
| ./FEZ/src/EntityManager.lua
@perky
perky / ProFi.lua
Created May 30, 2012 20:32
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()
public interface ICraftingDescription {
public String getDescription(int damageValue);
}
///====== Copyright © 1996-2005, Valve Corporation, All rights reserved. =======
//
// Purpose: Portal 2 game definition file (.fgd)
// Created by DeanWinchester & Randdalf
//
///=============================================================================
@include "halflife2.fgd"
@SolidClass base(Targetname, worldbase, ResponseContext) = worldspawn :