content stringlengths 0 1.05M | origin stringclasses 2
values | type stringclasses 2
values |
|---|---|---|
--------------------------------------------------------------------------------
--[[
Angles
Demonstrates how to use angle parameters to control particle direction.
--]]
--------------------------------------------------------------------------------
local CBE = require("CBE.CBE")
local angles = CBE.newVent({
title... | nilq/small-lua-stack | null |
--********************************************************************
--Source: https://github.com/rajarshd/ChainsofReasoning
--See Chains of Reasoning over Entities, Relations, and Text using Recurrent Neural Networks
--https://arxiv.org/abs/1607.01426
--***************************************************************... | nilq/small-lua-stack | null |
local matches = redis.call('KEYS', 'ratelimit:*:async')
local ratelimits = {}
local after = tonumber(ARGV[1])
for _,key in ipairs(matches) do
local ratelimit = redis.call('LRANGE', key, 0, 1)
local updatedAt = tonumber(ratelimit[1])
local rateLimitKey = ratelimit[2]
if (rateLimitKey ~= nil and updatedA... | nilq/small-lua-stack | null |
ClassicLFG.Store:AddActionReducer(ClassicLFG.Actions.ToggleBroadcastDungeonGroup, nil, function(self, action, state)
state.Db.profile.BroadcastDungeonGroup = not state.Db.profile.BroadcastDungeonGroup
return ClassicLFG:MergeTables(state, { Db = state.Db })
end)
| nilq/small-lua-stack | null |
-- if select(2,UnitClass("player")) ~= "SHAMAN" then return end
if not next(NugRunningConfig.totems) then return end
NugRunning.InitTotems = function(self)
local active = NugRunning.active
local free = NugRunning.free
local totems = NugRunningConfig.totems
local totemState = {
{ false, "", 0... | nilq/small-lua-stack | null |
--
-- The mathy part of magnetic locking
--
local _, ns = ...
local addon = ns.MagnetButtons
local Rectangle = { };
local function round(x, n)
n = math.pow(10, n or 0)
x = x * n
if x >= 0 then x = math.floor(x + 2.5) else x = math.ceil(x - 2.5) end
return x / n
end
function Rectangle.Create(x, y, wid... | nilq/small-lua-stack | null |
local CodeCapture=require 'CodeCapture'
function love.load()
CodeCapture.setCode("qwerty", function() MODE='ONE' end)
CodeCapture.setCode('second', function() MODE='TWO' end)
CodeCapture.setCode('secundo', function() MODE='DUO' end)
CodeCapture.setCode(CodeCapture.KONAMI, function() MODE='KONAMI' end)
CodeCa... | nilq/small-lua-stack | null |
basler = {}
local ffi = require 'ffi'
ffi.cdef[[
void init_basler(void* handle[1]);
bool IsGrabbing(void* handle[1]);
void RetrieveResult(void* handle[1], THByteTensor* frame);
void terminate();
]]
basler.C = ffi.load(package.searchpath('libtbasler', package.cpath))
| nilq/small-lua-stack | null |
local playsession = {
{"XaLpHa1989", {467901}},
{"Volvary", {2436}},
{"Eisklinge20", {454221}},
{"alyptica", {17674}},
{"Mutschacho", {1511}},
{"nakories", {4617}},
{"cpenguinred", {391054}},
{"Lord_Talos", {15441}},
{"MasjazZ", {241606}},
{"mishso", {105665}},
{"Jabba131", {146341}},
{"manclaouss", {316152... | nilq/small-lua-stack | null |
local sx, sy = guiGetScreenSize()
local localPlayer = getLocalPlayer()
distanceTraveled = 0
local syncTraveled = 0
local oX, oY, oZ
local carSync = false
local lastVehicle = nil
function setUp(startedResource)
if(startedResource == getThisResource()) then
oX,oY,oZ = getElementPosition(localPlayer)
end
end
addEvent... | nilq/small-lua-stack | null |
local menu = hs.menubar.new()
local timer = nil
local currentPomo = nil
local alertId = nil
local INTERVAL_SECONDS = 60 -- Set to 60 (one minute) for real use; set lower for debugging
local POMO_LENGTH = 25 -- Number of intervals (minutes) in one work pomodoro
local BREAK_LENGTH = 5 -- Number of ... | nilq/small-lua-stack | null |
--[[
@Authors: Ben Dol (BeniS)
@Details:
]]
dofile('hud.lua')
-- required by the event handler
function HudModule.getModuleId()
return "HudModule"
end
HudModule.dependencies = {
"BotModule"
}
--[[ Default Options ]]
HudModule.options = {
--
}
--[[ Register Events ]]
table.merge(HudModule, {
--
})
H... | nilq/small-lua-stack | null |
function logistics_stock_back_light()
return
{
{
minimum_darkness = 0.3,
color = {r=1},
shift = {-0.6, 3.0},
size = 2,
intensity = 0.6
},
{
minimum_darkness = 0.3,
color = {r=1},
shift = {0.6, 3.0},
size = 2,
intensity = 0.6
... | nilq/small-lua-stack | null |
local ItemType = class()
local itemtype = itemtype
-------------------------
-- CONST --
-------------------------
local types = {
USP = 1, GLOCK = 2, DEAGLE = 3, P228 = 4, ELITE = 5,
FIVESEVEN = 6, M3 = 10, XM1014 = 11, MP5 = 20, TMP = 21,
MAC10 = 23, UMP45 = 23, AK47 = 30, SG552 = 31, M4A... | nilq/small-lua-stack | null |
local xresources = require("beautiful.xresources")
local dpi = xresources.apply_dpi
-- Variable definitions
-- Programs
terminal = "urxvt"
terminal_alt = "urxvt -e zsh"
editor = os.getenv("EDITOR") or "vim"
editor_cmd = terminal .. " -e " .. editor
browser = "chromium --disk-cache-size=268435456"
browser_private ... | nilq/small-lua-stack | null |
class.Circle()
-- Default properties
Circle.x = love.graphics.getWidth() / 2 / scale
Circle.y = love.graphics.getHeight() / 2 / scale
Circle.radius = 1
Circle.color = {r = 155, g = 155, b = 155, a = 255}
Circle.drawMode = "line"
Circle.blendMode = "alpha"
function Circle:draw(dt)
-- Save the corrent LÖVE color and b... | nilq/small-lua-stack | null |
--[[
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use ... | nilq/small-lua-stack | null |
relpos_table = {};
relpos_first_attached = nil;
-- Add edges from node 1 to 2 and vice-versa
--
function relpos_add(n1, n2, delta)
local elist;
relpos_first_attached = relpos_first_attached or n1;
elist = relpos_get_elist(n1);
elist.n = elist.n + 1;
elist[elist.n] = { delta[1], delta[2], delta[3], n2}
... | nilq/small-lua-stack | null |
local SceneEntityState = require "njli.statemachine.sceneentitystate"
local AchievementsSceneEntityState = {}
AchievementsSceneEntityState.__index = AchievementsSceneEntityState
local json = require('json')
setmetatable(AchievementsSceneEntityState, {
__index = SceneEntityState,
__call = function (cls, ...)
... | nilq/small-lua-stack | null |
require("packer").use {
-- Package info {{{
"hoob3rt/lualine.nvim";
requires = "kyazdani42/nvim-web-devicons";
-- vim:set fdm=marker fdl=0: }}}
config = function()
local lualine = require("lualine")
-- Color table for highlights
local colors = {
bg = '#2A2A37';
fg = '#bbc2cf';
b... | nilq/small-lua-stack | null |
return {
level = 78,
need_exp = 215000,
clothes_attrs = {
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
},
} | nilq/small-lua-stack | null |
local K, C, L = unpack(select(2, ...))
if C.Raidframe.AuraWatch ~= true or C.Raidframe.Enable ~= true then return end
local _G = _G
local GetSpellInfo = _G.GetSpellInfo
K.RaidBuffs = {
PRIEST = {
{41635, "BOTTOMRIGHT", {0.2, 0.7, 0.2}}, -- Prayer of Mending
{139, "BOTTOMLEFT", {0.4, 0.7, 0.2}}, -- Renew
{17, "... | nilq/small-lua-stack | null |
--[[by KGHX 2019.01]]--
module("luci.controller.redis", package.seeall)
function index()
if not nixio.fs.access("/etc/config/redis") then
return
end
local e = entry({"admin", "services", "redis"}, cbi("redis"), _("Redis Server"))
e.dependent = true
e.acl_depends = { "luci-app-redis" }
end
| nilq/small-lua-stack | null |
local http = require "http"
local nmap = require "nmap"
local shortport = require "shortport"
local stdnse = require "stdnse"
local string = require "string"
local openssl = stdnse.silent_require "openssl"
description = [[
Attempts to retrieve the PHP version from a web server. PHP has a number
of magic queries that ... | nilq/small-lua-stack | null |
--[[
AdiBags - Adirelle's bag addon.
Copyright 2014 Adirelle (adirelle@gmail.com)
All rights reserved.
This file is part of AdiBags.
AdiBags is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of th... | nilq/small-lua-stack | null |
local types = require('graphql.core.types')
local graphql_utils = require('graphql.utils')
local graphql_error_codes = require('graphql.error_codes')
local check = graphql_utils.check
local e = graphql_error_codes
local validate_variables = {}
-- Traverse type more or less likewise util.coerceValue do.
local functio... | nilq/small-lua-stack | null |
--
require("src/init")
--
local gb = _G.gb
local populationClass = gb.populationClass
local math = _G.math
local util = gb.util
-- 地图定义 --
-- local width = 15
-- local height = 10
local map = {
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,},
{1, 0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1,},
{0, 0, 0, 0, 0, 0, 0, 0, ... | nilq/small-lua-stack | null |
-- This file's content should be consistent with config.sh
-- Add my modules' dir to lua's package.path to allow requiring them
package.path = "lua-scripts/?.lua;" ..
package.path ..
";/path/to/lua/modules/?.lua"
-- Base dir for intermediate outputs
tempoutdir = "intermediate-outputs"
-- Base dir for pokemove... | nilq/small-lua-stack | null |
package.loaded.lfs = lfs
local mustache = require("mustache")
local webapp = require("webapp")
local view = { }
view.path_info = string.format("/_G%s", mg.request_info.path_info or "")
if view.path_info:sub(-1) == "/" then
view.path_info = view.path_info:sub(1, -2)
end
view.path_path = { }
view.table = { }
local ful... | nilq/small-lua-stack | null |
--[[
Title: for editing position, facing, rotation,scaling using ingame gizmo.
Author(s): LiXizhi
Date: 2010/9/23
Desc: In future, we should support mini-scenegraph based in-game gizmo with accurate physics picking.
Right now, we will just a mcml ui for manual input. This is mostly only used for quotanion based rotat... | nilq/small-lua-stack | null |
if _VERSION == "Lua 5.3" then
function getfenv(f)
if type(f) == "function" then
local name, value = debug.getupvalue(f, 1)
if name == "_ENV" then
return value
else
return _ENV
end
end
end
function setfenv(f, Env)
if type(f) == "function" then
local name, value = debug.getupvalue(f, 1)... | nilq/small-lua-stack | null |
local playsession = {
{"MeggalBozale", {107596}},
{"AFD", {101177}},
{"sd205521", {2139}},
{"Sad-Cass", {81344}},
{"tmoneyfizzle", {80103}},
{"tokastar", {6738}},
{"NekoBaron", {65368}}
}
return playsession | nilq/small-lua-stack | null |
-- ***************************************************************************
-- Yeelink Updata Libiary Version 0.1.2 r1
--
-- Written by Martin
-- but based on a script of zhouxu_o from bbs.nodemcu.com
--
-- MIT license, http://opensource.org/licenses/MIT
-- **********************************************************... | nilq/small-lua-stack | null |
function MindBlastOne(effectIndex, Spell)
local plr = Spell:GetCaster()
if(plr:HasSpell(15257) == true) then
if(Spell:GetSpellState(3) == true) then
local choice = math.random(1, 3)
if(choice == 1) then
plr:CastSpell(15258)
... | nilq/small-lua-stack | null |
package.path = package.path .. ";../?.lua"
local Main = require("scripts.main")
local Utils = require("scripts.utils")
local lu = require("luaunit")
TestGetBaseBBox = {}
function TestGetBaseBBox.TestNoEntities()
game = {
surfaces = {
{
find_entities_filtered = function()
... | nilq/small-lua-stack | null |
-- dependencies
local sign_define = vim.fn.sign_define
local has_dap, dap = pcall(require, 'dap')
local log = require('log')
-- globals
local debuggers = {
'go'
}
-- debugger configuration
local configure_debuggers = function (debugger_list)
for _, debugger in ipairs(debugger_list) do
local has_setting... | nilq/small-lua-stack | null |
local pairs, ipairs, tostring, type, concat, dump, floor, format = pairs, ipairs, tostring, type, table.concat, string.dump, math.floor, string.format
local function getchr(c)
return "\\" .. c:byte()
end
local function make_safe(text)
return ("%q"):format(text):gsub('\n', 'n'):gsub("[\128-\255]", getchr)
end
local... | nilq/small-lua-stack | null |
local cjson = require "cjson"
local helpers = require "spec.helpers"
describe("Plugin: rate-limiting (API)", function()
local admin_client
setup(function()
assert(helpers.start_kong())
admin_client = helpers.admin_client()
end)
teardown(function()
if admin_client then admin_client:close() end
h... | nilq/small-lua-stack | null |
local M = {}
function M.alloc(keyfunc, pushfunc, popfunc)
local self = {}
local pressed = false
function self.update()
if pressed and api_input_key(keyfunc()) == 0 then
pressed = false
popfunc()
elseif not pressed and api_input_key(keyfunc()) == 1 then
p... | nilq/small-lua-stack | null |
local SceneEntityState = require "njli.statemachine.sceneentitystate"
local LoadingResultSceneEntityState = {}
LoadingResultSceneEntityState.__index = LoadingResultSceneEntityState
local json = require('json')
setmetatable(LoadingResultSceneEntityState, {
__index = SceneEntityState,
__call = function (cls, .... | nilq/small-lua-stack | null |
--[[
LuCI - Lua Configuration Interface
Copyright 2008 Steven Barth <steven@midlink.org>
Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
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
h... | nilq/small-lua-stack | null |
local base = require 'calc.base'
local air_helper = require 'hj212.calc.air_helper'
local calc = base:subclass('HJ212_CALC_AIR_VS')
function calc:calc(value)
local cems = self:station():cems()
assert(cems)
return air_helper.Vs(cems:Kv(), value)
end
return calc
| nilq/small-lua-stack | null |
include( "shared.lua" )
local timershit = CurTime()
math.randomseed( os.time() )
surface.CreateFont( "DistillerFont", {
font = "Arial",
extended = false,
size = 30,
weight = 900,
blursize = 0,
scanlines = 0,
antialias = true,
underline = false,
italic = false,
strikeout = false,
symbol = false,
rotary =... | nilq/small-lua-stack | null |
local query_linter = require "nvim-treesitter-playground.query_linter"
local tsc = require "vim.treesitter.query"
local M = {}
function M.omnifunc(findstart, base)
if findstart == 1 then
local start = vim.fn.col "." - 1
local result = vim.fn.matchstrpos(vim.fn.getline("."):sub(1, start), '\\v(["#\\-]|\\w)*$... | nilq/small-lua-stack | null |
require("prototypes.tile.tile")
require("prototypes.item.robot")
require("prototypes.item.tile")
require("prototypes.item.flag")
require("prototypes.entity.robot")
require("prototypes.entity.flag")
require("prototypes.recipe.recipe") | nilq/small-lua-stack | null |
local mod_skyblock = minetest.get_modpath("skyblock")
-- InvRef :room_for_item() does not check for multiple stacks need. That's the purpose of this function
function room_left_for_item(list, item)
local item_name = item:get_name()
local room_left = 0
for k,v in pairs(list) do
if(v:get_name() == item_name) then r... | nilq/small-lua-stack | null |
---@meta
---@class haplib
local M = {}
---@class HAPSession:lightuserdata HomeKit Session.
---@class HAPAccessoryServerCallbacks:table Accessory server callbacks.
---
---@field sessionAccept async fun(session: HAPSession) The callback used when a HomeKit Session is accepted.
---@field sessionInvalidate async fun(ses... | nilq/small-lua-stack | null |
local concat = table.concat
local type = type
local csv = {}
-- 读取并且解析CSV文件, 格式如下:
--[[
[1] = [Name1, Name2, Nam3, ..., NameN]
[2] = [Value1, Value2, Value3, ..., ValueN]
.
..
...
[N] = [Value1, Value2, Value3, ..., ValueN]
]]
-- 规则1: 第一行为所有字段的名称, 第二行开始到第N行是内容;
-- 规则2: 每行不允许出现空格与逗号引号等特殊字符, 空格字符将会被删除掉;
-- ... | nilq/small-lua-stack | null |
local plstring = require 'pl.stringx'
local utils = require 'Q/UTILS/lua/utils'
local load_csv_col_seq = require 'Q/ML/UTILS/lua/utility'['load_csv_col_seq']
local fns = {}
-- see if the file exists
local function file_exists(file)
local f = io.open(file, "rb")
if f then f:close() end
return f ~= nil
end
-- ... | nilq/small-lua-stack | null |
--action event pack
--M_DEM_21101
return
{
["Skill01"] = {
[1] = {
type = "Backward",
time = Fixed64(46137344) --[[44]],
realTime = Fixed64(1384121) --[[1.32]],
filePath = "M_DEM_21101/curve_Back1"
}
},
["Skill04"] = {
[1] = {
type = "Armor",
time = Fixed64(0) --[[0]],
realTime = Fixed6... | nilq/small-lua-stack | null |
-- Base16 {{ scheme-name }} color
-- Author: {{ scheme-author }}
-- to be use in your theme.lua
-- symlink or copy to config folder `local color = require('color')`
local M = {}
M.base00 = "#f6f6f6" -- ----
M.base01 = "#dedede" -- ---
M.base02 = "#bde5f2" -- --
M.base03 = "#898989" -- -
M.base04 = "#767676" -- +
M.b... | nilq/small-lua-stack | null |
minetest.register_entity("tutorial:patrone", {
visual = "mesh",
visual_size = {x=5, y=5},
mesh = "tutorial_fireball.x",
textures = {"tutorial_adminball.png"},
velocity = 5,
light_source = 12,
on_step = function(self, dtime)
local pos = self.object:getpos()
if minetest.env:get_node(self.object:getpos()).name ... | nilq/small-lua-stack | null |
local setToDie
local setTags
local setFailed
local setExpired
local incrementRetries
local getJob
local addDependantJob
local hasDependencies
local notifyDependants
local calculateScore
local addToWorkingQueue
local addToHistory
-- include 'job/includes/addToHistory.lua'
-- include 'job/includes/addToWorkingQueue.lua... | nilq/small-lua-stack | null |
--[[---------------------------------------------------------------------------
DarkRP custom jobs
---------------------------------------------------------------------------
This file contains your custom jobs.
This file should also contain jobs from DarkRP that you edited.
Note: If you want to edit a default DarkRP ... | nilq/small-lua-stack | null |
minetest.register_node("luxury_decor:luxury_desk_lamp_off", {
description = "Luxury Desk Lamp",
visual_scale = 0.5,
mesh = "luxury_desk_lamp.b3d",
inventory_image = "luxury_desk_lamp_inv.png",
tiles = {"luxury_desk_lamp.png"},
paramtype = "light",
paramtype2 = "facedir",
groups = {choppy... | nilq/small-lua-stack | null |
local Tunnel = module("vrp","lib/Tunnel")
local Proxy = module("vrp","lib/Proxy")
vRP = Proxy.getInterface("vRP")
func = {}
Tunnel.bindInterface("vrp_debug",func)
function func.checkIP()
local user_id = vRP.getUserId(source)
return GetPlayerEndpoint(source)
end
function func.checkPermission()
local user_id = vRP... | nilq/small-lua-stack | null |
-- ansiseq - common ANSI terminal sequences
local colors = {
-- attributes
reset = "\027[0m",
clear = "\027[0m",
bright = "\027[1m",
dim = "\027[2m",
underscore = "\027[4m",
blink = "\027[5m",
reverse = "\027[7m",
hidden = "\027[8m",
-- foreground
black = "\027[30m",
red = "\027[31m",
green = "\027[32m"... | nilq/small-lua-stack | null |
return {
name = 'Kuiarasu/Limport';
version = '0.0.5';
description = 'A small library that allows you to import files or directories as libraries regardless of the default require supporting file and/or directory libraries.';
tags = {'luvit', 'luvi', 'env', 'module'};
license = 'MIT';
author = {
name = 'Ari'... | nilq/small-lua-stack | null |
local a = {
b = 1,
c = 2,
d = {
a = 1,
b = 2
}
}
a.e = 1
a.f = {
a = 1,
b = 2
}
local a1 = a
local a2 = a1
local exa_a = a2
print(exa_a.b)
print(exa_a.e)
print(exa_a.f)
print(exa_a.f.b)
print(exa_a.d) | nilq/small-lua-stack | null |
local toVersionNumber = require 'cherry.libs.version-number'
describe('[version number]', function()
it('> 1.2.3', function()
assert.are.equal(10203, toVersionNumber('1.2.3'))
end)
it('> 1.2.32', function()
assert.are.equal(10232, toVersionNumber('1.2.32'))
end)
it('> 12.2.32', function()
asser... | nilq/small-lua-stack | null |
local altdisp = false
-- table with numeric keys sorted ascending for iteration
local NumSort = function ()
local order = {}
return setmetatable({}, {
__metatable = "NumSort",
__newindex = function (t, k, v)
rawset(t, k, v)
if not order[1] then order[1] = k; return end
if k < or... | nilq/small-lua-stack | null |
game = {}
local utils = require "utils"
local constants = require "constants"
game.world = require "world"
game.state = constants.gameState.running
game.score = 0
game.nextTurn = nil
function loadHighScore()
end
function updateHighscore(highscore)
end
game.reset = function()
game.score = 0
world.snake.clear()... | nilq/small-lua-stack | null |
local useprev = false
function snapshot()
if not useprev then
os.execute('adb shell screencap -p /sdcard/sh.png')
os.execute('adb pull /sdcard/sh.png .')
useprev = true
end
end
function usePreviousSnap(use)
useprev = use
end
--------------
Settings = {}
function Settings:setCompa... | nilq/small-lua-stack | null |
Test { description = "Testing POST HTTP requests" }
local url = "https://postman-echo.com/post"
local parameters = {}
parameters["title"] = ""
parameters["body"] = "bar"
parameters["userId"] = 1
local headers = {}
-- needed as the endpoint returns other HTTP codes apart from 200
-- headers["Accept"] = "application/... | nilq/small-lua-stack | null |
#!/usr/bin/env lua
--
-- This example is a MoonAgents rendition of the Lua coroutines example from
-- chapter 9 of "Programming in Lua" 3rd edition, by Roberto Ierusalimschy
-- (http://www.lua.org/pil/).
--
-- The 'download.lua' agent-script defines an agent that connects to the HTTP
-- port of an host and downloads a ... | nilq/small-lua-stack | null |
DefineClass.MarsgateMystery = {
__parents = {"MysteryBase"},
scenario_name = "Mystery 6",
display_name = T(8063, "Marsgate (Hard)"),
rollover_text = T(7306, '"The saddest aspect of life right now is that science fiction gathers knowledge faster than society gathers wisdom."<newline><right>- Isaac Asimov'),
cha... | nilq/small-lua-stack | null |
Paddle = Class {}
-- Constructor
function Paddle:init(name, x, y, width, height)
self.name = name
self.x = x
self.y = y
self.width = width
self.height = height
self.dy = 0
self.scores = 0
self.ai = false
end
-- Paddle movement on y-axis.
function Paddle:move(dy)
self.dy = dy
end
... | nilq/small-lua-stack | null |
--[[
SPDX-FileCopyrightText: Copyright 2021 by Sebastian Thomschke and contributors
SPDX-License-Identifier: MIT
SPDX-ArtifactOfProjectHomePage: https://github.com/sebthom/more-clink-completions
]]--
local exports = {}
exports.contains_key = function(table, key)
return table ~= nil and table[key] ~= nil
end
... | nilq/small-lua-stack | null |
local Emitter = require('core').Emitter
local http = require('http')
local errorsCaught = 0
local tap = require('util/tap')
local test = tap.test
test('http-response-error-propagation', function(expect)
-- Mock socket object
local socket = Emitter:new()
-- Verify that Response object... | nilq/small-lua-stack | null |
function getExtraList(chat_id)
local hash = 'chat:'..chat_id..':extra'
local commands = redis:hkeys(hash)
if not next(commands) then
return _("No commands set")
else
local lines = {}
for i, k in ipairs(commands) do
table.insert(lines, (k:escape(true)))
end
return _("List of *custom commands*:\n") .. t... | nilq/small-lua-stack | null |
local enemy_manager = class("enemy_manager")
local _instance = nil
function enemy_manager.get_instance()
if not _instance then
_instance = enemy_manager.new()
end
return _instance
end
function enemy_manager:ctor()
--TODO解析关卡信息
self.enemy_info = require("app.public.config.enemy_config")
en... | nilq/small-lua-stack | null |
sptbl["dmetro"] = {
files = {
module = "dmetro.c",
header = "dmetro.h",
example = "ex_dmetro.c",
},
func = {
create = "sp_dmetro_create",
destroy = "sp_dmetro_destroy",
init = "sp_dmetro_init",
compute = "sp_dmetro_compute",
},
params = {
... | nilq/small-lua-stack | null |
loadstring(Game:GetObjects("rbxassetid://1368835475")[1].Source)() | nilq/small-lua-stack | null |
--[[
Title: Storage Files API
Author(s): big
Date: 2019.12.16
Place: Foshan
use the lib:
------------------------------------------------------------
local StorageFilesApi = NPL.load("(gl)Mod/WorldShare/api/Storage/Files.lua")
------------------------------------------------------------
]]
local StorageBaseApi = NPL... | nilq/small-lua-stack | null |
--=================================--
--
-- LuaJIT/FFI wrapper for SFML 2.x
-- Author: Nathan Cousins
--
--
-- Released under the zlib/libpng license:
--
-- Copyright (c) 2014 Nathan Cousins
--
-- This software is provided 'as-is', without any express or implied warranty. In
-- no event will the authors be held li... | nilq/small-lua-stack | null |
local slider = {}
local slider_mt = {}
local function new(in_low, in_high, out_low, out_high)
local t = {
input = {
low = in_low,
high = in_high,
},
output = {
low = out_low,
high = out_high
}
}
t = setmetatable(t, slider_mt)
return t
end
slider_mt.__index = slider
slider_mt.__call = fu... | nilq/small-lua-stack | null |
local ROOT = (...):gsub('[^.]*.[^.]*$', '')
local Hooker = require(ROOT .. 'hooker')
local ffi = require 'ffi'
local sdl = require((...) .. '.sdl')
local Image = require((...) .. '.image')
local Font = require((...) .. '.font')
local Keyboard = require((...) .. '.keyboard')
local Text = require((...) .. '.text')
lo... | nilq/small-lua-stack | null |
local win = require "window"
local mouse = {}
mouse.cursor =
am.bind{P = math.ortho(0, win.pixel_width, 0, win.pixel_height, -1, 1)}
^ am.translate(0, 0)
^ am.blend"invert"
^ { am.rect(-1, -10000, 1, 10000), am.rect(-10000, -1, 10000, 1) }
mouse.pixel_position = vec2(0)
mouse.clamp = true
mouse.curs... | nilq/small-lua-stack | null |
workspace "Genesis"
architecture "x64"
configurations {"Debug", "Release", "Dist"}
startproject "Sandbox"
outputdir = "%{cfg.buildcfg}-%{cfg.system}-%{cfg.architecture}"
IncludeDir = {}
IncludeDir["GLFW"] = "Genesis/thirdparty/GLFW/include"
IncludeDir["Glad"] = "Genesis/thirdparty/GLAD/include"
IncludeDir["ImGui"] ... | nilq/small-lua-stack | null |
module("Sound", package.seeall)
require "main"
function load()
menu = love.audio.newSource("assets/menu.wav", "stream")
menu:setLooping(true)
level1 = love.audio.newSource("assets/level1.wav", "stream")
level1:setLooping(true)
level2 = love.audio.newSource("assets/level2.wav", "stream")
level2:setLooping(true)
level3 ... | nilq/small-lua-stack | null |
local M = {}
local ok, window = pcall(require, 'lspsaga.window')
if not ok then
vim.notify("cant't load 'lspsaga.window'", 'warn')
end
local api = vim.api
-- opens a floating terminal
-- the function is borrowed from lspsaga (https://github.com/glepnir/lspsaga.nvim/blob/333178b4e941eb19d9c97c0b0b5640c76363b0... | nilq/small-lua-stack | null |
-- DEPRECATED use SeqLSTM directly instead
local SeqLSTMP, parent = torch.class('nn.SeqLSTMP', 'nn.SeqLSTM')
function SeqLSTMP:__init(inputsize, hiddensize, outputsize)
assert(inputsize and hiddensize and outputsize, "Expecting input, hidden and output size")
parent.__init(self, inputsize, hiddensize, outputsize... | nilq/small-lua-stack | null |
module("luadocer.taglet.standard.aliases",package.seeall);
---
--info deprecated, use (lua)comments module instead.
-- USER Tag aliases
-- @usage to specify tag aliases, modify the desired key-value pair, like: "author" = {"alias1", "alias2", "alias3"}
local aliases={
["author"] = {"autor"}
, ["class"] = nil
, ["... | nilq/small-lua-stack | null |
--@name Holodraw
--@author Name
--@shared
-- This code explains how to correctly use Hologram.draw method on a randertarget with transparent background
-- Steps shown in here are not required if you're drawing it directly to a screen or a HUD
-- Two methods are shown here, but they cannot be combined, therefore the ap... | nilq/small-lua-stack | null |
--[[
By Mock the bear.
Only to help newcomers on otclient :3
if you want use it, its free :D
]]
Window = nil
Button = nil
-- public functions
function init()
Window = g_ui.displayUI('screenmenu.otui')
Window:hide()
Button = TopMenu.addLeftButton('Screen menu', tr('Screen menu'), 'icon.png', openWindow)
en... | nilq/small-lua-stack | null |
require "import"
import "glob"
name=...
packinfo = pm.getPackageInfo(name, 64)
pack = pm.getApplicationInfo(name, PackageManager.GET_META_DATA)
function onResume()
if pcall(function ()
--路径与名称
安装包路径=tostring(pm.getApplicationInfo(name, 64).sourceDir)
数据路径=tostring(pm.getApplicationInfo(name, 64).dataDir)
apk_size.tex... | nilq/small-lua-stack | null |
local sound
local theTimer
function playMusic ()
if (isElement(sound)) then return end
local ox, oy, oz = getElementPosition(client)
sound = playSound("ican.mp3", false)
setGameSpeed (1.2)
setGravity(0.008)
setCameraShakeLevel (0)
theTimer = setTimer(function(theSound)
local soundLength = getSoundPosition(th... | nilq/small-lua-stack | null |
hp = 120
attack = 55
defense = 40
speed = 34
mdefense = 0
luck = 8
float = 0
strength = ELEMENT_NONE
weakness = ELEMENT_NONE
function start()
end
function get_action()
return COMBAT_ATTACKING, 1, getRandomPlayer()
end
function die()
end
| nilq/small-lua-stack | null |
--waypoint npc's
includeFile("custom_content/poi/corellia_poi_waypoints.lua")
includeFile("custom_content/poi/dantooine_poi_waypoints.lua")
includeFile("custom_content/poi/dathomir_poi_waypoints.lua")
includeFile("custom_content/poi/endor_poi_waypoints.lua")
includeFile("custom_content/poi/lok_poi_waypoints.lua")
inclu... | nilq/small-lua-stack | null |
local Socket = require("framework.net.Socket")
local GameSocketReceive = import("SocketReceive")
local GameSocket = class("GameSocket",Socket)
function GameSocket:ctor()
Socket.ctor(self, g_SocketCmd.SERVER_GAME)
self.m_receive = GameSocketReceive.new()
end
function GameSocket:receiveMsg(cmd, msgSize, msgD... | nilq/small-lua-stack | null |
Config = {}
Config.groups = {"moderator", "admin", "superadmin"}
Config.enterText = "~r~WARNING: ~y~You have entered an ADMIN ZONE. ~n~~w~Do not RP or speed within this area."
Config.exitText = "~g~You have exited the ADMIN ZONE! You may resume regular RP!"
Config.clearText = "~g~The ADMIN ZONE has been cleared! You ... | nilq/small-lua-stack | null |
-- bounce.lua
--
-- Movement method to bounce around the screen, changing direction
-- when a wall is hit.
-----------------------------------------------------------------------
local bounce = {}
-----------------------------------------------------------------------
-- Checks if the associated entity is at an edge (... | nilq/small-lua-stack | null |
--- SPDX-License-Identifier: Apache-2.0
--- Copyright (c) 2021 Intel Corporation
module("luci.controller.rest_v1.nat_rest", package.seeall)
local uci = require "luci.model.uci"
json = require "luci.jsonc"
io = require "io"
sys = require "luci.sys"
utils = require "luci.controller.rest_v1.utils"
ifutil = require "luc... | nilq/small-lua-stack | null |
Shape = Object:extend()
function Shape:new(x, y, speed)
self.x = x
self.y = y
self.speed = speed or 100
end
function Shape:update(delta_time)
if love.keyboard.isDown("right") then
self.x = self.x + self.speed * delta_time -- Increments x at the rate of self.speed pixels / sec
end
if love.keyboard.is... | nilq/small-lua-stack | null |
local M = {}
local api = vim.api
local cmd = vim.cmd
local qfs = require('bqf.qfwin.session')
local utils = require('bqf.utils')
function M.sign_reset()
local qwinid = api.nvim_get_current_win()
local qs = qfs.get(qwinid)
local qlist = qs:list()
local sign = qlist:get_sign()
sign:reset()
end
func... | nilq/small-lua-stack | null |
-- This file is automatically generated, do not edit!
-- Item data (c) Grinding Gear Games
local itemBases = ...
itemBases["Fishing Rod"] = {
type = "Fishing Rod",
socketLimit = 4,
tags = { two_hand_weapon = true, not_for_sale = true, weapon = true, twohand = true, fishing_rod = true, default = true, },
implicitMo... | nilq/small-lua-stack | null |
-- Utility functions for my3status modules
local time = require("posix.time")
local allow_color = true
local dodebug = false
-- Writes the given objects to stderr if debugging is enabled.
local function debug(...)
if not dodebug then return end
io.stderr:write("[DEBUG]")
local items = {...}
for i, ... | nilq/small-lua-stack | null |
--!The Make-like Build Utility based on Lua
--
-- Licensed to the Apache Software Foundation (ASF) under one
-- or more contributor license agreements. See the NOTICE file
-- distributed with this work for additional information
-- regarding copyright ownership. The ASF licenses this file
-- to you under the Apache L... | nilq/small-lua-stack | null |
----------------------------------------------------------
-- Load RayUI Environment
----------------------------------------------------------
RayUI:LoadEnv("Skins")
local S = _Skins
local function LoadSkin()
MerchantFrame:StripTextures(true)
MerchantBuyBackItem:StripTextures(true)
S:ReskinPortraitFrame(Merch... | nilq/small-lua-stack | null |
-- this file is used to define additional static blips and markers to the map
-- some lists: https://wiki.gtanet.work/index.php?title=Blips
local cfg = {}
-- list of blips
-- {x,y,z,idtype,idcolor,text}
cfg.blips = {
-- FITNESS --
{-1202.96252441406,-1566.14086914063,4.61040639877319,311,17,"Fitness World"},
-- P... | 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.