content
stringlengths
0
1.05M
origin
stringclasses
2 values
type
stringclasses
2 values
local vs = [[ VK_UNIFORM_BINDING(0) uniform PerView { mat4 u_view_matrix; mat4 u_projection_matrix; vec4 u_camera_pos; vec4 u_time; }; VK_UNIFORM_BINDING(1) uniform PerRenderer { mat4 u_model_matrix; }; VK_UNIFORM_BINDING(3) uniform PerMaterialVertex { vec4 _NoiseScale; vec4 _NoiseSpeed; }; layout(location = ...
nilq/small-lua-stack
null
local renamer = require 'renamer' local utils = require 'renamer.utils' local popup = require 'plenary.popup' local mock = require 'luassert.mock' local stub = require 'luassert.stub' local spy = require 'luassert.spy' local eq = assert.are.same describe('renamer', function() describe('rename', function() ...
nilq/small-lua-stack
null
return { [1122] = {x4=1122,x1=false,x2=2,x3=128,x5=112233445566,x6=1.3,x7=1122,x8_0=13,x8=12,x9=123,x10='yf',x12={x1=1,},x13=5,x14={ _name='DemoD2',x1=1,x2=3,},s1='lua text ',v2={x=1,y=2},v3={x=0.1,y=0.2,z=0.3},v4={x=1,y=2,z=3.5,w=4},t1=-28800,k1={1,2,},k2={2,3,},k3={3,4,},k4={1,2,},k5={1,3,},k6={1,2,},k7={1,8,},k8={[...
nilq/small-lua-stack
null
local path, trigger = (...) local triggerData = {select(3,...)} local term = require("terminal") local PATH = term.getPATH() local PKGProgramsPath = path.."Programs/;" if trigger == "enable" then PATH = PATH..PKGProgramsPath term.setPATH(PATH) elseif trigger == "disable" then PATH = PATH:gsub(PKGProgramsPath,"...
nilq/small-lua-stack
null
--!A cross-platform build utility based on Lua -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law...
nilq/small-lua-stack
null
--- @classmod core.graphics.ShaderProgram --- Shader programs are used to define how models are rendered. -- -- They consist of multiple @{core.graphics.Shader} objects, which must provide -- an entry point for each mandatory rendering stage: Vertex and fragment shader. -- -- This is just a brief summary, the complete ...
nilq/small-lua-stack
null
--[[ Copyright (c) 2011-2014 chukong-inc.com 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, modify, merge, publish, dis...
nilq/small-lua-stack
null
--[[ I AM NOT RESPONSIBLE IF YOU GET BANNED WITH THE "A" SCRIPT ]] require(5656254881)()
nilq/small-lua-stack
null
local setmetatable = setmetatable local config = ngx.shared.config local ngx = ngx local tinsert = table.insert local tconcat = table.concat local pairs = pairs local cjson = require "cjson" local type = type local resty_lock = require "resty.lock" local _M = {} _M._VERSION = '0.1' local weixin_errcode = { [-1] = '...
nilq/small-lua-stack
null
for i=16, 100 do surface.CreateFont( "ui."..i, { font = "Bebas Neue", size = i } ) end function ScrWH() return ScrW(), ScrH() end scrwh=ScrWH; Scrwh=ScrWH; SCRWH=ScrWH; function PlaySound( s ) surface.PlaySound( "vgui/" .. s .. ".ogg" ) end local blur = Material( "pp/blurscreen" ) function draw...
nilq/small-lua-stack
null
local helpers = require('test.functional.helpers')(after_each) local Screen = require('test.functional.ui.screen') local lfs = require('lfs') local neq, eq, command = helpers.neq, helpers.eq, helpers.command local clear, curbufmeths = helpers.clear, helpers.curbufmeths local exc_exec, expect, eval = helpers.exc_exec, h...
nilq/small-lua-stack
null
workspace "REV" architecture "x64" preferredtoolarchitecture "x86_64" configurations { "debug", "release", "nsight" } location "../.." startproject "sandbox" include "premake_engine.lua" include "premake_sandbox.lua"
nilq/small-lua-stack
null
local Color1 = color(Var "Color1") local Color2 = color(Var "Color2") local a1 = LoadActor(Var "File1") .. { OnCommand = function(self) self:cropto(SCREEN_WIDTH / 2, SCREEN_HEIGHT / 2):diffuse(Color1):effectclock("music") -- Explanation in StretchNoLoop.lua. if self....
nilq/small-lua-stack
null
require 'accuracy/generateTest' require 'accuracy/runTest' require 'gap/utils' require 'gap/constants' -- return a list of files/folder in a directory function scandir(directory) local i, t, popen = 0, {}, io.popen local pfile = popen('ls -a "'..directory..'"') for filename in pfile:lines() do i = ...
nilq/small-lua-stack
null
local values = {}; local i = 1; local j = 1; local width = 720 local height = 400 -- The statements in the setup() function -- execute once when the program begins -- The array is filled with random values in setup() function. function setup() --createCanvas(720, 400); for idx = 1,(width/8) do table.insert(v...
nilq/small-lua-stack
null
vr_info_table = {} vr_info_table[1] = {} vr_info_table[1].field_name = "vr_info_h_op" vr_info_table[1].ProtoField = ProtoField.int8 vr_info_table[1].base = base.DEC vr_info_table[1].append_value = { branch = { prepend = ": ", value = function (val) retu...
nilq/small-lua-stack
null
----------------------------------- -- Area: RuAun Gardens -- NM: Despot ----------------------------------- function onMobSpawn(mob) local ph = GetMobByID(mob:getLocalVar("ph")) if ph then local pos = ph:getPos() mob:setPos(pos.x, pos.y, pos.z, pos.r) local killerId = ph:getLocalVar("...
nilq/small-lua-stack
null
----------------------------------------- -- ID: 5728 -- Item: serving_of_zaru_soba_+1 -- Food Effect: 60min, All Races ----------------------------------------- -- Agility 4 -- HP % 12 (cap 185) -- Resist Sleep +10 ----------------------------------------- require("scripts/globals/status") require("scripts/globals/msg...
nilq/small-lua-stack
null
require("alua") function spawncb(reply) local cmd = [[ print("Hello from " .. alua.id .. "!"); alua.exit() ]] for p in pairs(reply.processes) do alua.send(p, cmd) end end function opencb(reply) alua.spawn(7, spawncb) end alua.open({addr="127.0.0.1", port=6080}, opencb) alua.loop()
nilq/small-lua-stack
null
local InterruptTable = _G.InterruptTable -- Black Rook Hold InterruptTable["Ghostly Councilor"] = { ["Dark Mending"] = true } InterruptTable["Ghostly Protector"] = { ["Sacrifice Soul"] = true } InterruptTable["Lord Etheldrin Ravencrest"] = { ["Spirit Blast"] = true } InterruptTable["Risen Arcanist"] = {...
nilq/small-lua-stack
null
local SoraRouter = {} local util = require "sora.util" local routes = ngx.shared.routes function SoraRouter.new(o, req) o = o or {} local base = require "sora.base" local parent = base:new(req) setmetatable( o, { __index = parent } ) return o end function SoraRouter:getControllerUri() ...
nilq/small-lua-stack
null
require "stategraphs/SGbigfoot" local assets = { Asset("ANIM", "anim/foot_build.zip"), Asset("ANIM", "anim/foot_basic.zip"), Asset("ANIM", "anim/foot_print.zip"), Asset("ANIM", "anim/foot_shadow.zip"), } local prefabs = { "groundpound_fx", "groundpoundring_fx", } local ShadowWarnTime = 2 local functio...
nilq/small-lua-stack
null
--- @module class -- Utility for working with idiomatic Lua object-oriented patterns local class = {} --- Given an `object`, return its class function class.classOf(object) return getmetatable(object) end --- Given an `object` and a `class`, return if that object is an instance of another class/superclass -- Equiva...
nilq/small-lua-stack
null
UIMenuItem = setmetatable({}, UIMenuItem) UIMenuItem.__index = UIMenuItem UIMenuItem.__call = function() return "UIMenuItem", "UIMenuItem" end function UIMenuItem.New(Text, Description) _UIMenuItem = { Rectangle = UIResRectangle.New(0, 0, 431, 38, 255, 255, 255, 20), Text = UIResText.New(tostring(Text) or "", 8, ...
nilq/small-lua-stack
null
AddCSLuaFile() ENT.Type = "anim" ENT.PrintName = "Door Breach" ENT.Category = "HL2 RP" ENT.Spawnable = true ENT.AdminOnly = true ENT.PhysgunDisable = true ENT.bNoPersist = true if (SERVER) then function ENT:GetLockPosition(door, normal) local index = door:LookupBone("handle") local position = door:GetPos() n...
nilq/small-lua-stack
null
require('luacov') local testcase = require('testcase') function testcase.before_all() -- install hello and world module local f = assert(io.popen(table.concat({ 'cd testdata', 'luarocks make hello-scm-1.rockspec', 'luarocks make world-scm-1.rockspec', }, ' && '))) for line in f:...
nilq/small-lua-stack
null
local class = require "com/class" local CollectibleGeneratorManager = class:derive("CollectibleGeneratorManager") local CollectibleGeneratorEntry = require("src/CollectibleGenerator/Entry") function CollectibleGeneratorManager:new() self.generators = {} local generatorList = loadJson(parsePath("config/collectible...
nilq/small-lua-stack
null
springs = {} local modpath = minetest.get_modpath("springs") dofile(modpath.."/pipes.lua") dofile(modpath.."/sluice.lua") dofile(modpath.."/pump.lua") dofile(modpath.."/wells.lua") --[[ TODO: water filters pipe inlet/outlet pressure checks broken outlet sharing non-connected pipes and splitters fix wells better sp...
nilq/small-lua-stack
null
local M = {} --#region Global data local mod_data ---@type table <number, LuaEntity> local players_opened_compile ---@type table <number, function> local compiled = {} ---@type table <number, string> local compilers_text ---@type table <number, string> local players_copyboard --#endregion --#region Constants local s...
nilq/small-lua-stack
null
object_mobile_dressed_padawan_wke_03 = object_mobile_shared_dressed_padawan_wke_03:new { } ObjectTemplates:addTemplate(object_mobile_dressed_padawan_wke_03, "object/mobile/dressed_padawan_wke_03.iff")
nilq/small-lua-stack
null
function xAdmin.Core.RegisterCommandInternal(cmd, dsc, pwr, fnc) xAdmin.Commands[cmd] = { command = cmd, desc = dsc or "n/a", power = xAdmin.Config.PowerlevelPermissions[cmd] or xAdmin.Config.PowerLevelDefault, func = fnc } end function xAdmin.Core.RegisterCommand(command, desc, power, func, alias) if not c...
nilq/small-lua-stack
null
local p = peripheral.find("manaPool") test.assert(p, "Pool not found") test.eq(500000, p.getMana(), "Problem with mana") test.eq(1000000, p.getMaxMana(), "Max mana") test.eq(false, p.isFull(), "is full") test.eq(false, p.isEmpty(), "is empty")
nilq/small-lua-stack
null
local script = [[ git clone https://github.com/microsoft/vscode-node-debug2.git cd vscode-node-debug2 npm install npx gulp build ]] return { install_script = function() return script end, path = function() local resolve = require("installer/utils/fs").resolve local server_path = require("installer/ut...
nilq/small-lua-stack
null
require("msa/Core") local AnimAction = require("msa/Animating/AnimAction") local Animation = {} Animation.__index = Animation setmetatable(Animation, {__call = function (cls, ...) return cls.New(...) end }) --################################################################## -- constructor --################...
nilq/small-lua-stack
null
--- The Lemur test runner script. -- This script can run with Lemur to perform automated tests. -- -- @script LemurTestRunner -- @release 0.2.0 -- @license MIT -- Add init.lua to path allowing Lemur (and other dependencies) to load package.path = package.path .. ";?/init.lua" local Lemur = require("lemur") local Habi...
nilq/small-lua-stack
null
-- Generated from template local MANIAC_TEAM = DOTA_TEAM_BADGUYS local SURVIVORS_TEAM = DOTA_TEAM_GOODGUYS local GENERATORS_TEAM = DOTA_TEAM_CUSTOM_1 local generator_building scoreFirstTeam = 0 scoreSecondTeam = 0 if CAddonTemplateGameMode == nil then CAddonTemplateGameMode = class({}) end function Precache( conte...
nilq/small-lua-stack
null
collisions = {} collisions.point = hc.circle(0, 0, 5) -- this collider is used to probe for objects at locations function collisions.handleShip(ship) for shape, delta in pairs(hc.collisions(ship.collider)) do if shape.class == 'land' or shape.class == 'spawn' then collisions.resolve(ship, delta...
nilq/small-lua-stack
null
local leader = nil local level = nil os.loadAPI("AIBUT/config") local mode = config.type os.unloadAPI("AIBUT/config") local stack = { admin_control = { action = function(params) local code = nil local i = 0 for v in ipairs(params) do i++ ...
nilq/small-lua-stack
null
local sqlite3 = require("lsqlite3") local db = assert( sqlite3:open_memory() ) assert( db:exec[[ CREATE TABLE customer ( id INTEGER PRIMARY KEY, name VARCHAR(40) ); CREATE TABLE invoice ( id INTEGER PRIMARY KEY, customer INTEGER NOT NULL, title VARCHAR(80) NOT NULL, article1 VARCHA...
nilq/small-lua-stack
null
-- @Author: Administrator -- @Date: 2016-11-21 19:15:01 -- @Last Modified by: Administrator -- @Last Modified time: 2016-11-21 20:32:55 local CLIENT_LANG = select(3, GetVersion()) local JH_CALL_AJAX = {} local JH_AJAX_TAG = "JH_AJAX#" -- event CURL_REQUEST_RESULT arg0 local tinsert, tconcat = table.insert, table....
nilq/small-lua-stack
null
--Client-side script: Taximeter --Created by Exciter, anumaz, 04.05.2014 --Last updated 05.05.2014 by Exciter --Released as open source. This header should remain intact. Otherwise no use restrictions. -- configuration taxiModels = {[420]=true, [438]=true} -- Vehicle models defaultfare = 21 -- Default taxi fare syncIn...
nilq/small-lua-stack
null
function dofile(filename) local f = assert(loadfile(filename)) return f() end
nilq/small-lua-stack
null
local Area = require("api.Area") local TestUtil = require("api.test.TestUtil") local Item = require("api.Item") local Assert = require("api.test.Assert") local Map = require("api.Map") local World = require("api.World") function test_home_preserves_items_on_renew() local north_tyris_area = Area.create_unique("elona...
nilq/small-lua-stack
null
function onSay(cid, words, param, channel) if(param == '') then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command requires param.") return true end local tid = cid local t = string.explode(param, ",") if(t[2]) then tid = getPlayerByNameWildcard(t[2]) if(not tid or (isPlayerGhost(tid) and ...
nilq/small-lua-stack
null
if x then print("guard") if y then if z then print("z") else print("not z") end end elseif a then print("a") end
nilq/small-lua-stack
null
print(pcall(require)) --> ~^false\t.*value needed print(pcall(require, {})) --> ~^false\t.*must be a string print(require "testlib.foo") -- points at testlib/foo.lua --> =foo --> =bar -- Second time, the module is already loaded so no side effects. print(require "testlib.foo") --> =bar print(package.loaded["testlib...
nilq/small-lua-stack
null
------------------------------------------------------------------------ -- Signal.lua -- @version v1.0.0 ------------------------------------------------------------------------ -- private types type fn = (...any) -> ...any type table = {any} type array<T> = {T} -- Complex export type Complex = { X: number, ...
nilq/small-lua-stack
null
local class = require 'EasyLD.lib.middleclass' local SFX = class('SFX') function SFX:initialize(name) end return SFX
nilq/small-lua-stack
null
local class = require "lib.lua-oop" Timer = class("Timer") function Timer:constructor(timeOutSecs, oneShoot, start) self.timeOutSecs = timeOutSecs self.oneShoot = oneShoot self.started = false self.hasTimeOuted = false self.timeout = false self.onTimeouts = {} self.resetRequested = fal...
nilq/small-lua-stack
null
-- Copyright (c) 2021 Kirazy -- Part of Artisanal Reskins: Compatibility -- -- See LICENSE in the project directory for license information. -- Check to see if reskinning needs to be done. if not mods["NauvisDay"] then return end if not (reskins.bobs and reskins.bobs.triggers.greenhouse.entities) then return end -- S...
nilq/small-lua-stack
null
describe('#list', function() local list setup(function() list = require"novus.util.list" end) describe('map', function() it('transforms a table by the given function', function() local t = {1,2,3,4,5} local t2 = {2,4,6,8,10} local by2 = function(x) ret...
nilq/small-lua-stack
null
Editor = class() function Editor:init() -- you can accept and set parameters here end
nilq/small-lua-stack
null
function RemoveDotDirs(aTable) if aTable == nil or type(aTable) ~= 'table' then return aTable end --remove the two directories "." , ".." local i = 1 while i <= #aTable do while aTable[i] ~= nil and aTable[i]:sub(1,1) == '.' do aTable[i] = aTable[#aTable] aTable[#aTable] = nil end ...
nilq/small-lua-stack
null
local AS = unpack(AddOnSkins) function AS:Blizzard_EncounterJournal(event, addon) if addon ~= 'Blizzard_EncounterJournal' then return end AS:SkinBackdropFrame(EncounterJournal) AS:SkinBackdropFrame(EncounterJournal.navBar, nil, nil, true) EncounterJournal.navBar.Backdrop:SetPoint("TOPLEFT", -2, 0) EncounterJou...
nilq/small-lua-stack
null
require("animation/animBase"); require("common/uiFactory"); AnimBtnMessage = class(AnimBase); AnimBtnMessage.load = function (view) AnimBtnMessage.root = view; end AnimBtnMessage.play = function (view) if not view then return; end AnimBtnMessage.stop(); AnimBtnMessage.load(vie...
nilq/small-lua-stack
null
local dump = require "dump" local msg = require "msg" local engine = require "dependencies/mpvcontextmenu/menu-engine" local mp = require 'mp' local utils = require 'mp.utils' local Menu = {} function Menu:new(o) o = o or {} setmetatable(o, self) self.__index = self o.menu_list = { context_menu = {} } ...
nilq/small-lua-stack
null
collision_callback_test = {} collision_callback_test.msgCount = 0 collision_callback_test.dt = 0 collision_callback_test.ran = false -- process message function collision_callback_test.RecieveMessage = function (logicComponent, msg, msgType) if msgType == "COLLISION" then collision_callback_test.dt = collision_call...
nilq/small-lua-stack
null
-- basic.lua local basic = {} package.loaded[...] = basic function basic.index(table, item) for k, v in pairs(table) do if v == item then return k end end end function basic.map(table, func) local t = {} for k, v in pairs(table) do t[k] = func(v) end return t end function basic.matchstr(str, pa...
nilq/small-lua-stack
null
------------------------------------------------------------ ------------------------- yrp_hud -------------------------- ------------------------------------------------------------ --------------------- Created by Flap ---------------------- ------------------------------------------------------------ ----------...
nilq/small-lua-stack
null
if Config.initialised then Config.print() end
nilq/small-lua-stack
null
local SpriteSheet = {} function SpriteSheet:new(imagePath, hFrames, vFrames) newSheet = { _imageData = {source = nil, rows = 0, cols = 0}, frameWidth = 0, frameHeight = 0 } if type(imagePath) == 'string' then newSheet._imageData.source = love.graphics.newImage(imagePath) ...
nilq/small-lua-stack
null
local function SendFriendStatus() local friends = {} for _,ply in ipairs(player.GetHumans()) do if ply:GetFriendStatus() == "friend" then table.insert(friends, ply:EntIndex()) end end RunConsoleCommand("wire_expression2_friend_status", table.concat(friends, ",")) end if CanRunConsoleCommand() then SendFrie...
nilq/small-lua-stack
null
--- -- @module drawing local types = require("lualife.types") local typeutils = require("typeutils") local Size = require("lualife.models.size") local Point = require("lualife.models.point") local Field = require("lualife.models.field") local ClassifiedGame = require("biohazardcore.classifiedgame") local Rectangle = r...
nilq/small-lua-stack
null
-- Place Bison -- Author: Neirai -- DateCreated: 5/12/2014 9:35:31 AM function buildABison(pPlayer, pCity) for pCityPlot = 1, pCity:GetNumCityPlots() - 1, 1 do local pSpecificPlot = pCity:GetCityIndexPlot(pCityPlot) if pSpecificPlot:GetTerrainType() == TerrainTypes.TERRAIN_PLAINS then if pSpecificPlot:GetFeatu...
nilq/small-lua-stack
null
-- put user settings here -- this module will be loaded after everything else when the application starts -- it will be automatically reloaded when saved local core = require "core" local keymap = require "core.keymap" local config = require "core.config" local style = require "core.style" local common = require "core...
nilq/small-lua-stack
null
function sysCall_info() return {autoStart=false} end function sysCall_init() sim.addLog(sim.verbosity_scriptinfos,"This tool will display the custom data blocks attached to the selected object, or the custom data blocks attached to the scene, if no object is selected. Custom data blocks can be written and read...
nilq/small-lua-stack
null
local FAQ = {} setmetatable(FAQ, {__index = _G}) -- Exported function -- Returns the factory object -- Optional callback param that is passed the factory object function getFactory(cb) if cb then cb(FAQ) end return FAQ end -- Replicate the following functions in the FAQ table, so we can use them i...
nilq/small-lua-stack
null
local function lol(gfx) local items = newItemList() items:add(newEItem('spawn',5,3,gfx)) items:add(newEItem('score',9,21,gfx)) items:add(newEItem('score',13,21,gfx)) items:add(newEItem('score',17,21,gfx)) items:add(newEItem('goal',15,4,gfx)) local decs = {} decs[1] = {1, 6, 4} decs[2] = {1, 7, 4} decs[3] = {1, 8, 4} de...
nilq/small-lua-stack
null
object_tangible_component_structure_turbo_fluidic_drilling_pumping_unit_advanced = object_tangible_component_structure_shared_turbo_fluidic_drilling_pumping_unit_advanced:new { } ObjectTemplates:addTemplate(object_tangible_component_structure_turbo_fluidic_drilling_pumping_unit_advanced, "object/tangible/component/st...
nilq/small-lua-stack
null
-- @Author:pandayu -- @Version:1.0 -- @DateTime:2018-09-09 -- @Project:pandaCardServer CardGame -- @Contact: QQ:815099602 local model = require "game.model.role_model" local config = require "game.template.replica" local timetool = require "include.timetool" local bconfig = require "game.config" local task_config = req...
nilq/small-lua-stack
null
local view3 = nil local M = {} M.init = function(view_mngr) view3 = view_mngr.addView("view3") -- Callback function when one of the buttons in the grid is selected local function onSelected(choice) dumpTable(choice) end -- Specific callback function for view1 button local function onView...
nilq/small-lua-stack
null
object_tangible_loot_npc_loot_shisa_generic = object_tangible_loot_npc_loot_shared_shisa_generic:new { } ObjectTemplates:addTemplate(object_tangible_loot_npc_loot_shisa_generic, "object/tangible/loot/npc/loot/shisa_generic.iff")
nilq/small-lua-stack
null
-- File: telescope.lua -- Author: Zakhary Kaplan <https://zakharykaplan.ca> -- Created: 06 Aug 2021 -- SPDX-License-Identifier: MIT -- Require module setup require('telescope').setup { defaults = { -- Default configuration for telescope goes here: -- config_key = value, mappings = { ...
nilq/small-lua-stack
null
local c = require("load_conf") local config = c.get_conf("/etc/wpt/conf.json") local hosts = ngx.shared.hosts local len = 0 local ch = config["hosts"] for host in ipairs(ch) do hosts:set(ch[host]["id"], ch[host]["host"]) hosts:set(host, ch[host]["host"]) len=1+len end -- set length of hosts hosts:set(0,...
nilq/small-lua-stack
null
local brave = require "telescope._extensions.bookmarks.brave" describe("brave", function() describe("collect_bookmarks", function() it("should parse bookmarks file", function() local bookmarks = brave.collect_bookmarks( { os_name = "Darwin", os_homedir = "spec/fixtures" }, { selected_browse...
nilq/small-lua-stack
null
Set = {} local mt = {} -- 集合的元表 -- 根据参数列表中的值创建一个新的集合 function Set.new(l) local set = {} setmetatable(set, mt) for _, v in pairs(l) do set[v] = true end mt.__metatable = "You cannot get the metatable" -- 设置完的元表以后,不让其他人再设置 return set end -- 并集操作 function Set.union(a, b) local retSet = Set.n...
nilq/small-lua-stack
null
function onStepHit() if curStep == 544 then doTweenAlpha('dient', 'gradient1', 0, 0.4, 'linear') setProperty('gradient1.alpha', 1) doTweenAlpha('dient1', 'gradient', 0, 0.4, 'linear') setProperty('gradient.alpha', 1) end if curStep == 547 then doTweenAlpha('dient...
nilq/small-lua-stack
null
-- 消息窗 local MsgBox = LDeclare("MsgBox", LClass("MsgBox")) function MsgBox:Start() print("MsgBox Start") self.btn_close = self.gameObject.transform:Find("btn_close"):GetComponent(Button) self.btn_close.onClick:AddListener(function() self.gameObject:GetComponent(Image).sprite = nil LWindowManager...
nilq/small-lua-stack
null
module ('mock') function loadAssetDataTable(filename) --lua or json? -- _stat( 'loading json data table', filename ) if not filename then return nil end local f = io.open( filename, 'r' ) if not f then error( 'data file not found:' .. tostring( filename ),2 ) end local text=f:read('*a') f:close() local data...
nilq/small-lua-stack
null
math.randomseed(os.time()) local max = 1000 local N = math.random(max) print("Welcome to the number guessing game!") print("I am thinking of a number between 1 and " .. max) local tries = 0 while true do print("Take a guess:") local input = io.read() local guess = tonumber(input) if guess == nil then print("...
nilq/small-lua-stack
null
-- some constant return { luals_repos = vim.loop.os_homedir()..'/repos/lua-language-server/', lsp_condaenv_bin = vim.loop.os_homedir()..'/miniconda3/envs/dev_env_ansible/bin/', pses_bundle_path = vim.env.HOME..'/repos/PowerShellEditorServices/module' } -- vim:et ts=2 sw=2
nilq/small-lua-stack
null
ITEM.Name = 'TV Head' ITEM.Price = 100 ITEM.Model = 'models/props_c17/tv_monitor01.mdl' ITEM.Attachment = 'eyes' function ITEM:OnEquip(ply, modifications) ply:PS_AddClientsideModel(self.ID) end function ITEM:OnHolster(ply) ply:PS_RemoveClientsideModel(self.ID) end function ITEM:ModifyClientsideModel(ply, model, po...
nilq/small-lua-stack
null
local narrator = require('narrator.narrator') local book = narrator.parseFile('stories/main', { save = true })
nilq/small-lua-stack
null
gd = require "gd" im = gd.createTrueColor(160, 50) red = im:colorAllocate(255, 0, 0) green = im:colorAllocate(0, 255, 0) blue = im:colorAllocate(0, 0, 255) white = im:colorAllocate(255, 255, 255) black = im:colorAllocate(0, 0, 0) im:filledRectangle(0, 0, 160, 50, white) im:filledRectangle(1, 2, 48, 13, red) im:fil...
nilq/small-lua-stack
null
ys = ys or {} slot1 = singletonClass("BattleNPCCharacterFactory", ys.Battle.BattleEnemyCharacterFactory) ys.Battle.BattleNPCCharacterFactory = slot1 slot1.__name = "BattleNPCCharacterFactory" slot1.Ctor = function (slot0) slot0.super.Ctor(slot0) slot0.HP_BAR_NAME = slot0.super.Ctor.Battle.BattleHPBarManager.HP_BAR_...
nilq/small-lua-stack
null
-- Copyright (c) 2021 Trevor Redfern -- -- This software is released under the MIT License. -- https://opensource.org/licenses/MIT describe("moonpie.tables.map_keys", function() local tables = require "moonpie.tables" it("works with keyed sets", function() local key_set = { a = 1, b = 2, c = 3...
nilq/small-lua-stack
null
while true do white = color.new(255, 255, 255) black = color.new(0, 0, 0) sound.stop(menumusic) office1:blit(0, 0) --blackfullscreen:blit(0, 0, whatnight_tr[1]) --screen.print(240, 128, "whatnight_txt", 1, white, black, __ACENTER) if night == 1 then nightnum = nightnum_1 end nightnum:blit(0, 0, ...
nilq/small-lua-stack
null
-- $Id: //depot/Projects/StarWars_Expansion/Run/Data/Scripts/AI/LandMode/BuildBarracksLand.lua#2 $ --///////////////////////////////////////////////////////////////////////////////////////////////// -- -- (C) Petroglyph Games, Inc. -- -- -- ***** ** * * -- * ** ...
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 { Const = { Currency = 1001017, DailyFreeTimes = 1, Infinite = { { 1, 4 }, { 2, 0 }, }, OnceCost = 1 }, PoolCfg = { { { 1, 2, 3, ...
nilq/small-lua-stack
null
function gmod.BroadcastLua(lua) for _, pl in pairs(player.GetAll()) do pl:SendLua(lua) end end function net.Quick( msg, rf ) net.Start( msg ) if( not rf ) then net.Broadcast() else net.Send( rf ) end end function GM:PosInWater(Pos) return bit.band(util.PointContents(Pos), CONTENTS_W...
nilq/small-lua-stack
null
local ReplicatedStorage = game:GetService('ReplicatedStorage') local Modules = ReplicatedStorage:WaitForChild('Modules') local src = Modules:WaitForChild('src') local logger = require(src.utils.Logger) local InventoryObjects = require(src.objects.InventoryObjects) local PET_TYPES = InventoryObjects.PET_TYPES local Pet ...
nilq/small-lua-stack
null
IncludeDir = {} IncludeDir["GLFW"] = "../Engine/vendor/glfw/include/" IncludeDir["Glad"] = "../Engine/vendor/glad/include/" IncludeDir["ImGui"] = "../Engine/vendor/imgui/" IncludeDir["spdlog"] = "../Engine/vendor/spdlog/include" IncludeDir["cereal"] = "../Engine/vendor/cereal/include" IncludeDir["stb"] = "../Engine/ven...
nilq/small-lua-stack
null
do local Nil = { __tag = "Nil" }; (nil)({ { _1 = 1, _2 = { { _1 = 2, _2 = { { _1 = 3, _2 = Nil }, __tag = "Cons" } }, __tag = "Cons" } }, __tag = "Cons" }); (nil)(1); (nil)({ { _1 = 2, _2 = Nil }, __tag = "Cons" }) local function k(xss) if xss.__tag ~= "Cons" then return Nil end local tmp = ...
nilq/small-lua-stack
null
local composer = require( "composer" ) local colors = require('classes.colors-rgb') local scene = composer.newScene() local widget = require("widget") widget.setTheme ( "widget_theme_ios" ) local screenLeft = display.screenOriginX local screenWidth = display.viewableContentWidth - screenLeft * 2 local screenRight = sc...
nilq/small-lua-stack
null
-- Generated By protoc-gen-lua Do not Edit local protobuf = require "protobuf/protobuf" local ATTRIBUTEINFO_PB = require("AttributeInfo_pb") module('FashionData_pb') FASHIONDATA = protobuf.Descriptor(); local FASHIONDATA_ITEMID_FIELD = protobuf.FieldDescriptor(); local FASHIONDATA_LEVEL_FIELD = protobuf.FieldDescript...
nilq/small-lua-stack
null
require "x_functions"; if not x_requires then -- Sanity check. If they require a newer version, let them know. timer = 1; while (true) do timer = timer + 1; for i = 0, 32 do gui.drawbox( 6, 28 + i, 250, 92 - i, "#000000"); end; gui.text( 10, 32, string.format("This Lua script requires the x_functions lib...
nilq/small-lua-stack
null
function OrgImports(wait_ms) local params = vim.lsp.util.make_range_params() params.context = {only = {"source.organizeImports"}} local result = vim.lsp.buf_request_sync(0, "textDocument/codeAction", params, wait_ms) for _, res in pairs(result or {}) do for _, r in pairs(res.result or {}) do ...
nilq/small-lua-stack
null
EditorOptionsMenu = EditorOptionsMenu or class() local Options = EditorOptionsMenu function Options:init() local O = BLE.Options local EMenu = BLE.Menu local icons = BLE.Utils.EditorIcons local page = EMenu:make_page("Options", nil, {scrollbar = false}) ItemExt:add_funcs(self, page) local w = page:ItemsWidth(2, ...
nilq/small-lua-stack
null
-- ========= -- LOAD FILE -- ========= --- Load file contents ---@param fileName string FilePath ---@param context string PathContext. 'data' for modData. 'user' or nil for osirisData ---@return table file Parsed file contents ---@return string fileContents Stringified file contents function LoadFile(fileName, cont...
nilq/small-lua-stack
null
--[[ * Configuration for <archive.lua> script. * ]] -- ---------------------------------------------------------------------------- -- local tConfiguration = { sCfgVersion = "0.0.2", bUseMove = false, -- move files instead of copy bUseCurDay = false, -- use todays' date or modification time of ...
nilq/small-lua-stack
null