Skip to content

Instantly share code, notes, and snippets.

Scorpio "Test" (function(_ENV)
function FillPolygon(points)
-- Calc the center point
local n = #points
if n < 3 then return end
local cx, cy = 0, 0
for i = 1, n do
require "PLoop" (function(_ENV)
-- Declare the namespace
_G.Defold = namespace "Defold"
-- Register it as global, so can be easily accessed
Environment.RegisterGlobalNamespace(Defold)
-- Define the base script class
__Sealed__()
class "Script" (function(_ENV)
@kurapica
kurapica / nginx.conf
Created September 20, 2022 05:41
A simpe mqtt broker with redis support to show the active clients
pid logs/nginx.pid;
events {
worker_connections 1024;
}
http {
include mime.types;
lua_shared_dict plbr_session_storage 10m;
@kurapica
kurapica / UnitTest_Interceptor.lua
Created February 8, 2023 06:18
The Interceptor used for unit test, replace the global api in modules
require "PLoop"
require "PLoop.System.UnitTest"
-- Function defintion in _G
function UnitName()
return "player"
end
-- Define an interceptor
PLoop(function(_ENV)