Skip to content

Instantly share code, notes, and snippets.

### Keybase proof
I hereby claim:
* I am notcake on github.
* I am notcake (https://keybase.io/notcake) on keybase.
* I have a public key ASC2B4DDmNqq3hI46IsQ9EzJ9VfrewzZdILeCZqHg7RIbgo
To claim this, I am signing this object:
@notcake
notcake / bufferedstreamreader.lua
Created June 25, 2015 18:06
XC.IO.BufferedStreamReader
local self = {}
XC.IO.BufferedStreamReader = XC.MakeConstructor (self, XC.IO.StreamReader)
function self:ctor (inStream)
self.InStream = inStream
self.Position = 0
self.BufferSize = 4096
self.BufferPosition = 0
@notcake
notcake / math_extensions.cpp
Created June 25, 2015 15:48
Garry's Mod Lua SetUnpacked and Unpack
#include "GarrysMod/Lua/Interface.h"
#include "mathlib/vector.h"
#include "mathlib/vmatrix.h"
#include <stdio.h>
using namespace GarrysMod::Lua;
static int Angle_SetUnpacked (lua_State *state)
{
LUA->CheckType (1, Type::ANGLE);
@notcake
notcake / remoteinstream.lua
Last active August 29, 2015 14:23
XC.IO.RemoteInStream
local self = {}
XC.IO.RemoteInStream = XC.MakeConstructor (self, XC.IO.IInStream)
function XC.IO.RemoteInStream.Handle (inStream, outBuffer, connection)
outBuffer:UInt64 (inStream:GetSize ())
connection:Write (outBuffer)
while true do
local command, inBuffer = connection:Read ("StringN8")
XC.Logger:Message ("XC.IO.RemoteInStream.Handle : Command " .. command)
local self = {}
XC.RPC.Connection = XC.MakeConstructor (self)
--[[
Events:
Closed ()
Fired when the connection has been closed.
DispatchPacket (packetData)
Fired when a packet needs to be sent.
HandlePacket (packetData)
@notcake
notcake / unicode.lua
Created May 20, 2015 22:49
Unicode.lua
This file has been truncated, but you can view the full file.
Space = " " -- U+000001
ExclamationMark = "!" -- U+000002
QuotationMark = "\"" -- U+000003
NumberSign = "#" -- U+000004
DollarSign = "$" -- U+000005
PercentSign = "%" -- U+000006
Ampersand = "&" -- U+000007
Apostrophe = "'" -- U+000008
LeftParenthesis = "(" -- U+000009
RightParenthesis = ")" -- U+00000A
@notcake
notcake / Metro 2033 Redux content.vfx
Last active August 29, 2015 14:20
Metro 2033 Redux content.vfx
struct Header
{
uint32 Unknown0;
uint32 Unknown1;
uint32 Unknown2;
uint32 Unknown3;
uint32 Unknown4;
uint32 Unknown5;
@notcake
notcake / Metro 2033 Redux content.vfx
Created May 5, 2015 01:16
Metro 2033 Redux content.vfx
This file has been truncated, but you can view the full file.
content.vfx (3.45 MiB)
UNKNOWN: 00000001 00000001
UNKNOWN: 3cc39580 40073ad4 b5c1edbf cb204de4
Pack file count: 0x0000001d
inode count: 0x00013f19
??? count: 0x00006567
[Pack File 00000000] content00.vfs0
2033\000
2033\l00_intro
Size: 0x7ff9bd8f (2.00 GiB)