content
stringlengths
0
1.05M
origin
stringclasses
2 values
type
stringclasses
2 values
--------------------------------------------------------------------------- --- Additional hotkeys for awful.hotkeys_widget -- -- My custom key bindings --------------------------------------------------------------------------- local keys = { firefox = require("module.hotkeys_popup.keys.firefox"), tmux = require...
nilq/small-lua-stack
null
local constants = require("constants") local cached_signals = require("cached_signals") local logger = require("logger") local overlay_gui = {} local signal_parent_name = "ac_overlay_signal_parent" local constant_parent_name = "ac_overlay_constant_parent" local constant_set_name = "ac_overlay_constant_set" local overl...
nilq/small-lua-stack
null
-- telescope mappings vim.keymap.set("n", "<Leader>ff", function() R("ape.telescope").find_files() end) vim.keymap.set("n", "<Leader>fh", function() R("ape.telescope").help_tags() end) vim.keymap.set("n", "<Leader>fg", function() R("ape.telescope").live_grep() end) vim.keymap.set("n", "<Leader>fm", function() R...
nilq/small-lua-stack
null
ROT=require 'src.rot' function love.load() f =ROT.Display(211, 75) em=ROT.Map.EllerMaze:new(f:getWidth(), f:getHeight()) em:create(calbak) end function love.draw() f:draw() end ellerStr='' function calbak(x,y,val) f:write(' ', x, y, nil, val==0 and { 125, 125, 125, 255 } or nil) end local update=false f...
nilq/small-lua-stack
null
function technic.chests.send_digiline_message(pos, event, player, items) local set_channel = minetest.get_meta(pos):get_string("channel") local player_name = player and player:get_player_name() or "" digilines.receptor_send(pos, digilines.rules.default, set_channel, { event = event, items = items, player = pl...
nilq/small-lua-stack
null
local HeroAttribute = GetFileConfig(OUTPUTBASE.."server/setting/yongbing_cfg.lua") return function (Data) local AttributeList = Split(Data, ";") local RtTbl = {} for _,Attribute in pairs(AttributeList) do if Attribute ~= "" then local Value = Split(Attribute, ",") assert(#Value == 3,"参数有误,应为属性名,初始值,成长值") ...
nilq/small-lua-stack
null
return function() local InspectAndBuyFolder = script.Parent.Parent local SetDetailsInformation = require(InspectAndBuyFolder.Actions.SetDetailsInformation) local DetailsInformation = require(script.Parent.DetailsInformation) local function countKeys(t) local count = 0 for _ in pairs(t) do count = count + 1 ...
nilq/small-lua-stack
null
PLUGIN.Title = "Helptext" PLUGIN.Description = "Hooks into plugins to send helptext" PLUGIN.Author = "#Domestos" PLUGIN.Version = V(1, 0, 2) PLUGIN.ResourceId = 962 function PLUGIN:Init() command.AddChatCommand("help", self.Object, "cmdHelp") self:LoadDefaultConfig() end function PLUGIN:L...
nilq/small-lua-stack
null
return function() local tableDifference = require(script.Parent.tableDifference) local expectTable = require(script.Parent.unitTests.expectTable) describe("WHEN given two tables", function() it("SHOULD return an empty table if lists are the same", function() local listA = {1, 2, 3} local listB = {1, 2, 3} ...
nilq/small-lua-stack
null
local K, C = unpack(select(2, ...)) local _G = _G C.themes["Blizzard_Collections"] = function() local WardrobeFrame = _G["WardrobeFrame"] local WardrobeTransmogFrame = _G["WardrobeTransmogFrame"] local initialParentFrameWidth = WardrobeFrame:GetWidth() -- Expecting 965 local desiredParentFrameWidth = 109...
nilq/small-lua-stack
null
object_mobile_dressed_tatooine_opening_aigorn = object_mobile_shared_dressed_tatooine_opening_aigorn:new { } ObjectTemplates:addTemplate(object_mobile_dressed_tatooine_opening_aigorn, "object/mobile/dressed_tatooine_opening_aigorn.iff")
nilq/small-lua-stack
null
-- config setDefaultTab("Tools") local defaultBp = "shopping bag" local id = 21411 -- script local playerContainer = nil local depotContainer = nil local mailContainer = nil function reopenLootContainer() for _, container in pairs(getContainers()) do if container:getName():lower() == defaultBp:lower() then ...
nilq/small-lua-stack
null
--[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]] local ____exports = {} do local ____init = require("lib.effect") local clearEffects = ____init.clearEffects local startEffect = ____init.startEffect local allEffects = ____init.allEffects local effect = ____init.effect ___...
nilq/small-lua-stack
null
local mod1544C = RegisterMod("15-44C",1) local game = Game() local sfx = SFXManager() local r = RNG() r:SetSeed(Random(),1) local HudPickups = Sprite() HudPickups:Load("gfx/ui/heart_icon2.anm2",true) local HudNumbers = Sprite() HudNumbers:Load("gfx/ui/hud_numbers.anm2",true) local HudPrice = Sprite() HudPrice:Load(...
nilq/small-lua-stack
null
local PANEL_Browser = {} PANEL_Browser.Base = "DFrame" function PANEL_Browser:Init() self.HTML = vgui.Create("HTML", self) if (not self.HTML) then print("SteamOverlayReplace: Failed to create HTML element") self:Remove() return end self.HTML:Dock(FILL) self.HTML:SetOpenLi...
nilq/small-lua-stack
null
fx_version 'cerulean' games { 'gta5' } version '1.10.0' description 'https://github.com/thelindat/nui_doorlock' versioncheck 'https://raw.githubusercontent.com/thelindat/nui_doorlock/main/fxmanifest.lua' server_scripts { '@es_extended/locale.lua', 'config.lua', 'configs/**/*.lua', 'server/main.lua' } client_scri...
nilq/small-lua-stack
null
local E, L, V, P, G = unpack(select(2, ...)); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB local S = E:GetModule('Skins') --Lua functions local _G = _G --WoW API / Variables local CreateFrame = CreateFrame local hooksecurefunc = hooksecurefunc local function LoadSkin() if E.private.skins.blizzard.enable...
nilq/small-lua-stack
null
local class = require "middleclass" local i = require "inspect" local hs = utils.hash.string MainMenuState = class("MainMenuState", State) function MainMenuState:initialize() self.input = nil -- Create your Mainmenu here, but for now just create a Text, telling us to press Space self.text = TextRenderComponent.new...
nilq/small-lua-stack
null
local setmetatable, getmetatable = setmetatable, getmetatable; local ipairs = ipairs; local tostring = tostring; local type = type; local assert, pcall, debug_traceback = assert, pcall, debug.traceback; local xpcall = require "util.xpcall".xpcall; local t_concat = table.concat; local log = require "util.logger".init("...
nilq/small-lua-stack
null
object_tangible_furniture_all_frn_all_holocron_color_dode = object_tangible_furniture_all_shared_frn_all_holocron_color_dode:new { } ObjectTemplates:addTemplate(object_tangible_furniture_all_frn_all_holocron_color_dode, "object/tangible/furniture/all/frn_all_holocron_color_dode.iff")
nilq/small-lua-stack
null
local ACTOR = {} -- 引数が関数、あるいは関数を持つテーブルの場合にtrueを返す。 local function is_function(v) local tp = type(v) if tp=="function" then return true elseif tp=="table" then local meta = getmetatable(v) if meta.__call then return true end end return false end -- 引数が関数...
nilq/small-lua-stack
null
-- Fun little algorithm from the first chapter of The New Turing Omnibus by -- A.K. Dewdney. Try playing with different parameters require("imlib2") local corner_a, corner_b, side = ... assert(corner_a and corner_b and side, "Please provide 3 integer parameters") local side_length = 500 im = imlib2.image.new(side_l...
nilq/small-lua-stack
null
local kong_default_conf = require "kong.templates.kong_defaults" local pl_stringio = require "pl.stringio" local pl_stringx = require "pl.stringx" local constants = require "kong.constants" local pl_pretty = require "pl.pretty" local pl_config = require "pl.config" local http_tls = require "http.tls" local pl_file = re...
nilq/small-lua-stack
null
----------------------------------- -- Area: Mhaura -- NPC: Katsunaga -- Type: Standard NPC -- !pos -4.726 -2.148 23.183 249 ----------------------------------- function onTrade(player,npc,trade) end; function onTrigger(player,npc) player:startEvent(190); end; function onEventUpdate(player,csid,option) end; fu...
nilq/small-lua-stack
null
return { --> identifying information <-- id = 10; --> generic information <-- name = "Elder Beard"; rarity = "Common"; image = "rbxassetid://2528901939"; description = "A beard stolen from an Elder Shroom"; --> handling information <-- canStack = true; canBeBound = false; canAwaken = false; ...
nilq/small-lua-stack
null
local RBT = LibStub("AceAddon-3.0"):GetAddon("ReturnBuffTracker") local L = LibStub("AceLocale-3.0"):GetLocale("ReturnBuffTracker") --@debug@ local LoggingLib = LibStub("LoggingLib-0.1") --@end-debug@ local options = nil local function getOptions() if options then return options end options...
nilq/small-lua-stack
null
local lsp_installer = require('nvim-lsp-installer') local utils = require('utils') -- Update diagnostics while typing. vim.diagnostic.config { update_in_insert = true, } -- Format on save. local on_attach = function(client, bufnr) vim.api.nvim_command[[autocmd BufWritePre <buffer> lua vim.lsp.buf.formatting_s...
nilq/small-lua-stack
null
-- stylua: ignore start local function orderCalculation(order, a, b) local temp = a * b local blah = (order.quantity * order.itemPrice) - 7 print(string.format("%d %d"), temp, blah) return order.quantity * order.itemPrice - math.max(0, order.quantity - 500) * order.itemPrice * 0.05 + ...
nilq/small-lua-stack
null
require "Logic/CameraFollow" require "Logic/InputControl" require "Logic/Character" require "Logic/SelectControl" require "Logic/SkillControl" World = { }; local convertRad2Angle = 360 / (Mathf.PI * 2); function World.init() Event.AddListener("onAvatarEnterWorld", World.onAvatarEnterWorld); Event.AddListener("onEn...
nilq/small-lua-stack
null
local api = require("api") local compression_map = {} for entry in ("\n 0123456789abcdefghijklmnopqrstuvwxyz!#%(){}[]<>+=/*:;.,~_"):gmatch( "." ) do table.insert(compression_map, entry) end local function decompress(code) local lua = "" local mode = 0 local copy = nil local i = 8 local codelen = bit.lshift(cod...
nilq/small-lua-stack
null
local font_data = { minfilter = "linear", magfilter = "linear", is_premult = true, { filename = "sprites/Untitled.png", x1 = 0, y1 = 0, x2 = 8, y2 = 8, s1 = 0.0078125, t1 = 0.859375, s2 = 0.0703125, t2 = 0.984375, width = 8, height = 8, }, } return am._init_fonts(fon...
nilq/small-lua-stack
null
local function fuckyou() -- because fuck you. local DAYZ = false local MODERNRP = false if (engine.ActiveGamemode() == "cityrp") then MODERNRP = true end if (engine.ActiveGamemode() == "dayz") then DAYZ = true end signal = signal or {} signal.list = { { name = "quickGiveMoney", canDisplay = function(client,...
nilq/small-lua-stack
null
-- Copyright 2021 - Deviap (deviap.com) local breakpointer = require("devgit:source/libraries/UI-breakpointer/main.lua") local colourMap = require("devgit:source/application/utilities/colourScheme.lua") local container = core.construct("guiFrame", { parent = core.interface, size = guiCoord(1, 0, 1, 100), position =...
nilq/small-lua-stack
null
--[[ Copyright (c) 2011 John Pirie 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, distribute, su...
nilq/small-lua-stack
null
require "controls/list" require "controls/button" require "controls/text-input" require "data/native-file" require "views/tile-editor" TilesheetList = {} TilesheetList.__index = TilesheetList --- Open an editor at the top of the view stack and remove it when it is closed -- @param editor The editor to open local fun...
nilq/small-lua-stack
null
---@class FMODAudio : fmod.fmod.FMODAudio ---@field public emitter BaseSoundEmitter FMODAudio = {} ---@public ---@return void function FMODAudio:pause() end ---@public ---@return String function FMODAudio:getName() end ---@public ---@return boolean function FMODAudio:isPlaying() end ---@public ---@param arg0 float ...
nilq/small-lua-stack
null
---@classmod Effect Effect = Class{} ---Initiates an effect. Don't call this explicitly, it's called when you create a new effect with Effect('effectID'). --@param effect_type String. The ID of the effect you want to create. --@param anything Anything. The arguments to pass to the effect's new() callback. Can be any n...
nilq/small-lua-stack
null
/*--------------------------------------------------------------------------- Disabled defaults ---------------------------------------------------------------------------*/ DarkRP.disabledDefaults = {} DarkRP.disabledDefaults["modules"] = { ["afk"] = true, ["chatsounds"] = false, ["events"] ...
nilq/small-lua-stack
null
ENT.Base = "base_point" ENT.Type = "point" --serverside only, only the above is needed shared if CLIENT then return end AccessorFunc(ENT, "QueueActive", "QueueActive", FORCE_BOOL) --custom to entity ENT.Keys = {} ENT.QueuedSpawns = {} --entity functions function ENT:Initialize() self:SetQueueActive(false) end --fe...
nilq/small-lua-stack
null
world = ' World' function main() while true do print('Hello' .. world) end end live.patch('main', main) live.start(main)
nilq/small-lua-stack
null
local discordia = require('discordia') local client = discordia.Client() local cfg = require('./config') local commandHandler = require('./modules/command') local eventHandler = require('./modules/events') commandHandler.load() for k, v in pairs(eventHandler) do client:on(k, function(...) v(client, ...)...
nilq/small-lua-stack
null
-- Batch normalized googlenet --this code is from: https://github.com/soumith/imagenet-multiGPU.torch ---- We simply replace the standard linear module by our centered linear module in this architecture require '../module/spatial/Spatial_Scaling' require '../module/spatial/cudnn_Spatial_Weight_CenteredBN' local f...
nilq/small-lua-stack
null
local kernel = {} kernel.language = "glsl" kernel.category = "default" kernel.name = "default" kernel.vertex = [[ P_POSITION vec2 VertexKernel( P_POSITION vec2 position ) { return position; } ]] kernel.fragment = [[ P_COLOR vec4 FragmentKernel( P_UV vec2 texCoord ) { return texture2D( u_FillSampler0, texCoord...
nilq/small-lua-stack
null
SOUNDS_CONFIG = { soundChannel = 4, checkInterval = 500, folder = 'music/', noSound = 'Nenhum arquivo de som', } local MUSICA = { [0] = {name = "Caverna_da_Morte.ogg"}, [1] = {name = "Ruinas_Antigas.ogg"}, [2] = {name = "Templo_Obscuro.ogg"}, } SOUNDS = { {fromPos = {x = 285, y = 58, z = 14}, toPos = {x = 395, y...
nilq/small-lua-stack
null
--::--::--::--::--::--::--::--::--::--::--::--::--::--::--::--::--::--::--::--::--::--::--::--::-- -- Mapeamentos ----------------------------------------------------------------------------------- --::--::--::--::--::--::--::--::--::--::--::--::--::--::--::--::--::--::--::--::--::--::--::--::-- --::--::--::--::--::--...
nilq/small-lua-stack
null
local ConfigScene = Scene:extend() ConfigScene.title = "Input Config" require 'load.save' local configurable_inputs = { "left", "right", "up", "down", "rotate_left", "rotate_right", "rotate_left2", "rotate_right2", "rotate_180", "hold", "retry", "pause", } local configurable_inputs_readable = { "Left",...
nilq/small-lua-stack
null
local capi = { client = client, mousegrabber = mousegrabber, mouse = mouse, screen = screen, } local math = math local wibox = require("wibox") local awful = require("awful") local cairo = require("lgi" ).cairo local module = {} local w = nil local function set_device(input_ids,geometry) ...
nilq/small-lua-stack
null
return { PlaceObj("ModItemOptionToggle", { "name", "NeverChange", "DisplayName", T(302535920011087, "Never Change"), "Help", T(302535920011500, "Residents will never change residence (may cause issues)."), "DefaultValue", false, }), }
nilq/small-lua-stack
null
slot3 = package.seeall module(slot1, "FfiStructTables") ZJH_CMD_S_Brand = { cbCardData = { _t = 1, _l = { 5, 3 } } } ZJH_CMD_S_SendCard = { cbCardData = { _t = 1, _l = { 5, 3 } } } ZJH_CMD_S_GiveUp = { wGiveUpUser = 1, cbCardData = { _t = 1, _l = { 3 } } } ZJH_CMD_S_AddScore = ...
nilq/small-lua-stack
null
local classes = classes; local super = classes.Instance; local class = inherit({ name = "Mouse", super = super, func = inherit({}, super.func), get = inherit({}, super.get), set = inherit({}, super.set), concrete = true, }, super); classes[class.name] = class; ...
nilq/small-lua-stack
null
--!A cross-toolchain 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 la...
nilq/small-lua-stack
null
local list = require('list') local os = require('os') local packet = require('packet') local queue = require('queue') local settings = require('settings') local ui = require('core.ui') local state = require('pv.state') local pv = require('pv.pv') local display do local defaults = { visible = ...
nilq/small-lua-stack
null
function createSet(low,high,rt) local l,h = tonumber(low), tonumber(high) if l and h then local t = {low=l, high=h} if type(rt) == "string" then if rt == "open" then t.contains = function(d) return low< d and d< high end elseif rt == "closed" then ...
nilq/small-lua-stack
null
--------------------------------------------------------------- -- Copyright 2021 Deviap (https://deviap.com/) -- --------------------------------------------------------------- -- Made available under the MIT License: -- -- https://github.com/deviap/deviap-main/blob/master/LICENSE -- ...
nilq/small-lua-stack
null
return require("deps/lyaml/init")
nilq/small-lua-stack
null
local test_env = require("spec.util.test_env") local run = test_env.run local testing_paths = test_env.testing_paths test_env.unload_luarocks() describe("luarocks upload #integration", function() before_each(function() test_env.setup_specs() end) it("with no flags/arguments", function() assert....
nilq/small-lua-stack
null
--[[ entitas.entity ~~~~~~~~~~~~~~ An entity is a container holding data to represent certain objects in your application. You can add, replace or remove data from entities. Those containers are called 'components'. They are represented by namedtuples for readability. ]] local table_unpack = table.unpack local Delegat...
nilq/small-lua-stack
null
counter = 1 for _, recipe in pairs(data.raw["recipe"]) do if recipe.category == "smelting" then counter = counter + 1 end end log(counter .. " total smelting recipes") -- fix bobs stupid belt speed changes in data-updates if settings.startup["bobmods-logistics-beltoverhaul"] and settings.startup["bobm...
nilq/small-lua-stack
null
-- This Lua script routes the request based on code version -- and the path of the HTTP request. m = Map.new("maps/code_vsn_path.map", Map.str) function get_code_vsn(txn) local hdr = txn.http:req_get_headers() if hdr["cookie"] == nil then return "1.0.0" end local cookie = hdr["cookie"][0] local c_nam...
nilq/small-lua-stack
null
if not vim.g.vscode then require("core") end
nilq/small-lua-stack
null
local trigger = {} trigger.name = "MaxHelpingHand/CameraOffsetBorder" trigger.placements = { name = "trigger", data = { topLeft = true, topCenter = true, topRight = true, centerLeft = true, centerRight = true, bottomLeft = true, bottomCenter = true, ...
nilq/small-lua-stack
null
return {'suus','suurmond','suurd','suur','suurland','suus'}
nilq/small-lua-stack
null
-- // ------------------------------------------------------------------- // -- -- // // -- -- // A T O M A G I C A L Y G E N E R A T E D F I L E // -- -- // - D O N O T E D I T - // ...
nilq/small-lua-stack
null
-- PlayFab Profiles API -- This is the main file you should require in your game -- All api calls are documented here: https://api.playfab.com/Documentation/Profiles -- Example code: -- local PlayFabProfilesApi = require("PlayFab.PlayFabProfilesApi") -- PlayFabProfilesApi.<ProfilesApiCall>(request, successCallbackFunc,...
nilq/small-lua-stack
null
include("terms") ind = math.random(4) qq = math.random(4) pp = qq + math.random(8 - qq) temp = lib.math.gcd(pp, qq) pp = math.floor(pp/temp) qq = math.floor(qq/temp) fact = math.random(3) numb = fact *(qq + 2 * pp) if (ind < 4) then name = msg1[ind] quest = msg2[1] reply = "." else name = msg...
nilq/small-lua-stack
null
require("PacketInspector") local Inspector = PacketInspector() Inspector.Filters.Send = function(p) return DumpPacketData(p):find(EncodeFHex(myHero.networkID)) end function OnLoad() Inspector:StartLog(true, true) end
nilq/small-lua-stack
null
--[[ Copyright 2012 The lev Authors. All Rights Reserved. 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 or agree...
nilq/small-lua-stack
null
local specs = {} function spectateStart( player, target, savePos ) triggerClientEvent( player, "spectateStart", player, target, savePos ) specs[player] = true end function spectateStop( player, ignoreSaves ) triggerClientEvent( player, "spectateStop", player, ignoreSaves ) specs[player] = false end function ...
nilq/small-lua-stack
null
--给客户端请求的返回码 local ret_arr = { OK = 0, --成功 --登录 LOGIN_GUEST_REGISTER_FAIL = 201, --游客用户创建失败 LOGIN_PLATFORM_ERROR = 202, --平台编号错误 --创建房间 ROOM_CREATE_FAIL = 211, --创建房间失败 ROOM_CREATE_...
nilq/small-lua-stack
null
--[[ @author Ilias-Timon Poulakis (FeedTheCat) @license MIT @version 1.0.2 @about Create an approximate razor edit from time selection ]] local expand_beat_limit = 3 local shrink_beat_limit = 3 reaper.Undo_BeginBlock() local sel_start_pos, sel_end_pos = reaper.GetSet_LoopTimeRange(false, true, 0, 0, false) lo...
nilq/small-lua-stack
null
SystemMemoryLevel = SystemMemoryLevel or {} SystemMemoryLevel.Low = 1 SystemMemoryLevel.Middle = 2 SystemMemoryLevel.Hight = 3 SystemMemoryLevel.Cur = nil function SystemMemoryLevel.Init() local memory_size = math.floor(GetSystemMemorySize()/1024 + 0.5) local lowMem,mediumMem,highMem = 1,2,3 if ApplicationPlatform ...
nilq/small-lua-stack
null
spawner = entity:extend() function spawner:new(x, y, w, h, func) spawner.super.new(self) self.transform.y = y self.transform.x = x self:setRectangleCollision(w, h) self.func = func self.added = function(self) self:addToGroup("despawnable") self:addToGroup("freezable") self.wasOutside...
nilq/small-lua-stack
null
local testcase = require('testcase') local error_check = require('error').check function testcase.check() for fn, v in pairs({ -- noneornil [error_check.noneornil] = { valid = {}, invalid = { { arg = 'foo', match = 'non...
nilq/small-lua-stack
null
local coroutine = require "prailude.util.coroutine" local Timer = require "prailude.util.timer" local uv = require "luv" local mm = require "mm" local ERR = { ENOSTR = "Device not a stream", --60 ENODATA = "No data available", --61 ENOSR = "Out of streams resources", --63 ENONET = "Mach...
nilq/small-lua-stack
null
zuus_cloud_oaa = class( AbilityBaseClass ) LinkLuaModifier( "modifier_zuus_cloud_oaa", "abilities/oaa_zuus_cloud.lua", LUA_MODIFIER_MOTION_NONE ) LinkLuaModifier( "modifier_zuus_bolt_true_sight", "abilities/oaa_zuus_cloud.lua", LUA_MODIFIER_MOTION_NONE ) function zuus_cloud_oaa:GetAOERadius() return self:GetSpecialV...
nilq/small-lua-stack
null
#!/usr/bin/lua --[[ print(type("fuck python")) print(type('all hail Archlinux')) print(type(a)) print(type(123)) print(type(false)) --]] --如果需要直接调用解释器跑脚本,记得chmod 755 --[[ 不然直接 lua 文件名.lua 或者直接用vscode的插件跑也行? --]] local count=0 local tbl = {"apple", "pear", "orange", "grape"}--设定一个长度为4的table for k,v in pairs(tbl) do co...
nilq/small-lua-stack
null
local REDNET_PROTOCOL = "REMOTE_PERIPHERAL" local UPDATE_INTERVAL = 1 --===== OPEN REDNET =====-- for _, side in ipairs(redstone.getSides()) do if peripheral.getType(side) == "modem" then rednet.open(side) end end if not rednet.isOpen() then printError("could not open rednet") return end --===== PERIPHERALS ==...
nilq/small-lua-stack
null
--[=[ @class IKRigBase ]=] local ArmIKBase = require(script.Parent.Parent.Arm.ArmIKBase) local BaseObject = require(script.Parent.Parent.Parent.Classes.BaseObject) local CharacterUtility = require(script.Parent.Parent.Parent.Utility.CharacterUtility) local Promise = require(script.Parent.Parent.Parent.Parent.Promise)...
nilq/small-lua-stack
null
coroutine.yield() shell.run("clear") _G.userloggedin = true while _G.userloggedin do shell.run(reg.system.Goldcore.COSC.Userinit.CMDLine) end
nilq/small-lua-stack
null
-- This file is part of the Luau programming language and is licensed under MIT License; see LICENSE.txt for details print("testing coverage") function foo() local x = 1 local y = 2 assert(x + y) end function bar() local function one(x) return x end local two = function(x) return x end one(1) end funct...
nilq/small-lua-stack
null
state = 1; fastscroll = 0; return Def.ActorFrame{ -- MUSIC --nikkmod LoadActor(THEME:GetPathS("","SongChosen"))..{ SongChosenMessageCommand=cmd(playcommand,"Check1";); StartSelectingSongMessageCommand=cmd(playcommand,"Check2";); SongUnchosenMessageCommand=function(self) state = 1; end; Chec...
nilq/small-lua-stack
null
local vimp = require('vimp'); local map = vim.api.nvim_set_keymap; -- Map leader key to <space> map("n", "<space>", "", {noremap = true}); vim.g.mapleader = " "; -- Terminal map("n", "<leader>tt", ":terminal<CR>", {}); map("n", "<leader>tj", ":bot 10new +terminal | setlocal nobuflisted<CR>", {}); map("n", "<leader>tl...
nilq/small-lua-stack
null
--Do nothing if smart-prompt is disabled, or variables not initialized if not mmpkg.conf.smartprompt or not mmpkg.myAffects then return end --Copy2decho the hp/sp/st part of the prompt. local prompt = copy2decho(matches[9]) local search = "" local away = "" local tank = "" if matches[2] ~= "" then ...
nilq/small-lua-stack
null
local xmlua = require("xmlua") local cjson = require('cjson.safe'); local basic_stuff = require("lua_schema.basic_stuff"); local nsd_cache = require("lua_schema.nsd_cache"); local error_handler = require("lua_schema.error_handler"); local _message_handler_factory = {}; local get_json_tag = function(message_handler_in...
nilq/small-lua-stack
null
local function myCallback(Toy, distance, callbackInfo , colliderInfoA, colliderInfoB, rawDistance) if (distance > 0) then local value = (0.40 - distance) / 0.15 Toy:setVibration(value) else Toy:setVibration(0) end end CTRL.Name = "Lovense Hush Generic Distance-Variant Controller" CTRL.Callbacks = { { ...
nilq/small-lua-stack
null
t=2e9 -- start time from large value to distribute clouds function TIC() -- visuals: for z=1,9 do -- z=1 far, z=9 near y=239 -- star height of the mountains for c=0,y do -- loop over all columns r=math.sin(c) -- ~ random value x=r*z*t/40%302-30 -- move near clouds faster rect(c,y/2,1,y,0) -- draw mountain...
nilq/small-lua-stack
null
local gui = require("gui-plus") return gui.register_class{ name = "foo", type = "frame", caption = "foo", elem_mods = { auto_center = true, }, direction = "vertical", children = { { type = "label", name = "label", caption = gui.dynamic{ on = "state.count", set ...
nilq/small-lua-stack
null
local objectID = 15060 local maxStones = 3 local mainSpeed = 100 local collissionSize = 3 local stompSize = 4 local lodDistance = 200 local Stones = {} Stones[1] = {} Stones[1].coords = {} Stones[1].coords[1] = {x = -57.5195, y = -397.0664, z = 657.6593} Stones[1].coords[2] = {x = -42.2619, y = -442.2524, z = 657.6570...
nilq/small-lua-stack
null
local world local game local lib world = { win_time = 3, win_elapsed = 0, winnable = true, map = nil, camera = nil, entities = {}, draw = function(self, event) love.graphics.setColor(255, 255, 255) if (self.camera) then self.camera:apply() end if (self.map) then self.map:draw() end for ke...
nilq/small-lua-stack
null
local grid = {} local function resetGrid() hs.grid.setGrid('12x12') end resetGrid() hs.grid.setMargins('0,0') hs.grid.ui.textSize = 100 hs.grid.ui.showExtraKeys = false hs.window.animationDuration = 0 local dataByWindowId = {} function cleanupWindowData() for id, data in pairs(dataByWindowId) do if data.win...
nilq/small-lua-stack
null
ITEM.name = "Combat Pack" ITEM.desc = "A medium sized backpack designed for skirmishes." ITEM.invWidth = 4 ITEM.invHeight = 3 ITEM.width = 2 ITEM.height = 2
nilq/small-lua-stack
null
local popup = {} local api = vim.api local function calc_width(lines) local width = 0 for _, l in ipairs(lines) do local len = vim.fn.strdisplaywidth(l) if len > width then width = len end end return width end local function bufnr_calc_width(buf, lines) return api.nvim_buf_c...
nilq/small-lua-stack
null
--[[ TheNexusAvenger Class for a Sword Swept round. --]] local TEAM_TOOLS = { ["Bright blue"] = { "Sword", }, ["Bright red"] = { "Broom", }, } local ReplicatedStorage = game:GetService("ReplicatedStorage") local NexusReplication = require(ReplicatedStorage:WaitForChild("External"):...
nilq/small-lua-stack
null
-- -- created with TexturePacker (http://www.codeandweb.com/texturepacker) -- -- $TexturePacker:SmartUpdate:989382e7c5e7943772963970232b1daa:8183afbab71d8d46a07d0b3bdb02c3a1:cf8ab4992190eb44f97f06311ef326d7$ -- -- local sheetInfo = require("mysheet") -- local myImageSheet = graphics.newImageSheet( "mysheet.png", sheetI...
nilq/small-lua-stack
null
-- Initialize LED and load functions dofile("status_led.lua") -- Blink a lot to show we're in init phase led_start_blink(1000,100) dofile("rgb.lua") print("Connecting to network and MQTT") connected = false -- Called when connected to WiFi function onConnection() connected = true -- Print SSID and IP print...
nilq/small-lua-stack
null
local t = Def.ActorFrame{} -- Environment Setup melody = setmetatable({}, { __index = _G, __call = function(s,a) if a then setfenv(a,s); return a; end setfenv(2,s) end }) _M = melody melody() local song_dir = GAMESTATE:GetCurrentSong():GetSongDir() -- Miscellaneous do function SystemMessage(msg) SCREENMAN:SystemMes...
nilq/small-lua-stack
null
-- states.lua ROOM_COUNT = 4 DAYS = 30 TOTAL_VALIDATORS = 20 rooms = {} -- room_local is representation of the reserved rooms in the mempool -- not including the reserved rooms in the state rooms_local = {} mempool = {} peers = {} peers[0] = { status = "disconnected", name = "Us" } msg_hash = {} for i = 1, ROOM_COUN...
nilq/small-lua-stack
null
bullets = {} Encounter.SetVar("wavetimer", 10) starttime = Time.time currenttime = Time.time - starttime bulletspawn = 0.6 bulletspawner = 0.3 bulletspawner2 = 0.4 bulletspawner3 = 0.5 bulletsway = 26 bulletswayspeed = 3.2 bulletspawnportion = 6 function Update() currenttime = Time.time - startti...
nilq/small-lua-stack
null
TestUniq = { setUp = function (self) self.a = array("a", "b", "c") end; ["test: Should return an empty array when the array is empty"] = function () luaunit.assertEquals(array():uniq().__data, {}) end; ["test: Should return an array equal to the original when the array contains only one element"] = function...
nilq/small-lua-stack
null
-- rRingMod3 layout by roth - 2009 -- ring layout -- ____ ____ -- / | \ -- | 4 | 1 | -- ----+---- -- | 3 | 2 | -- \____|____/ -- -- direction 1 = right (clockwise), 0 = left (counter-clockwise) ----------------------- -----------------------...
nilq/small-lua-stack
null