content
stringlengths
0
1.05M
origin
stringclasses
2 values
type
stringclasses
2 values
local _context = getContext() local _painter = _context:getPainter() local _style = _painter:getStyle() exports('checkBox', function(isChecked, text) _painter:setText(text) _painter:setTextOpts() local aspectRatio = GetAspectRatio() local checkboxStyle = _style.checkbox local cw = checkboxStyle.height / aspectRa...
nilq/small-lua-stack
null
local mod = get_mod("fail_level") local function with_game_state(func) return function() local gm = Managers.state.game_mode if gm and gm._level_key ~= "inn_level" then func(gm) end end end mod.do_fail = with_game_state(function(gm) gm:fail_level() end) mod.do_go_home...
nilq/small-lua-stack
null
-- like assert but without the fuzz: won't print backtrace, etc... local function softassert(...) condition = ... if not condition then print(select(2, ...)) os.exit(1) end return ... end return softassert
nilq/small-lua-stack
null
#!/usr/bin/env lua require 'Test.More' plan(12) if not require_ok 'Spore.Middleware.Auth.Basic' then skip_rest "no Spore.Middleware.Auth.Basic" os.exit() end local mw = require 'Spore.Middleware.Auth.Basic' local req = require 'Spore.Request'.new({ spore = {} }) type_ok( req, 'table', "Spore.Request.new" ) ...
nilq/small-lua-stack
null
--[[ TheNexusAvenger Pulls files from remote repositories on the server. --]] local NexusGit = require(script.Parent.Parent.Parent):GetContext(script) local MultiHttpRequest = NexusGit:GetResource("SplitHttp.MultiHttpRequest") local HttpService = game:GetService("HttpService") local RemotePushRequest = MultiHttpReq...
nilq/small-lua-stack
null
ENT.Type = "anim" ENT.Base = "base_entity" ENT.Author = "Spy" ENT.Spawnable = false ENT.AdminSpawnable = false
nilq/small-lua-stack
null
-- Generated from template if MyGameMode == nil then _G.MyGameMode = class({}) end require('gamemode') function Precache( context ) --[[ Precache things we know we'll use. Possible file types include (but not limited to): PrecacheResource( "model", "*.vmdl", context ) PrecacheResource( "soundfile", "*.vsn...
nilq/small-lua-stack
null
function onLoad(save_state) self.interactable = false -- defaults battlefieldZone = getObjectFromGUID(Global.getVar("battlefieldZoneGUID")) aimBag = getObjectFromGUID(Global.getVar("aimBagGUID")) dodgeBag = getObjectFromGUID(Global.getVar("dodgeBagGUID")) standbyBag = getObjectFromGUID(Global.g...
nilq/small-lua-stack
null
----------------------------------- -- Author: Uli Schlachter -- -- Copyright 2009 Uli Schlachter -- ----------------------------------- local beautiful = require("beautiful") local awful = { widget = require("awful.widget") } local function progressbar(layout) local theme = beautiful.get() local width =...
nilq/small-lua-stack
null
----------------------------------- -- Area: Outer Horutoto Ruins -- NPC: Cracked Wall -- Involved In Mission: The Jester Who'd Be King -- !pos -424.255 -1.909 619.995 ----------------------------------- local ID = require("scripts/zones/Outer_Horutoto_Ruins/IDs") require("scripts/globals/keyitems") require("scripts/g...
nilq/small-lua-stack
null
local perm = require'hop.perm' local prio = require'hop.priority' local M = {} M.HintDirection = { BEFORE_CURSOR = 1, AFTER_CURSOR = 2, } local function tbl_to_str(label) local s = '' for i = 1, #label do s = s .. label[i] end return s end -- Reduce a hint. -- -- This function will remove hints no...
nilq/small-lua-stack
null
local assets = { Asset("ANIM", "anim/ds_pig_basic.zip"), Asset("ANIM", "anim/ds_pig_actions.zip"), Asset("ANIM", "anim/pig_build.zip"), Asset("ANIM", "anim/pigspotted_build.zip"), Asset("SOUND", "sound/pig.fsb"), } local prefabs = { "tophat", "goldnugget", } for i = 1, NUM_HALLOWEENCANDY d...
nilq/small-lua-stack
null
-- AICharacter: Heli -------------------------------------------------------------------------- -- Crytek Source File. -- Copyright (C), Crytek Studios, 2001-2005. -------------------------------------------------------------------------- -- $Id$ -- $DateTime$ -- Description: Character SCRIPT for Helicopter -- ----...
nilq/small-lua-stack
null
return { it = { -- Actions equip = 'Equipaggia', check = 'Esamina', search = 'Cerca / Parla', combat = 'Combatti', stealth = 'Furtivo', push = 'Spingi', jump = 'Salta', swim = 'Nuota', drop = 'Getta', reload = 'Ricarica', ...
nilq/small-lua-stack
null
ESX = nil local PlayersTransforming = {} local PlayersSelling = {} local PlayersHarvesting = {} local clothe = 1 TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end) if Config.MaxInService ~= -1 then TriggerEvent('esx_service:activateService', 'tailer', Config.MaxInService) end TriggerEvent('esx_p...
nilq/small-lua-stack
null
-- Use of this source code is governed by the Apache 2.0 license; see COPYING. module(..., package.seeall) local engine = require("core.app") local timer = require("core.timer") local lib = require("core.lib") local pci = require("lib.hardware.pci") local LoadGen = require("apps.intel_mp.loadgen"...
nilq/small-lua-stack
null
if not table.pack then table.pack = function(...) return { n = select("#", ...), ... } end end if not table.unpack then table.unpack = unpack end local load = load if _VERSION:find("5.1") then load = function(x, n, _, env) local f, e = loadstring(x, n) if not f then return f, e end if env then setfenv(f, env) end retur...
nilq/small-lua-stack
null
-- 以下引用自http://bbs.ngacn.cc/read.php?tid=6622128 kurapica 大大的教學 -- 插件第一个Lua文件使用,这行代码确保以下的代码以addon为环境,而不是以_G为环境, -- 并且在addon环境中可以访问_G的任意变量,访问的变量值也将存储到addon中,便于下次直接访问 -- 下面的代码定义的全局变量都将保存在addon表中,而非_G local _ , ns = ... setfenv(1, setmetatable(ns, { __index = function(self, key) local v = _G[key]; rawset(self, key, v)...
nilq/small-lua-stack
null
#!/usr/bin/env tarantool --- --- Script for container --- box.cfg { memtx_memory = 128*1024*1024; wal_mode = "none" } require('console').listen('0.0.0.0:3313')
nilq/small-lua-stack
null
object_tangible_item_beast_converted_malkloc_decoration = object_tangible_item_beast_shared_converted_malkloc_decoration:new { } ObjectTemplates:addTemplate(object_tangible_item_beast_converted_malkloc_decoration, "object/tangible/item/beast/converted_malkloc_decoration.iff")
nilq/small-lua-stack
null
#!/usr/bin/env tarantool local fio = require('fio') if os.getenv('ENABLE_TEST_COVERAGE') == 'true' then local cfg_luacov = dofile(fio.pathjoin('.luacov')) cfg_luacov.statsfile = fio.pathjoin('luacov.stats.out') local coverage = require('luacov.runner') coverage.init(cfg_luacov) rawset(_G, 'coverag...
nilq/small-lua-stack
null
------------------------------------- -- Away mod by kahrl -- -- Idea by jordan4ibanez & kahrl -- -- Version 1.0 -- ------------------------------------- -- -- Set yourself as away using the server command -- /away -- You can also give a reason, as follows: -- /away Saving the ...
nilq/small-lua-stack
null
do function run(msg, matches) local url = matches[1] local receiver = get_receiver(msg) send_photo_from_url(receiver, url) end return { description = "When user sends image URL (ends with png, jpg, jpeg) download and send it to origin.", usage = "", patterns = { "(https?://[%w-_%.%?%.:/%+=&]+%.png)$"...
nilq/small-lua-stack
null
-- credit to atom0s for help with decompiling -- Decompiled using luadec 2.2 rev: for Lua 5.1 from https://github.com/viruscamp/luadec return { Animation = { [30201] = { AniId = 30201, AniName = "power", Desc = "Show", HeroId = 102, Icon = "互动...
nilq/small-lua-stack
null
local etlua = require "etlua" -- Kong admin config generator -- execute with `kong-yml-env-generator {template-file} {destination-dir}` -- Use shell command arguments to set file locations -- first arg: the ETLUA template -- second arg: the buildpack/app directory local nginx_template_file = "config/nginx.template"...
nilq/small-lua-stack
null
ESX = nil local playerData = {} local weaponList = {} local Time = 0 local Time2 = 0 Citizen.CreateThread(function() while ESX == nil do TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end) Citizen.Wait(0) end createLi...
nilq/small-lua-stack
null
---@class hcolor hcolor = {} ---@private ---@param str string ---@param color string hex ---@return string hcolor.hex = function(str, color) if (str == nil or str == '' or color == nil) then return str end return "|cff" .. color .. str .. "|r" end ---@private ---@param str string ---@param color s...
nilq/small-lua-stack
null
kaas_destroy_missions = { minLevelCeiling = 45, lairSpawns = { { lairTemplateName = "dantooine_bol_pigmy_neutral_small", minDifficulty = 8, maxDifficulty = 12, size = 25, }, { lairTemplateName = "dantooine_voritor_lair_neutral_medium", minDifficulty = 20, maxDifficulty = 24, size = 25, ...
nilq/small-lua-stack
null
local __addon, __ns = ...; if GetLocale() ~= "zhTW" then return; end __ns.L.item = { [25] = "破損的短劍", [35] = "彎曲法杖", [36] = "用舊的釘錘", [37] = "破損的斧頭", [38] = "新兵襯衣", [39] = "新兵束褲", [40] = "新兵的靴子", [43] = "侍從的靴子", [44] = "侍從束褲", [45] = "侍從襯衣", [47] = "盜賊輕鞋", [48] = "盜賊束褲", [49] = "盜賊襯衣", [51] ...
nilq/small-lua-stack
null
local Bottleneck, parent = torch.class('Bottleneck', 'MazeBase') math = require ('math') function Bottleneck:__init(opts, vocab) opts.height = 7 opts.width = 7 parent.__init(self, opts, vocab) block_locs = {{1,4}, {3,4}, {4,4}, {4,5}, {4,6}, {4,7}, {5,2}, {5,3}, {5,4}, {6,4}} for i = 1,#block_lo...
nilq/small-lua-stack
null
ENT.Base = "base_anim" ENT.Type = "anim" ENT.PrintName = "Element Buff Zone" AccessorFunc( ENT, "maxlive", "MaxLive", FORCE_INT ) function ENT:SetupDataTables() self:NetworkVar("Int", 0, "Type") self:NetworkVar("String", 0, "Particlename") self:SetMaxLive( 60 ) end function ENT:Initialize() self:Set...
nilq/small-lua-stack
null
-- Hello -- test lua file local App = {} function App:init() cnt = 0 msg = "Hello" end function App:update() print(cnt,msg) cnt = cnt + 1 end local t = Test.new("OK") t:print() App.init() for i = 0,10 do App.update() end
nilq/small-lua-stack
null
local text_menu = require("menu/text_menu") local audio_data = require("resources/audio_data") local text_menu_with_sfx = derived_class(text_menu) function text_menu_with_sfx:on_selection_changed() -- override -- audio sfx(audio_data.sfx.menu_select) end function text_menu_with_sfx:on_confirm_selection() -- ov...
nilq/small-lua-stack
null
local root = "__lua-processor__" local name = "lua-processor-cpu" local entity = util.table.deepcopy(data.raw["constant-combinator"]["constant-combinator"]) entity.name = name entity.minable.result = name entity.item_slot_count = 60 entity.icon = root .. "/graphics/" .. name .. "-icon.png" local offset_x = {128, 0, 1...
nilq/small-lua-stack
null
dofile(factory.modpath.."/decor/crafting.lua") dofile(factory.modpath.."/decor/smoketube.lua") dofile(factory.modpath.."/decor/factorybrick.lua")
nilq/small-lua-stack
null
local sys = require "luci.sys" local net = require"luci.model.network".init() local ifaces = sys.net:devices() m = Map("pppoe-relay", translate("PPPoE Relay")) m.description = translate( "Opening the PPPoE relay allows devices in the Intranet to create a separate PPPoE connection that can cross NAT...
nilq/small-lua-stack
null
local test = bind(function() end, function() end) local a = function(a, b, c, ...) print(...) end callback(function(arg1) print(arg1) end) callback(function(arg1) print(arg1) end )
nilq/small-lua-stack
null
require "GameObject" local Object = require "Object" Character = { chars = {}, value = 0 } Character = GameObject:extend("Character", Character) function Character:init(chars, scale, value) local inst = {} setmetatable(inst, self) self.__index = self inst.id = Object.UUID() inst.chars = chars inst.sca...
nilq/small-lua-stack
null
game = {} local _worlds = nil -- should not have visbility of each other... _DEBUG = true -- TODO: not function game:init() Concord = require("libs.concord") _components = Concord.components _systems = Concord.systems _worlds = Concord.worlds _assemblages = Concord.assemblages Concord.loadComponents("src/...
nilq/small-lua-stack
null
--[[ Copyright 2020 Matthew Hesketh <matthew@matthewhesketh.com> This code is licensed under the MIT. See LICENSE for details. ]] local allowedlinks = {} local mattata = require('mattata') local redis = require('libs.redis') function allowedlinks:init() allowedlinks.commands = mattata.commands(self.info.u...
nilq/small-lua-stack
null
return require "snownet.stm"
nilq/small-lua-stack
null
local Tunnel = module("_core", "lib/Tunnel") local Proxy = module("_core", "lib/Proxy") API = Tunnel.getInterface("API") cAPI = Proxy.getInterface("API") Citizen.CreateThread( function() while true do Citizen.Wait(0) if IsControlJustPressed(0, 0x8CC9CD42) then local...
nilq/small-lua-stack
null
local blood_size = 6 s.block = { "position", "size", "slime" } s.block.draw = function(i, position, size, slime) do local _with_0 = love.graphics if slime.visible then local _list_0 = slime.dir for _index_0 = 1, #_list_0 do local dir = _list_0[_index_0] _with_0.setColor(dir.c...
nilq/small-lua-stack
null
--exstart=os.clock() --print(exstart) local tbl={} local function create_random() print("create random") math.randomseed(tostring(os.time()):reverse():sub(1, 7)) for i=1,1024 do tbl[i]=math.random(1,100) end end create_random() redis.call('set', KEYS[1], tbl) --exend=os.clock() --print(exen...
nilq/small-lua-stack
null
-- Copyright 2012 Manuel Munz <freifunk at somakoma dot de> -- Licensed to the public under the Apache License 2.0. local map, section = ... local width = wdg:option(Value, "width", translate("Width")) width.rmempty = true --[[ local height = wdg:option(Value, "height", translate("Height")) height.rmempty = true hei...
nilq/small-lua-stack
null
--[[ Unit tests for the LanguageModel implementation, making sure that nothing crashes, that we can overfit a small dataset and that everything gradient checks. --]] require 'torch' require 'misc.LanguageModel' local gradcheck = require 'misc.gradcheck' local tests = {} local tester = torch.Tester() -- validates th...
nilq/small-lua-stack
null
--[[ MIT License Copyright (c) 2022 Michael Wiesendanger Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, mod...
nilq/small-lua-stack
null
module(..., package.seeall) _AUTHOR = "Rodrigo Cacilhas <batalema@cacilhas.info>" _COPYRIGHT = "GNU/GPL 2011-2012 (c) " .. _AUTHOR _DESCRIPTION = "Reimplementation of LuaPage for Sepia HTTP" _NAME = "Sepia LuaPage" _PACKAGE = "sepia.luapage" function loadstring(s, request, response) local aux = s:gsub("<%?lua%s(.-)...
nilq/small-lua-stack
null
firstRun('essentialmode') firstRun('es_freeroam') firstRun('es_carshop') firstRun('es_customization') firstRun('es_miscstores') firstRun('chat_logs') firstRun('admin_logs') firstRun('command_logs')
nilq/small-lua-stack
null
local Type, Version = "TimerZone", 1 local AceGUI = LibStub and LibStub("AceGUI-3.0", true) if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end -- Lua APIs local pairs = pairs -- WoW APIs local CreateFrame, UIParent = CreateFrame, UIParent local timeLeft = 0; local timerTimeOut = 0; loc...
nilq/small-lua-stack
null
-- Controls the BPMDisplay if loaded on ScreenSelectMusic return Def.BPMDisplay { Name = "BPMDisplay", InitCommand = function(self) self:horizalign(left):zoom(0.50) end, SetCommand = function(self) self:SetFromGameState() end, CurrentSongChangedMessageCommand = function(self) ...
nilq/small-lua-stack
null
local research = trinium.research local S = research.S local api = trinium.api local function get_table_formspec(mode, pn, real_research, aspect_key) aspect_key = aspect_key or 0 if mode == 1 or mode == "1" then return ([=[ size[11.5,9] list[context;aspect_panel;0,2;4,6;%s] button[1,8;1,1;research_table~u...
nilq/small-lua-stack
null
id=0 -- 固定値 sda=1 scl=2 addr=0x3C i2c.setup(id,sda,scl,i2c.SLOW) for i=0,127 do i2c.start(id) resCode = i2c.address(id, i, i2c.TRANSMITTER) i2c.stop(id) if resCode == true then print("We have a device on address 0x" .. string.format("%02x", i) .. " (" .. i ..")") end end --disp = u8g2.sh1106_i2c_128x64_n...
nilq/small-lua-stack
null
local types = require("moonscript.types") local util = require("moonscript.util") local data = require("moonscript.data") local reversed, unpack reversed, unpack = util.reversed, util.unpack local ntype, mtype, build, smart_node, is_slice, value_is_singular ntype, mtype, build, smart_node, is_slice, value_is_singular =...
nilq/small-lua-stack
null
local window = {} --Default width and height window.width = love.graphics.getWidth() window.height = love.graphics.getHeight() window.modes = love.window.getFullscreenModes() window.ERROR = "Invalid type for argument %d for %s. %s expected, got %s" function window:initialize() self.scalar = vector(1,...
nilq/small-lua-stack
null
let storage = {} let a4 = #storage.name + 1 let a = 123.45 + 2 + #storage.name + tonumber('123') + "aaa" + 1 let b = 123.45 + 2 + #storage.name + tonumber('123') + 1 print('a4:', a4) print('a:', a) print('b:', b)
nilq/small-lua-stack
null
local Addon = unpack(select(2, ...)) local min, max, format = min, max, format local UIParent = UIParent local InCombatLockdown = InCombatLockdown local GetPhysicalScreenSize = GetPhysicalScreenSize do local waitingCombat = false function Addon:UIScale() if InCombatLockdown() then waitin...
nilq/small-lua-stack
null
display.setStatusBar( display.HiddenStatusBar ) local tileLoader = require( "spyric.autotile" ) local map, sensor = {}, {} ---------------------------- -- Original, restore these: -- local maxRows = 18 -- local maxColumns = 20 ---------------------------- -- 60 Second Heist, TEMP: local maxRows = 16 local maxColumns =...
nilq/small-lua-stack
null
return loadfile('lua54.lua')(true)
nilq/small-lua-stack
null
local go = require('go') local config = require('go.config') describe('setup', function() it('should init with default', function() go.setup({}) assert.are.same('revive', config.options.linter) end) it('should setup with customized value', function() go.setup({ linter =...
nilq/small-lua-stack
null
package.path = package.path .. ';./luaxxhash/?.lua' local xxh32 = require("luaxxhash") local bit = require("bit") local BYTE_s = 8 -- mathematical round function round(num) return math.floor(num + .5) end BloomFilter = {} BloomFilter.__index = BloomFilter function BloomFilter.__new(items, probability) asser...
nilq/small-lua-stack
null
local api = require("fromage") local client = api() coroutine.wrap(function() client.connect("Username#0000", "password") if client.isConnected() then print("Last posts:") local lastPosts, err = client.getLastPosts() -- Gets the last posts if lastPosts then p(lastPosts) else print(err) end end ...
nilq/small-lua-stack
null
if reaper.GetPlayState() == 0 then cur_pos = reaper.GetCursorPosition() else cur_pos = reaper.GetPlayPosition() end reaper.AddProjectMarker2(0, false, cur_pos, -1, "B", -1, reaper.ColorToNative(255, 0, 0)|16777216)
nilq/small-lua-stack
null
function patchClass(el, value, isSVG) if value == nil then value = '' end if isSVG then el:setAttribute('class', value) else local transitionClasses = el._vtc if transitionClasses then -- [ts2lua]lua中0和空字符串也是true,此处value需要确认 value = ((value and {{value, ...}} or {{...}})[1]):join(' ...
nilq/small-lua-stack
null
-- -- Created by IntelliJ IDEA. -- User: wei -- Date: 2017/11/25 -- Time: 22:43 -- To change this template use File | Settings | File Templates. -- 面向对象程序设计 这种行为违背了前面的对象应该有独立的生命周期的原则。 Account = {balance = 0 } function Account.withdraw (v) Account.balance = Account.balance - v end Account.withdraw(100.00) print...
nilq/small-lua-stack
null
require 'paths' arg = {'-GPU','-1'} paths.dofile('../ref.lua') require 'sys' pairRef = { {1,2}, {2,3}, {3,7}, {4,5}, {4,7}, {5,6}, {7,9}, {9,10}, {14,9}, {11,12}, {12,13}, {13,9}, {14,15}, {15,16} } partNames = {'RLAnk','RLKne','RLHip','LLHip','LLKne','LLAnk',...
nilq/small-lua-stack
null
local TextInput = {} local self = TextInput self.input = {""} -- A *reference* to an input table. self.active = false self.submit_callback = nil self.up_limit_callback = nil self.down_limit_callback = nil self.pressed_callback = nil self.text_callback = nil function TextInput.attachInput(tbl, options) Kristal.s...
nilq/small-lua-stack
null
--[[ * Copyright (c) MZ3 Project Team All rights reserved. * Code licensed under the BSD License: * http://www.mz3.jp/license.txt ]] -------------------------------------------------- -- MZ3 Script : gmail -- -- $Id$ -------------------------------------------------- mz3.logger_debug('gmail.lua start'); module("gmai...
nilq/small-lua-stack
null
-- Markdown vim.api.nvim_set_keymap("n", "gm", ":MarkdownPreview<CR>", {}) -- vim.cmd("autocmd FileType markdown MarkdownPreview")
nilq/small-lua-stack
null
--[[ Use the source, Luke! Copyright (C) 2014-2021 Gary V. Vaughan ]] package.path = os.getenv 'LUA_PATH' require 'spec.spec_helpers' local functional = require 'std.functional' describe('std.functional', function() describe('keys', function() local keys = functional.keys it('returns a list of t...
nilq/small-lua-stack
null
local pingScale = 300 local downloadScale = 1024 * 5 local uploadScale = 1024 * 5 return function() local main = teverse.construct("guiFrame", { size = guiCoord(0, 250, 0, 200), position = guiCoord(1, -250, 1, -260), strokeAlpha = 0.5 }) local container = teverse.construct("guiFram...
nilq/small-lua-stack
null
----------------------------------------------------------------------------- -- simple i18n tool -- parse a script pulling out all instances of translatable strings ----------------------------------------------------------------------------- -- customization options --- the function name to search for. local i18n...
nilq/small-lua-stack
null
-- Canteen code by Bug_Rat aka Stix local canteen_wear_per_thirst = 3275 -- 65500 / 20 minetest.register_tool("thirst:canteen", { description = "Canteen", inventory_image = "thirst_canteen.png", liquids_pointable = true, on_use = function(itemstack, user) local wear = itemstack:get_wear() ...
nilq/small-lua-stack
null
--- A Component that defines a @{Frame}'s Border. -- @classmod Border local Base = require("vyzor.base") local BorderSide = require("vyzor.component.border_side") local BorderStyle = require("vyzor.enum.border_style") local Border = Base("Component", "Border") local function getWidthString(width) if type(width) ==...
nilq/small-lua-stack
null
Citizen = {} Citizen.__index = Citizen setmetatable(Citizen, { __index = Citizen, __call = function (cls, ...) local self = setmetatable({}, cls) self:_init(...) return self end, }) function Citizen:_init() self.name = "" self.sex = 0 self.occupation = "" self.alive = 1 self.jailed = 0 self.bo...
nilq/small-lua-stack
null
-- basic tests of stringlua.lua package.path = 'lmod/?.lua;'..package.path local S = require "stringlua" -- a few example table array interfaces local TA = require "stringlua.tablearray" local FA = require "stringlua.filearray" local SA = require "stringlua.stringarray" local function tuple(...) return {n=select('#'...
nilq/small-lua-stack
null
local string = require 'ext.string' local io = {} for k,v in pairs(require 'io') do io[k] = v end -- io or os? io since it is shorthand for io.open():read() function io.readfile(fn) local f, err = io.open(fn, 'rb') if not f then return false, err end -- file.read compat (tested on Windows) -- *a a *l l ...
nilq/small-lua-stack
null
--define the class ACF_defineGunClass("SA", { spread = 0.1, name = "Semiautomatic Cannon", desc = "Semiautomatic cannons offer better payloads than autocannons and less weight at the cost of rate of fire.", muzzleflash = "semi_muzzleflash_noscale", rofmod = 0.36, sound = "acf_extra/tankfx/gnomefather/25mm1.mp3", ...
nilq/small-lua-stack
null
function Spitclawk.main() end function Spitclawk.LaunchDamageSound(_ARG_0_) end
nilq/small-lua-stack
null
local S = aurum.get_translator() local TIMEOUT = 60 local SECONDS_PER_REGEN = 60 aurum.mobs.initial_data.trades = {} local function get(name, id) local player = minetest.get_player_by_name(name) local object = player and aurum.mobs.helper_mob_id_to_object(player:get_pos(), 8, id) local mob = object and aurum.mobs....
nilq/small-lua-stack
null
add_rules("mode.debug", "mode.release") add_repositories("local-repo build") add_requires("foo") target("bar") set_kind("binary") add_files("src/*.cpp") add_packages("foo")
nilq/small-lua-stack
null
ReadDataFile("..\\..\\addon\\ME5\\data\\_LVL_PC\\master.lvl") -- -- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved. -- -- load the gametype script ScriptCB_DoFile("ME5_Master") ScriptCB_DoFile("ME5_setup_teams") ScriptCB_DoFile("ME5_ObjectiveCTF") -- Create a new MapManager object manager = ...
nilq/small-lua-stack
null
require 'spec_helper' describe["_.select"] = function() before = function() input = { 1,2,3 } result = _.select(input, function(i) return i>2 end) end it["should return an array with only elements that do pass the truth function"] = function() expect(result).should_equal {3} end end spec:report(true)
nilq/small-lua-stack
null
print(rawget({x=1}, "x")) --> =1 print(rawget({"hello"}, 1.0)) --> =hello print(rawget({}, "abc")) --> =nil print(pcall(rawget, "hello", 1)) --> ~^false\t.*#1 must be a table print(pcall(rawget, {})) --> ~^false\t
nilq/small-lua-stack
null
return coroutine.wrap(function(dt) local light = require 'light' :new {on = true, r = 0, g = 0xff} local lights = {} -- 66666 -- 5 7 -- 5 7 -- 5 7 -- 11111 -- 4 2 -- 4 2 -- 4 2 -- 33333 local function digit(lights, xoffset, yoffset) xoffset = xoffset or 0 yoffset = yoffset o...
nilq/small-lua-stack
null
local _instance_status = {} local function build(id) local now = os.time() if not _instance_status.start then _instance_status.start = now _instance_status.finish = now end if now > _instance_status.finish then _instance_status.finish = now end local retval = { category = 1, element = ...
nilq/small-lua-stack
null
local module = { Name = "Check ban", Description = "Check a player's ban status", Location = "Player", } local DataStoreService local dataStore module.Execute = function(Client, Type, Attachment) if Type == "command" then local player = module.API.getUserIdWithName(Attachment) local success, result = pcall...
nilq/small-lua-stack
null
-- -- Copyright (c) 2020 lalawue -- -- This library is free software; you can redistribute it and/or modify it -- under the terms of the MIT license. See LICENSE for details. -- --[[ A DNS query tool build on top of MNet's event loop ]] local ffi = require("ffi") ffi.cdef([[ /* -- Build query content * buf: buf...
nilq/small-lua-stack
null
-- lua-phpass, Lua implementation of the portable -- PHP password hashing framework -- Copyright (C) 2015 Boris Nagaev -- See the LICENSE file for terms of use. local phpass = {} -- Encoding. Not base64! local itoa64_ = './0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ' .. 'abcdefghijklmnopqrstuvwxyz' local function itoa...
nilq/small-lua-stack
null
local MineOSInterface = require("MineOSInterface") local GUI = require("GUI") local buffer = require("doubleBuffering") local scale = require("scale") local unicode = require("unicode") local event = require("event") ------------------------------------------------------------------------------------------------------...
nilq/small-lua-stack
null
local Root = script.Parent.Parent local RunService = game:GetService("RunService") local GuiService = game:GetService("GuiService") local UserInputService = game:GetService("UserInputService") local FFlagBypassThirdPartySettingForRobloxPurchase = require(Root.Flags.FFlagBypassThirdPartySettingForRobloxPurchase) local ...
nilq/small-lua-stack
null
-------------------------------- -- @module EventMouse -- @extend Event -- @parent_module cc -------------------------------- -- Returns the previous touch location in screen coordinates.<br> -- return The previous touch location in screen coordinates.<br> -- js NA -- @function [parent=#EventMouse] getPrev...
nilq/small-lua-stack
null
local function brew() local status_ok, indent_blankline = pcall(require, "indent_blankline") if not status_ok then return end indent_blankline.setup { buftype_exclude = { "alpha", "NvimTree", "terminal", "term", "packer", "gitcommit", "fugitive", "nofile", "Greeter", "help" }, ...
nilq/small-lua-stack
null
local npc_sides = { npc_advisor = "hl_combine", npc_alyx = "default", npc_antlion = "hl_antlion", npc_antlion_grub = "hl_antlion", npc_antlionguard = "hl_antlion", npc_barnacle = "wild", npc_antlion_worker = "hl_antlion", npc_barney = "default", npc_breen = "hl_combine", npc_citi...
nilq/small-lua-stack
null
-- The basic Game object Game = {} Game.__metatable = Game function Game:new(o) o = o or {} o.__index = self -- Game.objects is an ID-indexed list of objects (tables) o.objects = {} o.nextID = o.nextID or 0 o.playerActor = -1 -- Game.schedule is a table, indexed by timepoint (as integers), con...
nilq/small-lua-stack
null
instrument { name = "Disparity Index", overlay = false } period = input (14, "front.period", input.integer, 2) source = input (inputs.close, "front.ind.source", input.string_selection, inputs.titles) fn = input (averages.sma, "front.newind.average", input.string_selection, averages.titles) input_group { "f...
nilq/small-lua-stack
null
-- patterns local comment = "^#.*$" local empty = "^$" local level = "^@Levels:%s+(.*)" local reorder = "^@Reorder:%s+(.*)" local data = "^([%S%s]+);%s*(%d+)$" local BidiTestReader, BidiCharacterTestReader = {}, {} -- Provides an iterator for tests cases in the BidiTest.txt file. -- -- Function takes an optional `...
nilq/small-lua-stack
null
Entity = Object:extend() function Entity:new(x, y, image_path) self.x = x self.y = y self.image = love.graphics.newImage(image_path) self.width = self.image:getWidth() self.height = self.image:getHeight() end function Entity:update(dt) -- We'll leave this empty for now. end function Entity:dr...
nilq/small-lua-stack
null
local utils = require('command.utils') local string_util = require('string') local FeedbackView = require('gui.feedback.View') local reaper_state = require('utils.reaper_state') local model = require('gui.feedback.model') local config = require('definitions.config') local feedback = {} function feedback.displayComple...
nilq/small-lua-stack
null
local function TextEditConstruct(inst) local _SetEditing = inst.SetEditing function inst:SetEditing(editing) if not TheNet:IsDedicated() then if ThePlayer then ThePlayer:PushEvent( "gamepaused", editing ) end end _SetEditing(self, editing) end local _OnDestroy = inst.OnDestroy function inst...
nilq/small-lua-stack
null