content stringlengths 0 1.05M | origin stringclasses 2
values | type stringclasses 2
values |
|---|---|---|
-- argument parsing
local cmdPrefix = config.command_prefixes
if not config.command_prefixes or not config.command_prefixes[1] then
local default = "d$"
print('Command prefix not found, using default "' .. default .. '"')
cmdPrefix = { default }
end
bot.commandPrefixes = cmdPrefix
local cmdArgGrouper = "[\"']"
loca... | nilq/small-lua-stack | null |
local cwtest = require "cwtest"
local ltn12 = require "ltn12"
local H = (require "socket.http").request
local mp = (require "multipart-post").gen_request
local enc = (require "multipart-post").encode
local J
do -- Find a JSON parser
local ok, json = pcall(require, "cjson")
if not ok then ok, json = pcall(requi... | nilq/small-lua-stack | null |
--- Date and Date Format classes.
-- See @{05-dates.md|the Guide}.
--
-- NOTE: the date module is deprecated! see
-- https://github.com/lunarmodules/Penlight/issues/285
--
-- Dependencies: `pl.class`, `pl.stringx`, `pl.utils`
-- @classmod pl.Date
-- @pragma nostrip
local class = require "pl.class"
local os_time, os_d... | nilq/small-lua-stack | null |
local defaultOptions = {
layout = DEFAULT_LAYOUT, -- set in init.lua
vsync = true,
showFps = true,
showPing = true,
fullscreen = false,
classicView = not g_app.isMobile(),
cacheMap = false,
classicControl = not g_app.isMobile(),
smartWalk = false,
dash = false,
autoChaseOverride = true,
showStat... | nilq/small-lua-stack | null |
local xml2lua = require "xml2lua"
local handler = require "xmlhandler.tree"
local Util = require("Lua/Util/Util")
--Util:MakeDir("cache_lua")
local INPUT = "Lua/Data/cache/World_of_Warcraft_API.xml"
local m = {}
function m:SaveExport()
local url = "https://wowpedia.fandom.com/wiki/Special:Export"
local requestBody ... | nilq/small-lua-stack | null |
--[[
Copyright (c) 2016 Baidu.com, Inc. All Rights Reserved
@file OstypeJudge.lua
@author sunnnychan@gmail.com
@date 2016/03/12 11:27:24
@brief os type judge
]]--
local BDLOG = require('lua.bdlib.BdLogWrite')
local setmetatable = setmetatable
local tonumber = tonumber
local Method = require('models.service.rule.Judg... | nilq/small-lua-stack | null |
return {
level = 49,
need_exp = 70000,
clothes_attrs = {
0,
0,
0,
0,
0,
1,
1,
1,
1,
1,
},
} | nilq/small-lua-stack | null |
local vehicleDef = {
properties = {
HealthPool = 1400,
EnergyPool = 100,
EnergyRechargeRate = 13,
BoostEnergyCost = 20,
BoostMultiplier = 1.5,
MaxSpeed = 2500,
MaxDivingSpeedMultiplier = 1.2,
MinCrashDamageSpeed = 400,
MaxCrashDamageS... | nilq/small-lua-stack | null |
----------------------
-- a module containing some classes.
-- @module classes
local _M = {}
---- a useful class.
-- @type Bonzo
_M.Bonzo = class()
--- a method.
-- function one
function Bonzo:one()
end
--- a metamethod
-- function __tostring
function Bonzo:__tostring()
end
return M
| nilq/small-lua-stack | null |
modifier_kassadin_riftwalk = class({})
--------------------------------------------------------------------------------
function modifier_kassadin_riftwalk:IsHidden()
return ( self:GetStackCount() == 0 )
end
--------------------------------------------------------------------------------
function modifier_kassadin... | nilq/small-lua-stack | null |
--[[
Utility functions and building blocks for functional programming styles.
]]
local Tables = require(script.Parent.Tables)
local t = require(script.Parent.Parent.t)
local Functions = {}
--[[
A simple function that does nothing, and returns nil.
@usage Shorthand for `function() end`. Useful for when a function i... | nilq/small-lua-stack | null |
local feats = {}
local flutedcolumn = {
name = "Fluted Column",
useWalkedOnImage = true,
description = "A decorative stone column.",
symbol = "|",
passableFor={ghost=true},
color={r=200,g=200,b=200},
blocksMovement = true,
alwaysDisplay = true,
blocksSight = true,
ghostPassable=true
}
function flut... | nilq/small-lua-stack | null |
ENDGAMESONGS = {
"music/HL2_song29.mp3",
"music/HL2_song14.mp3",
"music/HL2_song26.mp3",
"music/HL1_song20.mp3",
"music/HL1_song19.mp3",
"music/HL1_song16.mp3",
"music/HL2_song20_submix0.mp3"
}
MINIGAMESONGS = {
"labyrinth/music/minigame1.mp3"
}
GAMESTARTSONGS = {
"labyrinth/music/gamestart1.mp3",
"labyrint... | nilq/small-lua-stack | null |
-------------------------------------
---------------- Cuffs --------------
-------------------------------------
-- Copyright (c) 2015 Nathan Healy --
-------- All rights reserved --------
-------------------------------------
-- weapon_cuff_shackles.lua SHARED --
-- --
-- Strongest han... | nilq/small-lua-stack | null |
addEvent("onSkinChangeBuy",true)
call ( getResourceFromName ( "scoreboard" ), "scoreboardAddColumn", "level" )
CPlayer = {}
Players = {}
--Constructor
function CPlayer:constructor(id,name,password,serial,kills,tode,coins,level,adminlvl,skin)
self.ID = id
self.Name = name
self.Password = passwor... | nilq/small-lua-stack | null |
Tools = dofile(global:getCurrentDirectory() .. "\\YayaTools\\Module\\Tools.lua")
Craft = Tools.craft
Movement = Tools.movement
Zone = Tools.zone
Packet = Tools.packet
Character = Tools.character
Gather = Tools.gather
API = Tools.api
Monsters = Tools.monsters
function move()
local dic = Tools.dictionnary()
loc... | nilq/small-lua-stack | null |
-------------------------------------------------------------------------------
-- Spine Runtimes Software License v2.5
--
-- Copyright (c) 2013-2016, Esoteric Software
-- All rights reserved.
--
-- You are granted a perpetual, non-exclusive, non-sublicensable, and
-- non-transferable license to use, install, ex... | nilq/small-lua-stack | null |
function start (song)
print("Song: " .. song .. " @ " .. bpm .. " downscroll: " .. downscroll)
changeDadIcon('spirit-glitch')
end
local defaultHudX = 0
local defaultHudY = 0
local defaultWindowX = 0
local defaultWindowY = 0
local lastStep = 0
function update (elapsed)
local currentBeat = (songPos / 1000)... | nilq/small-lua-stack | null |
-- CSS + Less + SASS Language Server
local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities.textDocument.completion.completionItem.snippetSupport = true
require'lspconfig'.cssls.setup {
capabilities = capabilities,
}
| nilq/small-lua-stack | null |
commando_house_loot_deed = {
minimumLevel = 0,
maximumLevel = -1,
customObjectName = "Commando Bunker Blueprint",
directObjectTemplate = "object/tangible/loot/loot_schematic/commando_house_loot_schem.iff",
craftingValues = {
},
customizationStringNames = {},
customizationValues = {}
}
addLootItemTemplate("comma... | nilq/small-lua-stack | null |
local Native = require('lib.stdlib.native')
local converter = require('lib.stdlib.enum.converter')
---@class AbilityIntegerLevelArrayField
local AbilityIntegerLevelArrayField = {
}
return AbilityIntegerLevelArrayField
| nilq/small-lua-stack | null |
package.path = "../?.lua;" .. package.path
require("tests/mock")
local types = require("types")
local Placeholder = require("placeholder")
describe("Placeholder", function()
describe("new_listener", function()
it("modifies an environment to return placeholders for missing and new values", function()
local temp_... | nilq/small-lua-stack | null |
local eq = assert.are.same
local status = require'neogit.status'
local harness = require'tests.git_harness'
local in_prepared_repo = harness.in_prepared_repo
local get_git_status = harness.get_git_status
local get_git_diff = harness.get_git_diff
local function act(normal_cmd)
vim.cmd('normal '..normal_cmd)
status.... | nilq/small-lua-stack | null |
--=========== Copyright © 2019, Planimeter, All rights reserved. ===========--
--
-- Purpose: Frame Tab class
--
--==========================================================================--
class "gui.frametab" ( "gui.radiobutton" )
local frametab = gui.frametab
function frametab:frametab( parent, name, text )
gu... | nilq/small-lua-stack | null |
-- Server Objects
includeFile("custom_content/tangible/event_perk/empire_day_defaced_recruitment_sign.lua")
includeFile("custom_content/tangible/event_perk/empire_day_missing_sign.lua")
includeFile("custom_content/tangible/event_perk/empire_day_player_defaced_recruitment_sign.lua")
includeFile("custom_content/tangible/... | nilq/small-lua-stack | null |
messages = {}
messages[2] = {bayld=7368, ease=7360, fail=7285, full=7283, notes=7367, points=7365, standing=7366, success=6388}
messages[4] = {bayld=7362, ease=7354, fail=7279, full=7277, notes=7361, points=7359, standing=7360, success=6388}
messages[5] = {bayld=7319, ease=7311, fail=7236, full=7234, notes=7318, points... | nilq/small-lua-stack | null |
addEventHandler("onClientResourceStart",resourceRoot,
function ()
SKIN_ID=277
txd = engineLoadTXD ( "277.txd" )
engineImportTXD ( txd, SKIN_ID )
dff = engineLoadDFF ( "277.dff", SKIN_ID )
engineReplaceModel ( dff, SKIN_ID )
end) | nilq/small-lua-stack | null |
-- Server only
if not Server then return end
Script.Load("lua/bots/Bot.lua")
kHallucinationModifyHealFactor = 0
PlayerHallucinationMixin = CreateMixin(PlayerHallucinationMixin)
PlayerHallucinationMixin.type = "PlayerHallucination"
PlayerHallucinationMixin.overrideFunctions =
{
"GetIsAllowedToBuy",
}
function P... | nilq/small-lua-stack | null |
require("../utils")
Log = {}
function Log:new(xLabel,yLabel)
-- Initialise the instance
local result = {}
result.data = {}
result.xLabel = xLabel or "x"
result.yLabel = yLabel or "y"
-- Do Lua class stuff
setmetatable(result,self)
self.__index = self
-- Return the new instance... | nilq/small-lua-stack | null |
local OS_ID = os.get()
local QT_MAC_BASE_PATH = "/Applications/Qt5.7.0/5.7/clang_64"
local QT_MAC_LIB_BASE_PATH = QT_MAC_BASE_PATH.."/lib"
local MAC_EMBEDDED_HELPER_PATH = "bin/%{cfg.buildcfg}/Asset Pipeline.app/Contents/Resources/Asset Pipeline Helper.app"
function EscapeSpacesInPath(path)
-- TODO: Make sure tha... | nilq/small-lua-stack | null |
-- Copyright 2004-present Facebook. All Rights Reserved.
-- Always line-buffer stdout because we want our logs not to be slow, even
-- if they are redirected.
io.stdout:setvbuf('line')
local pl = require('pl.import_into')()
local util = require('fb.util')
require 'totem'
-- Compatibility stuff, LuaJIT in 5.2 compat ... | nilq/small-lua-stack | null |
local _, ns = ...
local B, C, L, DB, P = unpack(ns)
local S = P:GetModule("Skins")
----------------------------
-- Credit: ElvUI
----------------------------
local _G = getfenv(0)
local select, pairs, type = select, pairs, type
local r, g, b = DB.r, DB.g, DB.b
local TT = B:GetModule("Tooltip")
S.EarlyAceWidgets = {}
f... | nilq/small-lua-stack | null |
require 'torch'
require 'optim'
require 'image'
require 'fast_neural_style.DataLoader'
require 'fast_neural_style.PerceptualCriterion'
local utils = require 'fast_neural_style.utils'
local preprocess = require 'fast_neural_style.preprocess'
local models = require 'fast_neural_style.models'
local cmd = torch.CmdLine(... | nilq/small-lua-stack | null |
#!/usr/bin/env tarantool
local test = require("sqltester")
test:plan(203)
--!./tcltestrunner.lua
-- 2015-01-19
--
-- The author disclaims copyright to this source code. In place of
-- a legal notice, here is a blessing:
--
-- May you do good and not evil.
-- May you find forgiveness for yourself and forgive oth... | nilq/small-lua-stack | null |
SLASH_ANALYZE1 = "/analyze"
SlashCmdList["ANALYZE"] = function(arg)
if arg ~= "" then
arg = _G[arg]
else
arg = GetMouseFocus()
end
if arg ~= nil then FRAME = arg end --Set the global variable FRAME to = whatever we are mousing over to simplify messing with frames that have no name.
if arg ~= nil and ... | nilq/small-lua-stack | null |
Keys = {
["ESC"] = 322, ["F1"] = 288, ["F2"] = 289, ["F3"] = 170, ["F5"] = 166, ["F6"] = 167, ["F7"] = 168, ["F8"] = 169, ["F9"] = 56, ["F10"] = 57,
["~"] = 243, ["1"] = 157, ["2"] = 158, ["3"] = 160, ["4"] = 164, ["5"] = 165, ["6"] = 159, ["7"] = 161, ["8"] = 162, ["9"] = 163, ["-"] = 84, ["="] = 83, ["BACKSPAC... | nilq/small-lua-stack | null |
local BonusItem = GetFileConfig("server/setting/reward/reward_item_cfg.lua").RuleData
-- local BonusGold = GetFileConfig("server/setting/reward/reward_gold_cfg.lua").RuleData
-- local BonusExp = GetFileConfig("server/setting/reward/reward_exp_cfg.lua").BonusRule
return function(Data)
local Reward = {}
local DataTbl =... | nilq/small-lua-stack | null |
wmChat.chatCustom.config = wmChat.chatCustom.config or {}
local CONFIG = wmChat.chatCustom.config
local w, h = chat.GetChatBoxSize()
CONFIG.MinWidth = 300 // Can't be larger than the chatbox
CONFIG.MinHeight = 200
CONFIG.MinWidth = math.min(CONFIG.MinWidth, w)
CONFIG.MinHeight = math.min(CONFIG.MinHeight, h)
CONF... | nilq/small-lua-stack | null |
--[[---------------------------------------------------------
Material Design Core
Copyright © 2015 Szymon (Szymekk) Jankowski
All Rights Reserved
Steam: https://steamcommunity.com/id/szymski
-------------------------------------------------------------]]
if SERVER then return end
matcore = { }
matcore.mat = { }... | nilq/small-lua-stack | null |
object_draft_schematic_genetic_engineering_beast_steroid_sub_adv = object_draft_schematic_genetic_engineering_shared_beast_steroid_sub_adv:new {
}
ObjectTemplates:addTemplate(object_draft_schematic_genetic_engineering_beast_steroid_sub_adv, "object/draft_schematic/genetic_engineering/beast_steroid_sub_adv.iff")
| nilq/small-lua-stack | null |
-- 'nvim-telescope/telescope.nvim'
return function(c, s, cs)
return {
{ 'TelescopeBorder', c.gray, cs.bg('telescope') },
{ 'TelescopeNormal', c.dark_white, cs.bg('telescope') },
{ 'TelescopePreviewNormal', c.dark_white, cs.bg('telescope') },
{ 'TelescopePromptPrefix', c.dark_white },... | nilq/small-lua-stack | null |
local maxSegments = 150
local function CreateSegments(Player)
local t = Def.ActorFrame { };
local bars = Def.ActorFrame{ Name="CoverBars" };
local bpmFrame = Def.ActorFrame{ Name="BPMFrame"; };
local stopFrame = Def.ActorFrame{ Name="StopFrame"; };
local delayFrame = Def.ActorFrame{ Name="DelayFrame"; };
local w... | nilq/small-lua-stack | null |
object_draft_schematic_dance_prop_prop_ribbon_magic_l = object_draft_schematic_dance_prop_shared_prop_ribbon_magic_l:new {
}
ObjectTemplates:addTemplate(object_draft_schematic_dance_prop_prop_ribbon_magic_l, "object/draft_schematic/dance_prop/prop_ribbon_magic_l.iff")
| nilq/small-lua-stack | null |
local path = ...
if not path then error( "Expected path", 2 ) end
path = shell.absolute(path)
if not disk.exists(path) then error( "No such path", 2 ) end
local suffixes = {"B", "kB", "MB", "GB"}
local info = disk.info(path)
local size = info.size
local sizeSuffix = 1
while size > 1000 and sizeSuffix < #suffixes do
... | nilq/small-lua-stack | null |
-----------------------------------------
-- ID: 15769
-- Olduum Ring
-- Teleports to Wajoam Woodlands Leypoint
-----------------------------------------
require("scripts/globals/status")
-----------------------------------------
function onItemCheck(target)
return 0
end
function onItemUse(target)
targe... | nilq/small-lua-stack | null |
endor_bordok_herd_master_neutral_none = Lair:new {
mobiles = {{"bordok_herd_master",1},{"bordok_mare",1},{"bordok_foal",1},{"roaming_bordok_stud",1}},
spawnLimit = 15,
buildingsVeryEasy = {},
buildingsEasy = {},
buildingsMedium = {},
buildingsHard = {},
buildingsVeryHard = {},
buildingType = "none",
}
addLairT... | nilq/small-lua-stack | null |
--------------------------------------------------------------------------------
-- Function......... : easeInQuad
-- Author........... :
-- Description...... :
--------------------------------------------------------------------------------
------------------------------------------------------------------------... | nilq/small-lua-stack | null |
--
-- This is fun64 code, you can copy paste it into https://xriss.github.io/fun64/pad/ to run it.
--
hardware,main=system.configurator({
mode="fun64", -- select the standard 320x240 screen using the swanky32 palette.
update=function() update() end, -- called repeatedly to update+draw
})
local wstr=require("wetgenes... | nilq/small-lua-stack | null |
local composer = require( "composer" )
local scene = composer.newScene()
-- -----------------------------------------------------------------------------------
-- Code outside of the scene event functions below will only be executed ONCE unless
-- the scene is removed entirely (not recycled) via "composer.removeScen... | nilq/small-lua-stack | null |
-- This file is subject to copyright - contact swampservers@gmail.com for more information.
DEFINE_BASECLASS("gun")
SWEP.GunType = "smg"
SWEP.PrintName = "UMP-45"
SWEP.Purpose = "High damage, long range SMG"
SWEP.HoldType = "smg"
SWEP.Slot = 0
CSKillIcon(SWEP, "q")
--
SWEP.WorldModel = "models/weapons/w_smg_ump45.mdl"... | nilq/small-lua-stack | null |
PJ_QUESTS = PJ_QUESTS or {}
local mod = PJ_QUESTS
mod.mission_sjoktraken_shipwreck_payload = function(char)
cm:callback(function()
CampaignUI.ToggleCinematicBorders(true)
cm:stop_user_input(true)
cm:scroll_camera_from_current(true, 0.01, {464.257, 490.1476, 6, d_to_r(120), 3})
cm:callback(function()
cm:mov... | nilq/small-lua-stack | null |
--[[
Name: init.lua
For: SantosRP
By: TalosLife
]]--
AddCSLuaFile "cl_init.lua"
AddCSLuaFile "shared.lua"
include "shared.lua"
function ENT:Initialize()
self:SetModel( "models/props/cs_office/radio.mdl" )
self:PhysicsInit( SOLID_VPHYSICS )
self:SetMoveType( MOVETYPE_VPHYSICS )
self:SetSolid( SOLID_VPHYSICS )
... | nilq/small-lua-stack | null |
--[[------------------------------------------------------
h1. bt.Ground
Create a simple solid shape representing the ground.
--]]------------------------------------------------------
function bt.Ground(restitution)
local groundShape = bt.StaticPlaneShape(bt.Vector3(0,1,0),1)
local groundMotionState = bt.Defau... | nilq/small-lua-stack | null |
local _M = {}
local cjson = require 'cjson'
local dyups = require 'ngx.dyups'
function _M.split(str, separator, max, regex)
assert(separator ~= '')
assert(max == nil or max >= 1)
local record = {}
if str:len() > 0 then
local plain = not regex
max = max or -1
local field=1 sta... | nilq/small-lua-stack | null |
-- LTSpice parser utilities
local type = type
local getmetatable = getmetatable
local setmetatable = setmetatable
local tonumber = tonumber
local tostring = tostring
local table = table
local io = io
local math = math
local winapi = require("winapi") -- To convert UTF16 to UTF8 encoding
local vstruct = ... | nilq/small-lua-stack | null |
local module = {}
module.name = 'Mqtt'
module.connected = false
module.onReceive = nil
local moduleConfig = nil
local mq = nil
local user_disconnect = false
local function echo (text)
print('['..module.name..'] '..text)
end
local function handle_message (conn, topic, data)
echo ("Message received! Topic "..... | nilq/small-lua-stack | null |
local require = require
local ej = require 'war3.enhanced_jass'
local Math = require 'std.math'
local Point = require 'std.point'
local Timer = require 'war3.timer'
local Text = require 'std.class'('Text')
local Init, SetTrace, Scaling, Move, MoveSin, ComputeSinTrace, ComputeMin, UpdateText, IsExpired
-- ex: Text:new... | nilq/small-lua-stack | null |
monitoring.wrap_global({"minetest", "find_nodes_in_area"}, "find_nodes_in_area")
monitoring.wrap_global({"minetest", "find_node_near"}, "find_node_near")
monitoring.wrap_global({"minetest", "get_objects_inside_radius"}, "get_objects_inside_radius")
monitoring.wrap_global({"minetest", "check_player_privs"}, "check_play... | nilq/small-lua-stack | null |
local inn = require 'inn.env'
local utils = {}
-- a script to simplify trained net by incorporating every Spatial/VolumetricBatchNormalization
-- to Spatial/VolumetricConvolution and BatchNormalization to Linear
local function BNtoConv(net)
for i,v in ipairs(net.modules) do
if v.modules then
BNtoConv(v)
... | nilq/small-lua-stack | null |
require("std/orklib")
inspect = require("std/inspect")
local s = ork.getscene();
printf("Hello world, from %s yo.",_VERSION)
--printf( "Lua Initializing scene NumEnt<%d>",s:NumEntities() )
-------------------------------------
function OnSceneCompose()
printf("OnSceneCompose()")
end
-------------------------------... | nilq/small-lua-stack | null |
-----------------------------------
-- Ability: Warcry
-----------------------------------
require("scripts/globals/monstertpmoves")
require("scripts/globals/settings")
require("scripts/globals/status")
-----------------------------------
function OnMobSkillCheck(target, mob, skill)
return 0
end
function OnMobWea... | nilq/small-lua-stack | null |
---- Roleplay: Prison
timer.Create("HungerTick", 24.0, 0, function()
local AllPlayers = player.GetAll()
for Index, Player in ipairs(AllPlayers) do
if Player:Team() == TEAM_ROBBER or Player:Team() == TEAM_GUARD then
local HungerMultiplier = 0.5
if Player:Team() == TEAM_GUARD and UtilCheckPlayerInArea(Pla... | nilq/small-lua-stack | null |
--[[ Sequence to sequence model with attention. ]]
local Seq2Seq, parent = torch.class('Seq2Seq', 'Model')
local options = {
-- main network
{'-layers', 2, [[Number of layers in the RNN encoder/decoder]],
{valid=onmt.utils.ExtendedCmdLine.isUInt()}},
{'-rnn_size', 500, [[Size of RN... | nilq/small-lua-stack | null |
require "upgrade_ptr_to_ref"
node_id_cfgs = {}
NodeIdFinder = {}
function NodeIdFinder.new(tctx, node_descriptions)
local self = {}
self.tctx = tctx
self.node_descriptions = node_descriptions
setmetatable(self, NodeIdFinder)
NodeIdFinder.__index = NodeIdFinder
return self
end
function Nod... | nilq/small-lua-stack | null |
----------------------------
--class ZMath 这个类主要用于编写数学算法
-- @author 郑灶生
-- Creation 2014-12-17
local ZMath=class("ZMath",math)
--求两点间的距离
function ZMath.dist(ax, ay, bx, by)
local dx, dy = bx - ax, by - ay
return math.sqrt(dx * dx + dy * dy)
end
--算圆周上的点 传入 角度 半径 及 圆弧的x坐标
function ZMath.getrx(angle,r,x)
r... | nilq/small-lua-stack | null |
-----------------------------------------------------------
-- (c) 2020 Mustafa Erkam Badin --
-----------------------------------------------------------
-- Source: https://github.com/arthurealike/turtle.lua --
-----------------------------------------------------------
package.path = packa... | nilq/small-lua-stack | null |
local cjson = require "cjson"
resp = ngx.location.capture('/__mesos_dns/v1/services/_' .. os.getenv("APP_NAME") .. '._tcp.marathon.mesos')
backends = cjson.decode(resp.body)
backend = backends[1]
ngx.var.target = "http://" .. backend['ip'] .. ":" .. backend['port']
| nilq/small-lua-stack | null |
dofile("/opt/domoticz/scripts/parse_config.lua")
debug = false
commandArray = {}
time = os.date("*t")
minutes = time.min + time.hour * 60
if debug then print('light=' .. otherdevices[conf['lightIntensity']]) end
if (tonumber(otherdevices[conf['lightIntensity']]) < tonumber(conf['switchOnLux'])) then
switchOnLux = t... | nilq/small-lua-stack | null |
local vRPserver = Tunnel.getInterface("vRP", "cars")
local vRPCarsS = Tunnel.getInterface("cars", "cars")
local vRPCarsC = {}
RegisterCommand(
"transferownership",
function(source, args, rawCommand)
local buyerID = tonumber(args[1])
local ped = GetPlayerPed(-1)
local model = ... | nilq/small-lua-stack | null |
local MinimapHelper = {}
function MinimapHelper:WorldToMiniMap(pos, screenWidth, screenHeight)
local screenH = screenHeight
local screenW = screenWidth
local MapLeft = -8000
local MapTop = 7350
local MapRight = 7500
local MapBottom = -7200
local mapWidth = math.abs(MapLeft - MapRight)
local mapHeight = math.a... | nilq/small-lua-stack | null |
-----------------------------------
-- Ability: Chain Affinity
-- Makes it possible for your next "physical" blue magic spell to be used in a skillchain. Effect varies with TP.
-- Obtained: Blue Mage Level 40
-- Recast Time: 2 minutes
-- Duration: 30 seconds or one Blue Magic spell
-- May be used with Sneak Attack and ... | nilq/small-lua-stack | null |
---@type MessageData
local MessageData = Classes.MessageData
Ext.RegisterNetListener("LeaderLib_EnableFeature", function(channel, id)
Features[id] = true
end)
Ext.RegisterNetListener("LeaderLib_DisableFeature", function(channel, id)
Features[id] = false
end)
Ext.RegisterNetListener("LeaderLib_SyncFeatures", functi... | nilq/small-lua-stack | null |
-- i don't think i'll really use this class
local Class = require'libs.hump.class'
local Entity = require'entity'
-- local lg = love.graphics
local Ground = Class{
-- inherit entity
__includes = Entity
}
function Ground:init(--[[world-,-]]x,y,w,h)
Entity.init(self,--[[world,--]]x,y,w,h)
-- self.world... | nilq/small-lua-stack | null |
--[[
This module prints the list of all Pokémon, alternative forms included, having
a given ability.
--]]
local k = {}
local tab = require('Wikilib-tables') -- luacheck: no unused
local txt = require('Wikilib-strings') -- luacheck: no unused
local list = require('Wikilib-lists')
local oop = require('Wiki... | nilq/small-lua-stack | null |
local _, Addon = ...
local Dominos = _G.Dominos
local GoldBar = Dominos:CreateClass("Frame", Addon.ProgressBar)
function GoldBar:Init()
self:Update()
self:SetColor(Addon.Config:GetColor("gold"))
self:SetBonusColor(Addon.Config:GetColor("gold_realm"))
end
function GoldBar:Update()
local gold = GetMoney("player")
... | nilq/small-lua-stack | null |
local layerBase = require("games/common2/module/layerBase");
--[[
动画层
]]
local RoomAnimLayer = class(layerBase);
RoomAnimLayer.s_cmds = {
};
RoomAnimLayer.ctor = function(self)
self:removeStateBroadcast();
end
RoomAnimLayer.dtor = function(self)
end
-- 初始化layer的配置
RoomAnimLayer.initViewConf... | nilq/small-lua-stack | null |
local files = {
"Blocks",
"EastAsianWidth",
"PropList",
"Scripts",
"UnicodeData",
"DerivedCoreProperties",
}
local limit = 200000
local buffer = 190000
local head =
"-- Automatically generated by build.lua, do not edit\n"
for _,name in pairs(files) do
local path = string.format("UCD/%s.txt", name)
print("Bui... | nilq/small-lua-stack | null |
local entity_id = GetUpdatedEntityID()
function spawn_trading_post( x, y )
GamePrint("spawn_trading_post start");
EntityLoad( "data/trading/trading_post.xml", x, y )
GamePrint("spawn_trading_post end");
end
| nilq/small-lua-stack | null |
--==[[ libs ]]==--
local stringutils = {}
stringutils.format = function(s, tab) return (s:gsub('($%b{})', function(w) return tab[w:sub(3, -2)] or w end)) end
stringutils.split = function(s, delimiter)
result = {}
for match in (s .. delimiter):gmatch("(.-)" .. delimiter) do
table.insert(result, match)
end
return... | nilq/small-lua-stack | null |
module("luci.controller.onliner",package.seeall)
nixio=require"nixio"
function index()
entry({"admin","status","onliner"},alias("admin","status","onliner","onliner"),_("Connection info"))
entry({"admin","status","onliner","onliner"},template("onliner/onliner"),_("Online User"),1)
entry({"admin", "status","onliner","spe... | nilq/small-lua-stack | null |
local function onFocusedWindow(callback)
local window = hs.window.focusedWindow()
if window then
callback(window)
else
hs.alert.show('No active window')
end
end
local function fullScreen()
onFocusedWindow(function (window)
local frame = window:frame()
local screen = window:screen()
local... | nilq/small-lua-stack | null |
type Storage = {
}
var M = Contract<Storage>()
function M:init()
end
function M:start(gift_num: string)
local gift = math.floor(1.2)
local a = b.c(123)
end
print ("123")
return M
| nilq/small-lua-stack | null |
---------------------------------------------------------------------
-- Project: irc
-- Author: MCvarial
-- Contact: mcvarial@gmail.com
-- Version: 1.0.0
-- Date: 31.10.2010
---------------------------------------------------------------------
acl = {}
local commands = {}
------------------------------------
-- Acl
... | nilq/small-lua-stack | null |
local _,L = ...
local rematch = Rematch
local dialog = RematchDialog
local settings, saved
rematch:InitModule(function()
settings = RematchSettings
saved = RematchSaved
dialog:UpdateTabPicker()
rematch:RegisterMenu("SaveAsTarget",{
{ text=L["No Target"], npcID=nil, func=rematch.PickNpcID },
{ text=function() r... | nilq/small-lua-stack | null |
local PLUGIN = PLUGIN
PLUGIN.name = "Anomaly Controller"
PLUGIN.author = "gumlefar"
PLUGIN.desc = "Allows for randomly spawning anomaly entities"
PLUGIN.anomalydefs = PLUGIN.anomalydefs or {}
PLUGIN.anomalypoints = PLUGIN.anomalypoints or {} -- ANOMALYPOINTS STRUCTURE table.insert( PLUGIN.eventpoints, { position, radi... | nilq/small-lua-stack | null |
function onCreate()
-- background shit
makeLuaSprite('nightsky', 'miku concert night/nightsky', -360, -110);
scaleObject('nightsky', 1.1, 1.1);
makeLuaSprite('stageback', 'miku concert night/concerttop', -380, -110);
setLuaSpriteScrollFactor('stageback', 0.9, 0.9);
scaleObject('stageback', 1.1, 1.... | nilq/small-lua-stack | null |
print(type("Hello world")) --> string
print(type(10.4*3)) --> number
print(type(print)) --> function
print(type(type)) --> function
print(type(true)) --> boolean
print(type(nil)) --> nil
print(type(type(X))) --> string
| nilq/small-lua-stack | null |
-- collision-pi-visualizer
-- (c) Vilhelm Prytz <vilhelm@prytznet.se> 2019
-- digits of pi
d = 2
collisions = 0
-- left square
left_square = {}
left_square.x = 200
left_square.mass = 1
left_square.velocity = 0
-- right square
right_square = {}
right_square.x = 500
right_square.mass = math.pow(100, d-1)
right_square... | nilq/small-lua-stack | null |
--[[
Copyright (C) 2013-2018 Draios Inc dba Sysdig.
This file is part of sysdig.
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 ... | nilq/small-lua-stack | null |
local K, _, L = unpack(KkthnxUI)
if (not L) then
return
end
local _G = _G
local GetLocale = _G.GetLocale
if GetLocale() ~= "frFR" then
return
end
-- Module Locales
L["%s players"] = "%s joueurs"
L["Account Keystones"] = "Account Keystone"
L["AddContactTip"] = "|nModifier la liste de contacts dont vous avez besoin... | nilq/small-lua-stack | null |
object_tangible_collection_col_gcw_city_reb_4 = object_tangible_collection_shared_col_gcw_city_reb_4:new {
gameObjectType = 8211,}
ObjectTemplates:addTemplate(object_tangible_collection_col_gcw_city_reb_4, "object/tangible/collection/col_gcw_city_reb_4.iff") | nilq/small-lua-stack | null |
--[[
Nginx Shard DiCT Cache operation utils
--]]
local cjson = require("core.utils.json")
local shared_name = require("core.constants.shard_name")
local shared = ngx.shared
local cache_data = shared[shared_name.global_cache]
local _Cache = {}
function _Cache._get(key)
return cache_data:get(key)
end
function... | nilq/small-lua-stack | null |
-- Build configuration for logos
-- Matthew Leingang, 2020-09-23
bundle = "Gotham"
module = "logos"
maindir = ".."
-- Files to install to the tex area of the texmf tree
imagefiles = {"*.eps", "*.svg", "*_*_*.pdf", "*.png", "*.jpg"}
sourcefiles = imagefiles
installfiles = imagefiles
-- Files to typeset for documenta... | nilq/small-lua-stack | null |
--[[
***
This file adapted from https://github.com/nvim-lua/plenary.nvim
MIT License
Copyright (c) 2020 TJ DeVries
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 ... | nilq/small-lua-stack | null |
local NumEntries = 13
local RowHeight = 24
local RpgYellow = color("0.902,0.765,0.529,1")
local ItlPink = color("1,0.2,0.406,1")
local paneWidth1Player = 330
local paneWidth2Player = 230
local paneWidth = (GAMESTATE:GetNumSidesJoined() == 1) and paneWidth1Player or paneWidth2Player
local paneHeight = 360
local borderW... | nilq/small-lua-stack | null |
return PlaceObj("ModDef", {
"title", "Example Delay Mystery",
"version", 1,
"version_major", 0,
"version_minor", 1,
"saved", 0,
"image", "Preview.png",
"id", "ChoGGi_ExampleDelayMystery",
"author", "ChoGGi",
"lua_revision", 249143,
"code", {
"Code/Script.lua",
},
"description", [[Looks for a gamerule id c... | nilq/small-lua-stack | null |
local M = {}
local titan_packer_util = require("titan.packer.util")
local plugin_specs = nil
local plugin_specs_by_name = nil
local skip_plugins = nil
local skip_all_plugins = false
local function use(plugin_spec)
local spec = {
spec = plugin_spec,
line = debug.getinfo(2, 'l').currentline,
}
spec.name ... | nilq/small-lua-stack | null |
return {
strike1 = {
animationId = "rbxassetid://2065686536";
looped = false;
priority = Enum.AnimationPriority.Action;
};
strike2 = {
animationId = "rbxassetid://2035777674";
looped = false;
priority = Enum.AnimationPriority.Action;
};
strike3 = {
animationId = "rbxassetid://4272381396";
... | nilq/small-lua-stack | null |
----------------------------------------------------------------------------------------------
-- NETWORKING NETWORKING NETWORKING NETWORKING NETWORKING NETWORKING NETWORKING NETWOR
----------------------------------------------------------------------------------------------
net.Receive( "BP::OpenGui", function... | nilq/small-lua-stack | null |
do
local _ = {
['item-with-tags'] = {
icon = '__base__/graphics/icons/wooden-chest.png',
name = 'item-with-tags',
icon_mipmaps = 4,
type = 'item-with-tags',
order = 's[item-with-tags]-o[item-with-tags]',
flags = {'hidden'},
... | nilq/small-lua-stack | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.