Skip to content

Instantly share code, notes, and snippets.

View perky's full-sized avatar

Luke perky

View GitHub Profile
///====== 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 :
public interface ICraftingDescription {
public String getDescription(int damageValue);
}
@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()
@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 / 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 / main.lua
Created June 18, 2012 22:31
Blocking threads
---------------------
-- main.lua
---------------------
local printerThread
local time
local function printTextFromPrinterThread()
local printText = printerThread:get('print')
if printText then
@perky
perky / gist:4338631
Created December 19, 2012 17:39 — forked from anonymous/gist:4338626
The renderWarpedTextureOverlay method is being called correctly when inside a 'gas' block, but no overlay is shown.
package ljdp.minechem.client;
import java.util.EnumSet;
import org.lwjgl.opengl.GL11;
import ljdp.minechem.common.MinechemBlocks;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.Tessellator;
package ljdp.minechem.client;
import org.lwjgl.opengl.GL11;
import ljdp.minechem.common.ModMinechem;
import ljdp.minechem.common.tileentity.TileEntityMicroscope;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.client.ForgeHooksClient;
package ljdp.minechem.client;
import cpw.mods.fml.client.FMLClientHandler;
import cpw.mods.fml.client.registry.ClientRegistry;
import cpw.mods.fml.client.registry.RenderingRegistry;
import cpw.mods.fml.common.Side;
import cpw.mods.fml.common.registry.TickRegistry;
import net.minecraft.world.World;
import net.minecraftforge.client.ForgeHooksClient;
import net.minecraftforge.client.MinecraftForgeClient;
package ljdp.minechem.client;
import ljdp.minechem.common.ModMinechem;
import org.lwjgl.opengl.GL11;
import cpw.mods.fml.client.FMLClientHandler;
import net.minecraft.client.renderer.entity.RenderItem;
import net.minecraft.item.ItemStack;