Skip to content

Instantly share code, notes, and snippets.

View Andre-LA's full-sized avatar

André L. Alvares Andre-LA

View GitHub Profile
@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()
@josefnpat
josefnpat / fooclass.lua
Last active March 12, 2016 14:49
Lua 5.1 OOP example
local fooclass = {}
function fooclass:setColor(color)
self.color = color
end
function fooclass:getColor()
return self.color
end
@riidom
riidom / user.lua
Last active April 10, 2017 07:12
ZBS config file "user.lua"
--[[--
Use this file to specify System preferences.
Review [examples](+C:\Dokumente und Einstellungen\dr\Desktop\ZeroBraneStudioEduPack-0.38-win32\cfg\user-sample.lua) or check [online documentation](http://studio.zerobrane.com/documentation.html) for details.
--]]--
local G = ...
styles = G.loadfile('cfg/tomorrow.lua')('Zenburn') -- theme
@SwadicalRag
SwadicalRag / Lua.lua
Last active December 10, 2019 22:19
In Lua we trust
In the beginning was the Statement, and the Statement was with Lua, and the Statement was Lua.
Through Lua all things were made; without Lua nothing was made that has been made.
There came a function who was sent from Lua; his name was John.
"Lua was the answer to my prayers;
Greater love has no one than Lua, that the compiler lay down his life for our code" - John Lua
"Do not think that I will debug you to the Environment;
For had ye believed the Compiler Errors, ye would have believed Me, for he wrote of Lua;
But if ye believe not his Stack Traces, how shall ye believe My code?" - John Lua

State of Roblox graphics API across all platforms, with percentage deltas since EOY 2019. Updated December 27 2020.

Windows

API Share
Direct3D 11+ 89% (+4%)
Direct3D 10.1 7% (-2%)
Direct3D 10.0 3.5% (-1.5%)
Direct3D 9 0.5% (-0.5%)
@edubart
edubart / c2nelua.lua
Last active April 5, 2020 00:37
c2nelua rudimentar experiment
local re = require 'relabel'
local file = require 'pl.file'
local stringx = require 'pl.stringx'
local grammar = [[
body <- {| line+ |}
line <- (extern / anyline)
anyline <- linerest
linerest<- [^;]* ';' sp
sp <- %s*
@bokunodev
bokunodev / nord.lua
Last active May 14, 2021 15:22
Dark scheme for textadept with Nord color palette. ( look nice with go )
-- Copyright 2007-2020 Mitchell mitchell.att.foicica.com. See LICENSE.
-- Dark theme for Textadept.
-- Contributions by Ana Balan.
local view = view
local property, property_int = view.property, view.property_int
--[[ Nord palette
Polar Night
#2e3440
@bokunodev
bokunodev / init.lua
Last active May 14, 2021 15:22
my textadept init file
_M["go"] = require("go")
_M["go"].format_command = "goimports"
_M["m/f"] = require("functions")
keys["`"] = function() _M["m/f"].enclose_selection("`", "`") end
keys["'"] = function() _M["m/f"].enclose_selection("'", "'") end
keys['"'] = function() _M["m/f"].enclose_selection('"', '"') end
keys['('] = function() _M["m/f"].enclose_selection('(', ')') end
keys['['] = function() _M["m/f"].enclose_selection('[', ']') end

State of Roblox graphics API across all platforms, with percentage deltas since EOY 2020. Updated December 31 2021.

Windows

API Share
Direct3D 11+ 92% (+3%)
Direct3D 10.1 5% (-2%)
Direct3D 10.0 3% (-0.5%)
@edubart
edubart / nldoc.lua
Created May 26, 2021 15:06
Nelua doc tool
local fs = require 'nelua.utils.fs'
local traits = require 'nelua.utils.traits'
local stringer = require 'nelua.utils.stringer'
local parser = require 'nelua.syntaxdefs'().parser
local re = require 'nelua.thirdparty.relabel'
local filename = 'lib/string.nelua'
local filecode = fs.ereadfile(filename)
local ast = parser:parse(filecode, filename)