content stringlengths 0 1.05M | origin stringclasses 2
values | type stringclasses 2
values |
|---|---|---|
--[[
This is modified version of https://github.com/wube/factorio-data/blob/master/core/lualib/event_handler.lua
Modified by ZwerOxotnik
]]
---@type table<string, table>
local libraries = {}
local setup_ran = false
local register_remote_interfaces = function()
--Sometimes, in special cases, on_init and on_load... | nilq/small-lua-stack | null |
local AUTOEQUIP_NAME local AUTOEQUIP_SAVE_INFO,AUTOEQUIP_DEL_INFO,AUTOEQUIP_SAVE_FINFO,AUTOEQUIP_ERROR_INFO,AUTOEQUIP_DEL_TEXT,AUTOEQUIP_TEXT_SAVED local AUTOEQUIP_TEXT_RENAME,AUTOEQUIP_HELP_SAVE_BTN_TITLE,AUTOEQUIP_HELP_SAVE_BTN_DESC,AUTOEQUIP_HELP_SET_BTN_COMMENT1,AUTOEQUIP_NEW_INFO local AUTOEQUIP_MOVE_TOOLTIP,AUTO... | nilq/small-lua-stack | null |
function onStart(target, buff)
add_buff_parameter(target, buff, 1)
end
function onPostTick(target, buff)
if buff.not_go_round > 0 then
return
end
buff.remaining_round = buff.remaining_round - 1;
if buff.remaining_round <= 0 then
UnitRemoveBuff(buff);
end
end
function onEnd(target, buff)
local move_type = b... | nilq/small-lua-stack | null |
EtcdClient = EtcdClient or class("EtcdClient")
function EtcdClient:ctor(host)
self.host = string.rtrim(host, "/")
end
function EtcdClient:get_host()
return self.host
end
function EtcdClient:example_cb(id, op, result)
end
function EtcdClient:set(key, value, ttl, is_dir, cb_fn)
local op = EtcdClientOpSe... | nilq/small-lua-stack | null |
test_run = require('test_run').new()
REPLICASET_1 = { 'box_1_a', 'box_1_b' }
REPLICASET_2 = { 'box_2_a', 'box_2_b' }
test_run:create_cluster(REPLICASET_1, 'rebalancer')
test_run:create_cluster(REPLICASET_2, 'rebalancer')
util = require('util')
util.wait_master(test_run, REPLICASET_1, 'box_1_a')
util.wait_master(test_... | nilq/small-lua-stack | null |
module("util", package.seeall)
| nilq/small-lua-stack | null |
-- Use `digest` library http://www.tecgraf.puc-rio.br/~lhf/ftp/lua/install.html
local digest = require "bgcrypto.private.digest"
return digest('ripemd160')
| nilq/small-lua-stack | null |
--[[
CLI Plugin -> Map Command (ServerSide)
by Tassilo (@TASSIA710)
Command for quickly changing map.
--]]
jet.AddCliCommand("map", function(args)
if #args == 0 then
print("Current Map: " .. game.GetMap())
elseif #args == 1 then
RunConsoleCommand("changelevel", args[1])
else
return false
end
end, "", "C... | nilq/small-lua-stack | null |
require("config")
--Changes
require("prototypes.changes")
--Speed
require("prototypes.speed-4")
require("prototypes.speed-5")
--Productivity
require("prototypes.productivity-4")
require("prototypes.productivity-5")
--Effectivity
require("prototypes.effectivity-4")
require("prototypes.effectivity-5")
--Pollu... | nilq/small-lua-stack | null |
local c = ''
--env-types
do
local f = ASR(io.open(CEU.opts.env_types))
c = c..'\n\n/* ENV_HEADER */\n\n'..f:read'*a'
f:close()
end
--env-threads
do
if CEU.opts.env_threads then
local f = ASR(io.open(CEU.opts.env_threads))
c = c..'\n\n/* ENV_THREADS */\n\n'..f:read'*a'
f:close()... | nilq/small-lua-stack | null |
loadfile("/tmp/metrics.lua")
local https = require "ssl.https"
local ltn12 = require "ltn12"
local json = require 'lunajson'
local redis = require "resty.redis"
local arg = ngx.req.get_uri_args()
local incr = 0
function read_all(file)
local f = assert(io.open(file, "rb"))
local content = f:read("*all")
f:... | nilq/small-lua-stack | null |
object_static_worldbuilding_structures_mun_nboo_building_chunk_destoyed_09 = object_static_worldbuilding_structures_shared_mun_nboo_building_chunk_destoyed_09:new {
}
ObjectTemplates:addTemplate(object_static_worldbuilding_structures_mun_nboo_building_chunk_destoyed_09, "object/static/worldbuilding/structures/mun_nboo_... | nilq/small-lua-stack | null |
object_tangible_furniture_nym_themepark_nym_themepark_rug = object_tangible_furniture_nym_themepark_shared_nym_themepark_rug:new {
}
ObjectTemplates:addTemplate(object_tangible_furniture_nym_themepark_nym_themepark_rug, "object/tangible/furniture/nym_themepark/nym_themepark_rug.iff")
| nilq/small-lua-stack | null |
-- The MIT License (MIT)
-- Copyright (c) 2016 Ruairidh Carmichael - ruairidhcarmichael@live.co.uk
-- 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 ... | nilq/small-lua-stack | null |
local local0 = 0.3
local local1 = 1 - local0
local local2 = 1 - local0
local local3 = 1 - local0
local local4 = 1 - local0
local local5 = 0 - local0
local local6 = 1 - local0
local local7 = 30 - local0
local local8 = 1 - local0
local local9 = 30 - local0
local local10 = 1 - local0
local local11 = 10 - local0
local loca... | nilq/small-lua-stack | null |
---
--- De-obfuscated bootloader
--- The initial boot script has standardised path and filename (/boot) so it must not be altered
--- Working directory must be the (virtual) filesystem root
---
--- Created by torvald.
--- DateTime: 2019-11-03 02:30
---
dofile("etc/init.lua") | nilq/small-lua-stack | null |
function dumpDirectory(filelist, directory)
flist = System.listDirectory(directory)
for idx, file in ipairs(flist) do
if file.name ~= "." and file.name ~= ".." and file.name ~= "filelist.txt" then
fullFile = directory .. "/" .. file.name
if file.directory then
dumpDirectory(filelist, fullFile)
else
... | nilq/small-lua-stack | null |
-- Hook dictating command permissions
local Get = require(workspace.Get)
local G = Get "Common.Globals"
-- Can this owner command be run?
function IsOwner(context)
return G.IsOwner(context.Executor)
end
-- Can this admin command be run?
function IsAdmin(context)
return G.IsAdmin(context.Executor)
end
-- Can this ... | nilq/small-lua-stack | null |
local load = loadstring and loadstring or load
local dump = string.dump
local mtstates = require("mtstates")
local mts = mtstates
print("test01 started")
print("mtstates._VERSION", mts._VERSION)
print("mtstates._INFO", mts._INFO)
local function line()
return debug.getinfo(2).currentline
end
local function PRIN... | nilq/small-lua-stack | null |
return {
Logger = require('./logger'),
TableUtils = require('./tableUtils'),
Loader = require('./loader'),
Process = require('./process')
} | nilq/small-lua-stack | null |
--------------------------------
-- @module Director
-- @parent_module cc
---@class cc.Director
local Director = {}
cc.Director = Director
--------------------------------
--- Pauses the running scene.
--- The running scene will be _drawed_ but all scheduled timers will be paused.
--- While paused, the draw rate wi... | nilq/small-lua-stack | null |
-- Inject new raw definitions into the world
--[====[
devel/inject-raws
=================
WARNING: THIS SCRIPT CAN PERMANENLY DAMAGE YOUR SAVE.
This script attempts to inject new raw objects into your
world. If the injected references do not match the actual
edited raws, your save will refuse to load, or load but cra... | nilq/small-lua-stack | null |
local _, CLM = ...
local L = {}
-- For Lazy creating localization during runtime throug CLM.L[string]
setmetatable(L, {
__index = function (table, key)
return tostring(key)
end
})
CLM.L = L
| nilq/small-lua-stack | null |
AuctionatorTabDisplayModes = {
Auctionator = {
"AuctionatorConfigFrame"
},
ShoppingLists = {
"AuctionatorShoppingListFrame"
},
Undercutting = {
"AuctionatorUndercuttingFrame"
}
} | nilq/small-lua-stack | null |
Unicorn = {
version = 0.02,
throttled = {},
}
function Unicorn.throttle(key, frequency)
current_ms = GetFrameTimeMilliseconds() / 1000.0
last_render_ms = Unicorn.throttled[key] or 0
if current_ms > (last_render_ms + frequency) then
Unicorn.throttled[key] = current_ms
return false
... | nilq/small-lua-stack | null |
--[[
* The `Matter.Events` module contains methods to fire and listen to events on other objects.
*
* See the included usage [examples](https:--github.com/liabru/matter-js/tree/master/examples).
*
* @class Events
]]--
import 'matter/core/Common'
Events = {}
Events.__index = Events
--[[
* Subscribes a callback funct... | nilq/small-lua-stack | null |
-- file : config.lua
local module = {}
module.SSID = {}
module.SSID["YOUR_SSID"] = "YOUR_WIFI_PASSWORD"
module.HOST = "BROKER_IP"
module.PORT = 1883
module.ID = "moisture"
module.USER = "BROKER_USER"
module.PASS = "BROKER_PASSWORD"
module.ENDPOINT = "medusa"
return module
| nilq/small-lua-stack | null |
class 'PlayerFoV'
function PlayerFoV:__init()
self.fov = MeshTriangle( LocalPlayer:GetPosition(), 20 )
self.fov:SetPosition( LocalPlayer:GetPosition() )
self.fov.width_multi = 3
self.last_yaw = 0
self.anti_spam = Timer()
Events:Subscribe( 'PostTick', self, self.Update )
end
function PlayerFoV:Update()
if self.... | nilq/small-lua-stack | null |
-- Routine for NPC "Robert" in Velius' Dungeon
velocity = 45
loadRoutine = function(R, W)
if (W:isConditionFulfilled("boss", "BossVelius")) then
R:setDisposed()
return
end
R:setTilePosition(20,5)
R:setReloadEnabled(false)
R:setFacingDown()
R:wait(4000)
R:goToTile(19,5)
R:setFacingU... | nilq/small-lua-stack | null |
local tbug = SYSTEMS:GetSystem("merTorchbug")
local cm = CALLBACK_MANAGER
local abs = math.abs
local floor = math.floor
local strmatch = string.match
local tonumber = tonumber
local defaults =
{
interfaceColors =
{
tabWindowBackground = "hsla(60, 10, 20, 0.5)",
tabWindowPanelBa... | nilq/small-lua-stack | null |
object_static_worldbuilding_vegitation_ptch_weedclump = object_static_worldbuilding_vegitation_shared_ptch_weedclump:new {
}
ObjectTemplates:addTemplate(object_static_worldbuilding_vegitation_ptch_weedclump, "object/static/worldbuilding/vegitation/ptch_weedclump.iff") | nilq/small-lua-stack | null |
-- Copyright (c) 2018 Redfern, Trevor <trevorredfern@gmail.com>
--
-- This software is released under the MIT License.
-- https://opensource.org/licenses/MIT
describe("UnionFind", function()
local UnionFind = require "moonpie.collections.unionfind"
it("can union two objects together", function()
local uf = Uni... | nilq/small-lua-stack | null |
--[[
Licensed under GNU General Public License v2
* (c) 2014, anticlockwise <http://github.com/anticlockwise>
--]]
local helpers = require("modules.lain.helpers")
local async = require("modules.lain.... | nilq/small-lua-stack | null |
require("lang.clojure").format()
require("lang.clojure").lint()
require("lang.clojure").lsp()
require("lang.clojure").dap()
| nilq/small-lua-stack | null |
require("src.update.freezers") -- For freezers
require("src.update.shields") -- For shields
require("src.update.mirrors") -- For mirrors
require("src.update.intakers") -- For intakers
require("src.update.supgens") -- For super generators
require("src.update.gens") -- For generators
require("src.update.replicators") -- ... | nilq/small-lua-stack | null |
-- [[ Constants support in LUA ]] --
-- [[ Credits: Andrejs Cainikovs]] --
-- [[ Used as Safety measure ]] --
function CreateConstant(tbl)
return setmetatable(
{},
{
__index = tbl,
__newindex = function(t, key, value)
error("attempting to change c... | nilq/small-lua-stack | null |
object_tangible_wearables_cybernetic_s03_cybernetic_s03_arm_r = object_tangible_wearables_cybernetic_s03_shared_cybernetic_s03_arm_r:new {
}
ObjectTemplates:addTemplate(object_tangible_wearables_cybernetic_s03_cybernetic_s03_arm_r, "object/tangible/wearables/cybernetic/s03/cybernetic_s03_arm_r.iff")
| nilq/small-lua-stack | null |
--[[
Condition codes to translate OpenWeather weather info to Fibaro weather icon
Read more https://openweathermap.org/weather-conditions#How-to-get-icon-URL
@author ikubicki
]]
class 'ConditionCodes'
function ConditionCodes:get(id, icon)
local key = id .. string.sub(icon, 3)
return ConditionCodes.codes[key]
... | nilq/small-lua-stack | null |
local S = df_underworld_items.S
local glowstone_def = {
_doc_items_longdesc = df_underworld_items.doc.glowstone_desc,
_doc_items_usagehelp = df_underworld_items.doc.glowstone_usage,
light_source = minetest.LIGHT_MAX,
description = S("Lightseam"),
tiles = {
{
name = "dfcaverns_glowstone_anim.png",
backface... | nilq/small-lua-stack | null |
-- ========== THIS IS AN AUTOMATICALLY GENERATED FILE! ==========
PlaceObj('StoryBit', {
ActivationEffects = {},
Category = "ColdWaveStart",
Delay = 60000,
Effects = {},
Enables = {
"BadMoxie_Tech",
},
Image = "UI/Messages/Events/18_moxie.tga",
InheritsObject = false,
Prerequisites = {
PlaceObj('PickFromL... | nilq/small-lua-stack | null |
-- DRV8825 driver
-- Provides gpio init, enable, disable, direction, and pulse counting for steps
-- The DVR8825 runs over normal GPIO
local m = {}
m.pinStep = 4
m.pinDir = 0 -- it is 0 cuz that is bootstrap pin which inconsequential on direction pin
m.pinSleep = 16
-- Loopback pulse in from m.pinStep
-- You need ... | nilq/small-lua-stack | null |
local Cell = require "src.cell"
local Piece = require "src.piece"
local kalis = require "lib.kalis"
local class = require "lib.middleclass"
--- @class Board
--- @field new fun(self: Board, game: Game, width: integer, height: integer, cell_size: integer)
local Board = class("Board")
--- @param game Game @ The corresp... | nilq/small-lua-stack | null |
print("test2 starting")
test2_var="foo"
print(test1_var)
print("test2 done")
| nilq/small-lua-stack | null |
--[[
Script that fetches the recent forum posts from forum and shows them in chat
--]]
local url = "https://mrgreengaming.com/forums/forum/31-multi-theft-auto.xml";
local showTopics = 4;
local interval = 3 * 60 * 60 * 1000;
local chatDelay = 10 * 1000;
local fetchTimer, chatDelayTimer = nil;
function onStart()
fetc... | nilq/small-lua-stack | null |
-- Generated by CSharp.lua Compiler
local System = System
local SlipeMtaDefinitions
local SlipeCollisionShapes
System.import(function (out)
SlipeMtaDefinitions = Slipe.MtaDefinitions
SlipeCollisionShapes = Slipe.Shared.CollisionShapes
end)
System.namespace("Slipe.Shared.CollisionShapes", function (namespace)
-- <... | nilq/small-lua-stack | null |
print('core.contents.list.changeTokenLockTx');
local ContMe = ContentsMe;
ChangeTokenLockTx = class(ContMe);
local auObjs = {}; -- Change Token Lock Tx Objects
ChangeTokenLockTx._myContentsObj = {};
-- local _myContentsObj = ChangeTokenLockTx._myContentsObj;
ChangeTokenLockTx._myContentsName = 'change... | nilq/small-lua-stack | null |
local function getData( theElement, key )
local key = tostring(key)
if isElement(theElement) and (key) then
return exports['[ars]anticheat-system']:callData( theElement, tostring(key) )
else
return false
end
end
local function setData( theElement, key, value, sync )
local key = tostring(key)
local value ... | nilq/small-lua-stack | null |
-- All the net messages defined here
util.AddNetworkString("Impound:UI:Impound")
util.AddNetworkString("Impound:UI:Clamp")
util.AddNetworkString("Impound:Unimpound")
util.AddNetworkString("Impound:Unclamp") | nilq/small-lua-stack | null |
local tabletools = {}
-- Initialize an array of size *size* fill with *value*
tabletools.init = function (size, value)
local vector = {}
for i = 1, size do
vector[i] = value
end
return vector
end
-- Check if two arrays are equals
tabletools.equal = function (v1, v2)
if # v1 ==... | nilq/small-lua-stack | null |
-- Titanium smelting
local util = require("__bztitanium__.data-util");
if mods["FactorioExtended-Plus-Core"] then
util.remove_raw("recipe", "titanium-ore")
util.remove_raw("item", "titanium-alloy")
util.remove_raw("recipe", "titanium-alloy")
util.remove_raw("technology", "titanium-processing")
end
... | nilq/small-lua-stack | null |
config = {
var0 = {
'file/symlink_file'
},
var1 = {
'..',
'file/symlink_dir'
},
var4 = {
'this_path_should_not_exist'
}
}
| nilq/small-lua-stack | null |
local determineOffsetX = function(self, child)
if self.left ~= "fill" then
return self.left
elseif self.right ~= "fill" then
return self:grantedWidth() - self.right - child:grantedWidth()
else
local spareWidth = self:grantedWidth() - child:grantedWidth()
local totalookyhunks = (self.leftWeight or ... | nilq/small-lua-stack | null |
local cjson = require("cjson")
local dynamicd_build = require("core.dao.dynamicd_build_sql")
local utils = require("core.utils.utils")
local user_log = require("core.log.user_log")
local _M = {}
function _M.query_info_by_id(store,id)
local flag, info= store:query({
sql = "select id,limit_count from c_host ... | nilq/small-lua-stack | null |
local setmetatable = setmetatable
local _M = require('apicast.policy').new('Example', '0.1')
local mt = { __index = _M }
local b='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
function dec(data)
data = string.gsub(data, '[^'..b..'=]', '')
return (data:gsub('.', function(x)
if (x ... | nilq/small-lua-stack | null |
local opt = vim.opt
local cmd = vim.cmd
local fn = vim.fn
local g = vim.g
local api = vim.api
cmd [[packadd packer.nvim]]
require('packer').startup(function(use)
use 'wbthomason/packer.nvim'
-- functionalities
use {
'nvim-telescope/telescope.nvim',
requires = {
{'nvim-lua/plenary.nvim'},
{'... | nilq/small-lua-stack | null |
-- Copyright 2004-present Facebook. All Rights Reserved.
-- Author: Michael Mathieu <myrhev@fb.com>
require 'fb.luaunit'
require 'nn'
require 'fbcunn'
local test_repeats = 100
local function testSequentialCriterion_run(input_size, n_classes,
module, crit, targettype)
mod... | nilq/small-lua-stack | null |
local has_telescope, telescope = pcall(require, "telescope")
if not has_telescope then
return
end
local finders = require "telescope.finders"
local pickers = require "telescope.pickers"
local config = require("telescope.config").values
local actions = require "telescope.actions"
local action_state = require "telesc... | nilq/small-lua-stack | null |
local _tl_compat; if (tonumber((_VERSION or ''):match('[%d.]*$')) or 0) < 5.3 then local p, m = true, require('compat53.module'); if p then _tl_compat = m end end; local ipairs = _tl_compat and _tl_compat.ipairs or ipairs; local table = _tl_compat and _tl_compat.table or table; local _tl_table_unpack = unpack or table.... | nilq/small-lua-stack | null |
require('unitevents.generic._table')
require('stdlib.worldbounds')
local onEnterMapFuncs = {}
local function OnEnterMap()
local enteringUnit = unit.wrap(GetFilterUnit())
for _,func in ipairs(onEnterMapFuncs) do
local r,e = pcall(func, enteringUnit)
if not r then print(e) end
end
return... | nilq/small-lua-stack | null |
--!strict
--[[
A symbol for representing nil values in contexts where nil is not usable.
]]
local Package = script.Parent.Parent
local Types = require(Package.Types)
return {
type = "Symbol",
name = "None"
} :: Types.None | nilq/small-lua-stack | null |
LV = createColRectangle(901.67871, 601.66272, 2050, 2400)
function isElementInLV(ele)
if (not ele or not isElement(ele)) then return nil end
if (isElementWithinColShape(ele, LV)) then
return true
end
return false
end
| nilq/small-lua-stack | null |
-- LuaTools需要PROJECT和VERSION这两个信息
PROJECT = "fatfs"
VERSION = "1.0.0"
-- sys库是标配
_G.sys = require("sys")
--[[
接线要求:
SPI 使用常规4线解法
Air105开发板 TF模块
PC9 CS
PB12(SPI0_CLK) CLK
PB14(SPI0_MISO) MOSI
PB15(SPI0_MISO) MISO
5V VCC
GND GND
]]
sys.taskI... | nilq/small-lua-stack | null |
local Plugin = script.Parent.Parent.Parent.Parent.Parent.Parent
local Libs = Plugin.Libs
local Roact = require(Libs.Roact)
local RoactRodux = require(Libs.RoactRodux)
local Utility = require(Plugin.Core.Util.Utility)
local Constants = require(Plugin.Core.Util.Constants)
local ContextGetter = require(Plugin.Core.Util.... | nilq/small-lua-stack | null |
local FunctionNode = require'nodes.node'.Node:new()
local function F(fn, args, ...)
return FunctionNode:new{fn = fn, args = args, type = 2, markers = {},user_args = {...}}
end
function FunctionNode:get_args()
local args = {}
for i, node in ipairs(self.args) do
args[i] = node:get_text()
end
args[#args+1] = sel... | nilq/small-lua-stack | null |
--[[
Copyright 2016 BloomReach, Inc.
Copyright 2016 Ronak Kothari <ronak.kothari@gmail.com>.
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 ... | nilq/small-lua-stack | null |
-- luacheck: globals unpack vim
local nvim = require'nvim'
local stdpath = nvim.fn.stdpath
local function system_name()
local name = 'unknown'
if nvim.has('win32unix') or nvim.has('win32') then
name = 'windows'
elseif nvim.has('mac') then
name = 'mac'
elseif nvim.has('unix') then
... | nilq/small-lua-stack | null |
function onSay(cid, words, param)
if #getCreatureSummons(cid) == 0 then
return doPlayerSendCancel(cid, "You don't have any pokemon.")
end
local summons = getCreatureSummons(cid)[1]
local mon = getCreatureName(summons)
if getCreatureSpeed(summons) >= 1 then
doChangeSpeed(summons, -getCreatureSpeed(summons)... | nilq/small-lua-stack | null |
--[[
- SKYNET SIMPLE ( https://github.com/viticm/skynet-simple )
- $Id object_type.lua
- @link https://github.com/viticm/skynet-simple for the canonical source repository
- @copyright Copyright (c) 2020 viticm( viticm.ti@gmail.com )
- @license
- @user viticm( viticm.ti@gmail.com )
- @date 2020/09/17 14:47
- @us... | nilq/small-lua-stack | null |
-- teleport_beam
return {
["teleport_beam"] = {
usedefaultexplosions = true,
GlowSpawner = {
air = true,
class = [[CExpGenSpawner]],
count = 13,
ground = true,
water = false,
properties = {
delay ... | nilq/small-lua-stack | null |
--DO NOT TOUCH
CUSTOMTOOLGUN = {}
CUSTOMTOOLGUN.data = {
enabled = false,
overridecustom = true,
overridewithpic = true,
color = Color(255,255,255),
picture = "https://pm1.narvii.com/7349/20496af691a3f529d64bdffade368e123b204328r1-640-526v2_uhq.jpg",
textcolor = Color(255,255,255),
textheigh... | nilq/small-lua-stack | null |
-- Model the loss of a 1 meter run of copper WR-12 waveguide, and check that
-- the loss matches what we expect from theory. Check the wall and floor loss
-- separately and together, for Ez and Exy models.
test_number = tonumber(FLAGS.test_number) or
Parameter{label='Test', min=1, max=6, default=1, inte... | nilq/small-lua-stack | null |
class "TimerManager"
function TimerManager:TimerManager(...)
for k,v in pairs(arg) do
if type(v) == "table" then
if v.__ptr ~= nil then
arg[k] = v.__ptr
end
end
end
if self.__ptr == nil and arg[1] ~= "__skip_ptr__" then
self.__ptr = Polycore.TimerManager(unpack(arg))
Polycore.__ptr_lookup[se... | nilq/small-lua-stack | null |
--[[
NetworkContract v1.1 [2020-12-02 14:30]
Facilitates Client Server communication through Events. Has Encode, Decode, Diff, Patch and Message Knowledge
This is a minified version of NetworkContract, to see the full source code visit
https://github.com/nidorx/roblox-network-contract
Discussions about this s... | nilq/small-lua-stack | null |
--[[
The contents of this file are subject to the Common Public Attribution
License Version 1.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://ultimate-empire-at-war.com/cpal. The License is based on the Mozilla
Public License Versio... | nilq/small-lua-stack | null |
---
-- Widget to select from a range of values.
--
-- **Extends:** `kloveui.Widget`
--
-- @classmod kloveui.Slider
local graphics = love.graphics
local Widget = require "kloveui.Widget"
local Slider = Widget:extend("kloveui.Slider")
---
-- Current value for the slider.
--
-- Lies in the range 0-1 (inclusive).
--
-... | nilq/small-lua-stack | null |
module(..., package.seeall)
require("lua_tda")
require "lpeg"
require "dialog_utilities"
require "core"
require "dialog_utilities"
joProfile = require "OWLGrEd_UserFields.Profile"
syncProfile = require "OWLGrEd_UserFields.syncProfile"
styleMechanism = require "OWLGrEd_UserFields.styleMechanism"
viewMechanism... | nilq/small-lua-stack | null |
local CookieToHeaders = require("kong.plugins.base_plugin"):extend()
function CookieToHeaders:new()
CookieToHeaders.super.new(self, "cookies-to-headers")
end
function CookieToHeaders:access(plugin_conf)
CookieToHeaders.super.access(self)
local cookie = require "resty.cookie"
local ck = cookie:new()
... | nilq/small-lua-stack | null |
local rings = require 'lua/rings/rings'
local value = require 'lua/rings/value'
local sh = require 'lua/sh'
local list_disks = sh.command('df | grep ^/dev/sd | sed "s|^.*% ||g" | head -n 5 | tac')
local function ring_def(name, disk, idx)
return {
caption = name,
value = value.eval(string.format('fs_used_per... | nilq/small-lua-stack | null |
require 'xlua'
require 'pl'
-- global settings
if package.preload.settings then
return package.preload.settings
end
-- default tensor type
torch.setdefaulttensortype('torch.FloatTensor')
local settings = {}
local cmd = torch.CmdLine()
cmd:text()
cmd:text("waifu2x")
cmd:text("Options:")
cmd:option("-seed", 11, '... | nilq/small-lua-stack | null |
tohex = function (num)
if not type(num) == "number" then error("Number expected got "..type(num)) end
local out = ""
local a = string.format("%X",num)
for i=a:len(), 1, -1 do
local s = a:sub(i,i)
if s == "x" or s == "" then s = "0" end
local val = string.format("%c",tonumber("0x0"..s)*2+33)
out = val..out
... | nilq/small-lua-stack | null |
local awful = require('awful')
local filesystem = require('gears.filesystem')
local apps = {}
apps.default = {
terminal = "alacritty",
launcher = "rofi -modi drun -show drun",
--lock = "xsecurelock",
--screenshot = "gnome-screenshot",
filebrowser = "thunar",
browser = "firefox",
editor = "... | nilq/small-lua-stack | null |
-- Test suite for snippets.lua
local SnippetManager = package_require 'snippets.manager'
local Config = package_require 'snippets.config'
local Editor = package_require 'snippets.editor'
local Parser = package_require 'snippets.parser'
-- BUG
-- cancel tab activation with selected text
-- TO... | nilq/small-lua-stack | null |
atrributes = {
name = "USB 2-Axis 8-Button Gamepad"
}
controls = {
{ id = 0, usagePage = 1, usage = 48, name = "X", minimum = 0, maximum = 255, expression = "" },
{ id = 1, usagePage = 1, usage = 49, name = "Y", minimum = 0, maximum = 255, expression = "" },
{ id = 2, usagePage = 9, usage = 1, name = "Button 1... | nilq/small-lua-stack | null |
local Charagen = require("mod.elona.api.Charagen")
local Calc = require("mod.elona.api.Calc")
local Chara = require("api.Chara")
local Item = require("api.Item")
local Gui = require("api.Gui")
local Rand = require("api.Rand")
local Effect = require("mod.elona.api.Effect")
local Skill = require("mod.elona_sys.api.Skill"... | nilq/small-lua-stack | null |
require 'util'
local execute = vim.api.nvim_command
function setup_markdown()
opt('o', 'colorcolumn', '81')
opt('o', 'textwidth', 80)
execute(':setlocal spell')
execute(':hi ColorColumn ctermbg=grey guibg=grey')
end
function remove_newlines(s)
return string.gsub(s, '\n', '')
end
| nilq/small-lua-stack | null |
-- -----------------------------------------------------------------------------
-- Star Wars: Imperial Assault - Skirmish
-- by Ikon
-- -----------------------------------------------------------------------------
local UTILS = require("swia-skirmish-tts/modules/common/utils")
local Logger = require("swia-skirmish-t... | nilq/small-lua-stack | null |
require "SvgWriter"
require "vmath"
require "Viewport"
require "SubImage"
require "GridAxis"
require "PixelImage"
require "_utils"
-- Sizing
local imageSize = vmath.vec2(400, 400);
local subImages = SubImage.SubImage(1, 1, imageSize.x, imageSize.y, 0, 50);
local coordSize = 6;
local coordWidth = coordSize * (imageSi... | nilq/small-lua-stack | null |
ModelConfig = { }
ModelConfig[10001]={id=10001,remark='骷髅模型1',path='modelprefabs/Role_Mimi',ccHeight=2.6,ccRadius=0.3}
ModelConfig[10002]={id=10002,remark='骷髅模型2',path='modelprefabs/Player_002',ccHeight=2.6,ccRadius=0.3}
ModelConfig[10003]={id=10003,remark='骷髅模型3',path='modelprefabs/Player_001',ccHeight=2.6,ccRadius=0.... | nilq/small-lua-stack | null |
return recursivedtrequire("components", "components") | nilq/small-lua-stack | null |
local t = Def.ActorFrame{
LoadActor("mid")..{
InitCommand=cmd(CenterX);
};
--[[LoadFont("Common Normal") .. {
InitCommand=cmd(CenterX;addx,-100;addy,-10);
--Text="asduahshdiaufhaifjaifujiasdjs";
CurrentSongChangedMessageCommand=cmd(playcommand,"Refresh");
RefreshCommand=function(self)
local vSo... | nilq/small-lua-stack | null |
-- Class "Module"
local M = {}
function M:new (mass)
local t = {}
t.mass = mass
self.__index = self
setmetatable(t, self)
return t
end
function M:getfuelrequired ()
return math.floor(self.mass / 3) - 2
end
-- Humble unit testing
if not pcall(debug.getlocal, 4, 1) then
local testset = {
{ mass = 12... | nilq/small-lua-stack | null |
local utils = require "utils"
local function find_corrupted(str)
local stack = {}
for i = 1, #str do
local char = str:sub(i, i)
if char == "(" or char == "[" or char == "{" or char == "<" then
table.insert(stack, char)
elseif char == ")" and stack[#stack] ~= "(" then return 3
elseif char == "... | nilq/small-lua-stack | null |
function ShadeColor(c)
local rgb = { ParseColor(c) }
-- SKIN:Bang('!Log', table.concat(rgb, ','), 'Debug')
local hsv = { tonumber(getHue(rgb) * 6), tonumber(getSat(rgb)), tonumber(getVal(rgb)) }
if (hsv[3] < 0.45 and percent < 0.55) or percent > 0.5 then
hsv[3] = hsv[3] + percent
else
... | nilq/small-lua-stack | null |
AddCSLuaFile( "shared.lua" );
AddCSLuaFile( "cl_init.lua" );
include( "shared.lua" );
function ENT:UpdateTransmitState()
return TRANSMIT_ALWAYS;
end | nilq/small-lua-stack | null |
-- config (client)
local cacheMessages = { -- Crate Event
"Found a drop, sent it to your GPS. Others will be looking for it, too.",
"Got a hit on a drop, it's on your GPS. Better find it before someone else.",
"Drop Located. Sent coords to your GPS. First come first serve, get going.",
"Got another hit on a d... | nilq/small-lua-stack | null |
CLinear = torch.class('CLinear')
function CLinear:__init(nInputs)
self.nInputs = nInputs
self.teTheta = torch.zeros(1, nInputs + 1)
self.teGradTheta = torch.zeros(self.teTheta:size())
end
function CLinear:predict(teInput)
local teV1 = torch.Tensor(teInput:size(1), 1):fill(self.teTheta[1][1]) -- bias
local t... | nilq/small-lua-stack | null |
local class = require('middleclass')
local NodeList = require('lash.core.NodeList')
--[[
The default class for managing a NodeList. This class creates the NodeList and adds and removes
nodes to/from the list as the entities and the components in the engine change.
It uses the basic entity matching pattern of an entit... | nilq/small-lua-stack | null |
--- The current list of jobs in the system.
local jobList = {
"builder",
"crafter",
"fisherman",
"gatherer",
"miner",
"woodcutter",
}
--- Jobs
jobs = {}
--- Add a player to a job.
function jobs:add(uuid, job, lvl)
-- Make sure the player will not go
-- over the max job limit in settings.
if self:co... | nilq/small-lua-stack | null |
---
--- Generated by EmmyLua(https://github.com/EmmyLua)
--- Created by shuieryin.
--- DateTime: 12/01/2018 9:14 PM
---
function polyFeatures(X, p)
--POLYFEATURES Maps X (1D vector) into the p-th power
-- [X_poly] = POLYFEATURES(X, p) takes a data matrix X (size m x 1) and
-- maps each example into its... | nilq/small-lua-stack | null |
AddCSLuaFile( "cl_init.lua" ) -- Make sure clientside
AddCSLuaFile( "shared.lua" ) -- and shared scripts are sent.
include('shared.lua') | 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.