This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- faster access to some math library functions | |
local abs = math.abs | |
local Round = math.Round | |
local sqrt = math.sqrt | |
local exp = math.exp | |
local log = math.log | |
local sin = math.sin | |
local cos = math.cos | |
local sinh = math.sinh | |
local cosh = math.cosh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local FakeMatrixStack = {} | |
FakeMatrixStack.m = Matrix() | |
function FakeMatrixStack:push() | |
local m = self.m | |
cam.PushModelMatrix(m) | |
self[#self+1] = m:Copy() | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function AddDir(dir) | |
local files, folders = file.Find(dir, "GAME") | |
for _,file in ipairs(files) do | |
resource.AddFile(dir.."/"..file) | |
end | |
for _,folder in ipairs(folders) do | |
if folder:sub(1,1) ~= "." then -- Ignore .svn/.git folders | |
AddDir(dir.."/"..folder) | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- Improved timers module. Checks arguments more effectively, and doesn't mess up if one of the timers errors. | |
-- To use, just drop in lua/autorun/ | |
--print("Improved timers loading...") | |
if SERVER then AddCSLuaFile() end | |
local timers = {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "test" | |
local add = test.test_add | |
local x = 0 | |
for i=1,100000 do | |
x = add(x,i) | |
end | |
print(x) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local mmap = {} | |
mmap.__index = mmap | |
local new_map | |
local ffi = require "ffi" | |
ffi.cdef[[ | |
unsigned long GetLastError(); | |
void* CreateFileA( | |
const char* lpFileName, | |
unsigned long dwDesiredAccess, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AddCSLuaFile() | |
DEFINE_BASECLASS( "base_anim" ) | |
ENT.PrintName = "Entity table test" | |
ENT.Author = "Alex 'Colonel Thirty Two' Parrill" | |
ENT.Information = "Proof of concept for better entity table storage" | |
ENT.Category = "Other" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyTest | |
{ | |
public: | |
int a,b,c; | |
void test() | |
{ | |
} | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
------------------------------------------------------------------------------- | |
-- Expression 2 Foreign Functions Interface Library | |
------------------------------------------------------------------------------- | |
local functions_cache = setmetatable({},{__mode="v"}) | |
local function identity(v) return v end | |
local lua2e2_converters = { | |
["number"] = identity, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import json | |
import subprocess | |
import os | |
import cgi | |
import cgitb | |
from time import asctime as curtime | |
cgitb.enable(display=0, logdir="/var/log/cgitb", format="text") |
OlderNewer