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
type IPixVis = {} | |
type ISensor = {} | |
local CLIENT = true | |
local SERVER = true | |
local MENU = true | |
type IBfRead = {} | |
type IWeapon = {} | |
type IVehicle = {} | |
type IVector = {} | |
type IMatrix = {} |
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
@echo off & PowerShell -nologo -noprofile -noninteractive Invoke-Expression ('$args=(''%*'').split('' '');'+'$PSScriptRoot=(''%~dp0'');$env:GOLUWA_CURRENT_DIRECTORY=(''%cd%'');'+((Get-Content -Raw '%~dp0%~n0%~x0' ) -Replace '^.*goto :EOF')); & goto :EOF | |
# ^^^^^ | |
# this is some magic to execute the rest of this cmd as powershell | |
# so we can run it from explorer with double click or cmd easily | |
function Download($url, $location) { | |
Write-Host -NoNewline "'$url' >> '$location' ... " | |
(New-Object System.Net.WebClient).DownloadFile($url, "$location") | |
Write-Host "OK" |
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
<!DOCTYPE html> | |
<html> | |
<style> | |
body { | |
background-color: black; | |
background-size: cover; | |
overflow: hidden; | |
opacity: 1; | |
transition: all 300ms ease-in 200ms; | |
} |
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 function string_split(self, separator) | |
local tbl = {} | |
local tbl_i = 1 | |
local last_pos = 1 | |
local len = #separator - 1 | |
for i = 1, #self do | |
if self:sub(i, i + len) == separator then | |
tbl[tbl_i] = self:sub(last_pos, i - len - 1) |
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
let tbl = { | |
foo: [1,2,3], | |
bar: [4,5,6], | |
} | |
let test = function(a,b,c) { | |
console.log(a,b,c) | |
} | |
/* |
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
-- these have to be sorted by longest first | |
local keywords = { | |
"function", | |
"then", | |
"end", | |
"if", | |
} | |
local symbols = { |
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 ffi = require("ffi") | |
local cast = ffi.cast | |
local ctype = ffi.typeof("float *") | |
local function get_num(bytes) | |
local res = cast(ctype, bytes)[0] | |
if not res then | |
print(res, type(res), res or 0) | |
res = 0 | |
end | |
return res |
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 ffi = require("ffi") | |
local lua = require("luajit") | |
local sdl = require("SDL2") | |
ffi.cdef("void* malloc(size_t size); void *memcpy(void*, void*, size_t);") | |
local message_type = "struct {uint8_t*to_ptr; size_t to_len; uint8_t*from_ptr; size_t from_len; uint8_t from_ready;}" | |
local state = lua.L.newstate() | |
lua.L.openlibs(state) |
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 fireBlocks = {} | |
local tilesize = 8 | |
local numberWidthBlocks = math.floor(ScrW() / tilesize) | |
local numberHeightBlocks = 48 -- means all the 36 colors with a little more space to remaining flames | |
local offsetY = ScrH() - (numberHeightBlocks * tilesize) | |
local colorLookup = { | |
Color(7,7,7), | |
Color(31,7,7), | |
Color(47,15,7), |
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 fireBlocks = {} | |
local tilesize = 8 | |
local numberWidthBlocks = math.floor(ScrW() / tilesize) | |
local numberHeightBlocks = 48 -- means all the 36 colors with a little more space to remaining flames | |
local offsetY = ScrH() - (numberHeightBlocks * tilesize) | |
local colorLookup = { | |
Color(7,7,7), | |
Color(31,7,7), | |
Color(47,15,7), |