content stringlengths 0 1.05M | origin stringclasses 2
values | type stringclasses 2
values |
|---|---|---|
return {
setup = function()
require('user.mappings.custom.alternate').setup()
require('user.mappings.custom.autocorrect').setup()
require('user.mappings.custom.buffers').setup()
require('user.mappings.custom.command').setup()
require('user.mappings.custom.escape').setup()
require('user.mappings.custom.high... | nilq/small-lua-stack | null |
local portals = {
--Carlin
[9069] = {position = Position(32192, 31419, 2), vocation = 2, storage = 10017}, --ice
[9070] = {position = Position(32972, 32227, 7), vocation = 2, storage = 10017}, --earth
[9071] = {position = Position(32911, 32336, 15), vocation = 1, storage = 10017}, --fire
[9072] = {position = Posit... | nilq/small-lua-stack | null |
--[[ BEGIN STANDARD HEADER ]] --
-- Imports
local _G = _G
local SVC_NAMESPACE = SVC_NAMESPACE
-- Isolate the environment
setfenv(1, select(2, ...))
--[[ END STANDARD HEADER ]] --
FolderLocation = _G.debugstack():match("ns\\(.-)\\")
| nilq/small-lua-stack | null |
local sys = require 'sys'
local nvim = require 'neovim'
local executable = require('utils.files').executable
local is_file = require('utils.files').is_file
local getcwd = require('utils.files').getcwd
local M = {
makeprg = {
luacheck = {
'--max-cyclomatic-complexity',
'20',
... | nilq/small-lua-stack | null |
local AddonName = select(1, ...);
local Addon = select(2, ...);
-- This will register a callback to Ark with Vendor
local function registerArkExtension()
local arkExtension =
{
-- Vendor will check this source is loaded prior to registration.
-- It will also be displayed in the Vendor UI.
... | nilq/small-lua-stack | null |
local composer = require( "composer" )
local scene = composer.newScene()
local runtime = require("libraries.runtime")
local db = require("libraries.db")
runtime.settings["currentscene"] = "controlChoice"
local _W = display.contentWidth
local _H = display.contentHeight
local screenGroup, mainGroup, settingsLabel, pla... | nilq/small-lua-stack | null |
Seeker = Object:extend()
Seeker:implement(GameObject)
Seeker:implement(Physics)
Seeker:implement(Unit)
function Seeker:init(args)
self:init_game_object(args)
self:init_unit()
if self.boss then
self:set_as_rectangle(18, 7, 'dynamic', 'enemy')
self:set_restitution(0.5)
self.classes = {'mini_boss'}
... | nilq/small-lua-stack | null |
require "Polycode/EventDispatcher"
class "Scene" (EventDispatcher)
ENTITY_MESH = 0
ENTITY_LIGHT = 1
ENTITY_CAMERA = 2
ENTITY_ENTITY = 3
ENTITY_COLLMESH = 4
function Scene:__index__(name)
if name == "clearColor" then
retVal = Polycore.Scene_get_clearColor(self.__ptr)
if Polycore.__ptr_lookup[retVal] ~= nil then... | nilq/small-lua-stack | null |
-- inspired from github.com/soumith/dcgan.torch
require 'torch'
require 'nn'
require 'optim'
-- various otions for training
opt = {
gpu = 1, -- by default uses it
num_epoch = 1000, -- ??
batch_size = 1, -- ??
ntrain = 100, -- ??
display_id = 10, -- ??????
name = "Experiment",
nThreads = 4,
dataset = 'lsu... | nilq/small-lua-stack | null |
function init()
fontId = createFont("../modelfiles/JetBrainsMono-Regular.ttf", 24.0)
end
function update()
if getKeyState("escape") == 0 then
closeWindow()
end
if getKeyState("l") == 0 then
destroyEntity()
end
if getMouseButtonState("left") == 0 then
local cameraCount = getCameraCount()
... | nilq/small-lua-stack | null |
local throwable_cake = false
-- CAKE --
local S
if minetest.get_modpath("intllib") then
S = intllib.Getter()
else
S = function(s) return s end
end
local sizes = {-0.4375, -0.3125, -0.1875, -0.0625, 0.0625, 0.1875, 0.3125}
for i, size in ipairs(sizes) do
local slice = i - 1
local name
local description
local d... | nilq/small-lua-stack | null |
script_name = "Dialoguisation"
script_description = "Sélectionnez deux lignes pour en faire une seule sous forme de dialogue"
script_version = "0.4"
script_author = "Afaren"
include('karaskel.lua')
function main(subs, sel, styles)
meta, styles = karaskel.collect_head(subs, false)
for k, i in ... | nilq/small-lua-stack | null |
CustomColor3 = setmetatable({
toHex = function(color3)
local result = "#"
for _, element in pairs({color3.r, color3.g, color3.b}) do
local hex = ""
element = element * 255
while element > 0 do
local index = math.fmod(element, 16) + 1
element = math.floor(element / 16)
hex = string.sub("... | nilq/small-lua-stack | null |
hook.Add("PlayerSay", "act_chat_commands", function(Player, text, public)
text = string.lower( text )
if ( text == "!kill" ) then
Player:ConCommand("kill")
return ""
elseif ( text == "!cheer" ) then
Player:ConCommand("act cheer")
return ""
elseif ( text == "!laugh... | nilq/small-lua-stack | null |
--[[
Author: FileEX
]]
local composer = require 'composer';
display.setStatusBar(display.HiddenStatusBar);
local audioManager = require 'sounds';
local ud = require 'userdata';
local function onSystemEvent( event )
if (event.type == 'applicationExit') then
local soundOp,musicOp = audioManager.g... | nilq/small-lua-stack | null |
--[[
Copyright 2015 Rackspace
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
di... | nilq/small-lua-stack | null |
praxis: setClipboardText(getFunction("fugue.makeMidiNote"))
praxis:
function fugue.makeMidiNote(note)
if note == nil then return nil end
if note.rest ~= nil then return nil end
-- note is a degree of the scale and an octave
local midiNote = fugue.currentKey +
note.octave * 12 +
... | nilq/small-lua-stack | null |
-----------------------------------------
-- ID: 4663
-- Scroll of Aquaveil
-- Teaches the white magic Aquaveil
-----------------------------------------
function onItemCheck(target)
return target:canLearnSpell(55)
end
function onItemUse(target)
target:addSpell(55)
end | nilq/small-lua-stack | null |
WORLD = "Earth"
assert(rote.expand("Hello $WORLD!") == "Hello Earth!")
assert(rote.merge(nil, {}) ~= nil)
assert(rote.merge({
foo = "bar"
}, {}).foo == "bar")
assert(rote.merge({}, {
foo = "bar"
}).foo == "bar")
assert(rote.merge({
foo = "bar"
}, {
foo = "baz"
}).foo == "baz")
| nilq/small-lua-stack | null |
local function boolean(key, value)
data.raw["bool-setting"][key].hidden = true
data.raw["bool-setting"][key].forced_value = value
end
--
| nilq/small-lua-stack | null |
--[[
Pixel Vision 8 - Display Tool
Copyright (C) 2017, Pixel Vision 8 (http://pixelvision8.com)
Created by Jesse Freeman (@jessefreeman)
Please do not copy and distribute verbatim copies
of this license document, but modifications without
distributing is allowed.
]]--
-- API Bridge
LoadScript("sb-sprites")
Load... | nilq/small-lua-stack | null |
local anim8 = require 'vendor/anim8'
local app = require 'app'
local Fire = {}
Fire.__index = Fire
Fire.isFire = true
local image = love.graphics.newImage('images/fire.png')
image:setFilter('nearest', 'nearest')
local g = anim8.newGrid(25, 25, image:getWidth(), image:getHeight())
local states = {
burning = anim8.... | nilq/small-lua-stack | null |
--[[
--MIT License
--
--Copyright (c) 2019 manilarome
--Copyright (c) 2020 Tom Meyers
--
--Permission is hereby granted, free of charge, to any person obtaining a copy
--of this software and associated documentation files (the "Software"), to deal
--in the Software without restriction, including without limitation the ... | nilq/small-lua-stack | null |
Config = {}
Config.DrawDistance = 100.0
Config.MarkerColor = { r = 50, g = 50, b = 204 }
Config.EnablePlayerManagement = true
Config.EnableVaultManagement = false
Config.EnableSocietyOwnedVehicles = false
Config.EnableHelicopters = false
Config.E... | nilq/small-lua-stack | null |
local conf = {}
conf.redis = {
["pubsub"] = {
host = "127.0.0.1",
port = 6379,
},
["single"] = {
host = "127.0.0.1",
port = 6379,
},
[1] = {
host = "127.0.0.1",
port = 6379,
},
[2] = {
host = "192.168.82.164",
port = 6379,
}... | nilq/small-lua-stack | null |
local Immutable = require(script.Parent.Parent.Immutable)
local DataStoresUpdateSearchFilter = require(script.Parent.Parent.Actions.DataStoresUpdateSearchFilter)
return function(state, action)
local dataStoresData = state or {
storesSearchTerm = "",
}
if action.type == DataStoresUpdateSearchFilter.name then
... | nilq/small-lua-stack | null |
--/run dofile("interface/addons/DungeonLoots/lua/ui.lua")
local me = DL.ui
function me.OnUpdate()
if me.update then
if me.update + 0.2 < GetTime() then
me.FilterList()
me.update = nil
end
end
end
function me.Init()
me.InitTabs()
me.InitFrames()
me.LoadData()
DL.plus.Init(DL.tbls.items)
end
----------... | nilq/small-lua-stack | null |
ENT.Base = "wac_hc_base"
ENT.Type = "anim"
ENT.Author = wac.author
ENT.Category = wac.aircraft.spawnCategory
ENT.Spawnable = true
ENT.AdminSpawnable = true
ENT.PrintName = "Black Hawk UH-60"
ENT.Model = "models/bf2/helicopters/uh-60 blackhawk/uh60_b.mdl"
ENT.TopRotor = {
dir = -1,
pos = Vector(0, 0,... | nilq/small-lua-stack | null |
--[[----------------------------------------------------------------------------
Application Name: CommandClient
Description:
TCPIP-Client connection and Command.Client creation using SOPAS ET project.
This samples creates a TCPIPClient connection to the local address of the device
itself ("127.0.0.1") and... | nilq/small-lua-stack | null |
-- 热更新机制,基于https://github.com/jinq0123/hotfix
--- Hotfix helper which hotfixes modified modules.
-- Using lfs to detect files' modification.
-- 建议:只用在开发环境
local M = { }
local skynet = require("skynet")
local lfs = require("lfs")
local hotfix = require("hotfix.hotfix")
-- Map file path to file time to detect modifi... | nilq/small-lua-stack | null |
-- * _JOKER_VERSION: 0.0.1 ** Please do not modify this line.
--[[----------------------------------------------------------
Joker - Jokes, Riddles, Fun Facts, & Other Tomfoolery
----------------------------------------------------------
*
* ADDING YOUR OWN JOKES:
* Be aware that modifying this file incorrectl... | nilq/small-lua-stack | null |
--[[
AdiBags - Adirelle's bag addon.
Copyright 2010-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 ... | nilq/small-lua-stack | null |
--Copyright (C) 2009 <SWGEmu>
--This File is part of Core3.
--This program is free software; you can redistribute
--it and/or modify it under the terms of the GNU Lesser
--General Public License as published by the Free Software
--Foundation; either version 2 of the License,
--or (at your option) any later version.
... | nilq/small-lua-stack | null |
local function pressFn(mods, key)
if key == nil then
key = mods
mods = {}
end
return function() hs.eventtap.keyStroke(mods, key, 1000) end
end
local function remap(mods, key, pressFn)
hs.hotkey.bind(mods, key, pressFn, nil, pressFn)
end
-- bonus!
remap({'ctrl'}, ';', pressFn('delete'))
-- hjkl
remap... | nilq/small-lua-stack | null |
local Plugin = script.Parent.Parent.Parent.Parent
local Libs = Plugin.Libs
local Roact = require(Libs.Roact)
local Constants = require(Plugin.Core.Util.Constants)
local ContextHelper = require(Plugin.Core.Util.ContextHelper)
local withTheme = ContextHelper.withTheme
local Components = Plugin.Core.Components
local F... | nilq/small-lua-stack | null |
function measure()
-- setup pin 7 to be output
gpio.mode(7, gpio.OUTPUT)
-- write HIGH to pin 7 to power the moisture sensor
gpio.write(7,1)
-- initialze sum and measurement count
count = 5
sum = 0
-- collect count number of measurements
for i =0, count do
sum = sum+adc.read(0)
end
-- shut off the se... | nilq/small-lua-stack | null |
local function reloadConfig(paths)
doReload = false
for _,file in pairs(paths) do
if file:sub(-4) == ".lua" then
print("A lua config file changed, reload")
doReload = true
end
end
if not doReload then
print("No lua file changed, skipping reload")
r... | nilq/small-lua-stack | null |
slot2 = "BankRecordListCcsItem"
BankRecordListCcsItem = class(slot1)
BankRecordListCcsItem.onCreationComplete = function (slot0)
slot4 = CcsListViewItem
ClassUtil.extends(slot2, slot0)
end
BankRecordListCcsItem.updateView = function (slot0)
if slot0._data then
slot4 = slot0._data.CollectDate
slot0.txtDate.se... | nilq/small-lua-stack | null |
--[[
In this example, we will add a bonus perk that is granted
on a mission trigger. We will have Felix, from Quincy,
give the player the following perk if he is rescued:
Veteran's Knowledge
An old veteran has taught you some new tricks. +10% to
Small Guns and Repair.
--]]
-- @{Hooks:OnStart|OnStart} hook function... | nilq/small-lua-stack | null |
object_static_item_item_hoth_floor_light = object_static_item_shared_item_hoth_floor_light:new {
}
ObjectTemplates:addTemplate(object_static_item_item_hoth_floor_light, "object/static/item/item_hoth_floor_light.iff")
| nilq/small-lua-stack | null |
-- base_flowers/init.lua
-- Load support for Minebase translation.
local S = minetest.get_translator("base_flowers")
--
-- Flowers
--
flowers.register_flower("base_flowers:rose",{
description = S("Red Rose"),
image = "base_flowers_rose.png",
box_size = {-2 / 16, -0.5, -2 / 16, 2 / 16, -0.3, 2 / 16},
groups = {co... | nilq/small-lua-stack | null |
-- --------------------
-- TellMeWhen
-- Originally by Nephthys of Hyjal <lieandswell@yahoo.com>
-- Other contributions by:
-- Sweetmms of Blackrock, Oozebull of Twisting Nether, Oodyboo of Mug'thol,
-- Banjankri of Blackrock, Predeter of Proudmoore, Xenyr of Aszune
-- Currently maintained by
-- Cybeloras of Aerie ... | nilq/small-lua-stack | null |
keyboardWatcher = hs.usb.watcher.new(function(params)
if params["productName"] == "Realforce 87" and params["eventType"] == "added" then
hs.notify.new({title="Karabiner-Elements Profile Switcher", informativeText=params["productName"].." connected"}):send()
hs.task.new("/Users/uraura/bin/karabiner-eleme... | nilq/small-lua-stack | null |
local makeRay = require("rbx_lua_types").Ray.new
local makeVector3 = require("rbx_lua_types").Vector3.new
local datatype = {}
datatype.name = "Ray"
datatype.id = 0x08
function datatype.default()
return makeRay(0, 0, 0, 0, 0, 0)
end
function datatype.reader(stream, count)
local rays = {}
for i = 1, coun... | nilq/small-lua-stack | null |
require("mod.autopickup.data.autopickup.predicate")
require("mod.autopickup.data.autopickup.target")
| nilq/small-lua-stack | null |
local EventFrame = CreateFrame("Frame")
-- gear manager
local BL_TEXTURE = [[Interface\MacroFrame\MacroPopup-BotLeft]]
local BR_TEXTURE = [[Interface\MacroFrame\MacroPopup-BotRight]]
local SCROLL_BAR_FNAME = [[Interface\ClassTrainerFrame\UI-ClassTrainer-ScrollBar]]
local BKG_LEFT_FNAME = [[Interface\MacroFrame\Mac... | nilq/small-lua-stack | null |
function slot1()
return FileTool.GetCurrentDirectiory() .. "\\"
end
function slot2(slot0)
if slot0:gsub("/", "\\"):find(":") == nil then
slot0 = slot0() .. slot0
end
if slot0:sub(#slot0, ) == "\\" then
slot0 = slot0:sub(1, slot1 - 1)
end
slot2 = {}
for slot6 in slot0:gmatch("[^\\]+") do
if slot6 == "..... | nilq/small-lua-stack | null |
---
-- gameplay_logic.lua
local class = require "middleclass"
local FSM = require "fsm"
local GetNewActionState = require "logic.gameplay.states.get_new_action_state"
local OwnerTypes = require "repositories.teams.enums.owner_types"
local GameplayLogic = class("GameplayLogic")
function GameplayLogic:initialize(d... | nilq/small-lua-stack | null |
-- Aura Icons indicator
local Grid2 = Grid2
local min = min
local wipe = wipe
local pairs = pairs
local ipairs = ipairs
local format = string.format
local function Icon_Create(self, parent)
local f = self:CreateFrame("Frame", parent)
f.myIndicator = self
f.myFrame = parent
f.auras = f.auras or {}
f.visibleCount ... | nilq/small-lua-stack | null |
local noOfArgs = KEYS[1]
local interSet = redis.call("sinter", unpack(ARGV))
local allString = ""
for _,key in ipairs(interSet) do
local val = redis.call("HGET", key, "name")
allString = val..', '..allString
end
return allString
| nilq/small-lua-stack | null |
RegisterNetEvent("caue-idcard:show", function(pInfo)
local src = source
local cid = pInfo["ID"]
local name = pInfo["Nome"] .. " " .. pInfo["Sobrenome"]
local dob = pInfo["Data de Nascimento"]
local gender = pInfo["Sexo"]
local image = MySQL.scalar.await([[
SELECT image
FROM mdt_pr... | nilq/small-lua-stack | null |
local nimsuggest = require("textadept-nim.nimsuggest")
local _M = {}
local function samefile(fname, sname)
local fstat = lfs.attributes(fname)
local sstat = lfs.attributes(sname)
return fstat.size == sstat.size and
fstat.change == sstat.change and
fstat.access == fstat.access and
fsta... | nilq/small-lua-stack | null |
--[[
MIT License
Copyright (c) 2019 Mitchell Davis <coding.jackalope@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to us... | nilq/small-lua-stack | null |
local iqm = require("lib.iqm")
local cpml = require("lib.cpml")
local shader = love.graphics.newShader [[
varying vec3 f_normal;
#ifdef VERTEX
attribute vec3 VertexNormal;
uniform mat4 u_model;
uniform mat4 u_viewProj;
vec4 position(mat4 _, vec4 vertex) {
f_normal = mat3(u_model) * VertexNormal;
return u_viewProj ... | nilq/small-lua-stack | null |
local HashMap = require "config-local.hashmap"
local Notifier = require "config-local.notify"
local utils = require "config-local.utils"
local api = vim.api
local hashmap, notifier
local M = {
-- Default config
config = {
config_files = { ".vimrc.lua", ".vimrc" },
hashfile = vim.fn.stdpath "data" .. "/confi... | nilq/small-lua-stack | null |
local ui_new_checkbox = ui.new_checkbox
local ui_new_slider = ui.new_slider
local ui_new_color_picker = ui.new_color_picker
local ui_set_callback = ui.set_callback
local ui_get = ui.get
local ui_set = ui.set
local ui_reference = ui.reference
local math_min = math.min
local math_max = math.max
local math_floor = math.f... | nilq/small-lua-stack | null |
-----------------------------------
-- Area: Throne Room
-- Mob: Zeid (Phase 2)
-- Mission 9-2 BASTOK BCNM Fight
-----------------------------------
mixins = {require("scripts/mixins/job_special")}
require("scripts/globals/monstertpmoves")
require("scripts/globals/settings")
require("scripts/globals/titles")
require("... | nilq/small-lua-stack | null |
local TRIGGER = script:GetCustomProperty("Trigger"):WaitForObject()
local FADE_OUT = script:GetCustomProperty("FadeOut")
local FADE_IN = script:GetCustomProperty("FadeIn")
function OnBeginOverlap(trigger, other)
if other:IsA("Player") then
local fadeOut = World.SpawnAsset(FADE_OUT)
Task.Wai... | nilq/small-lua-stack | null |
--
---WARNING: deprecated
---该函数未指定窗口化分辨率,请使用ChangeVideoMode
---设置窗口化(true)/非窗口化(false)
---@param b boolean
function SetWindowed(b)
end
---设置窗口大小
---可以在运行时动态设置
---@param width number
---@param height number
function SetResolution(width, height)
local w = lstg.WindowHelperDesktop:getInstance()
if w and not w:i... | nilq/small-lua-stack | null |
local CONST = require "libs.constants"
local LUME = require "libs.lume"
local M = {}
local EMPTY_COLOR = 0x000000
M.WIDTH = CONST.WINDOW_WIDTH
M.HEIGHT = CONST.WINDOW_HEIGHT
M.BUFFER = buffer.create(M.WIDTH * M.HEIGHT, { {name=hash("rgb"), type=buffer.VALUE_TYPE_UINT8, count=3} } )
native_raycasting.set_bu... | nilq/small-lua-stack | null |
local p = premake
newaction
{
trigger = "hivemind",
shortname = "Hivemind Distributed Compile",
description = "Generate Hivemind Distributed Compile Commands",
toolset = "msc-v142",
valid_kinds = { "ConsoleApp", "StaticLib", "SharedLib" },
valid_languages = { "C", "C++"},
valid_tools ... | nilq/small-lua-stack | null |
local globals = {}
--- w = width, d = depth
globals.terrain_dimensions = function (w, d) return { width = w, depth = d } end
globals.vector2 = function (v_x, v_y) return { x = v_x, y = v_y } end
globals.vector3 = function (v_x, v_y, v_z) return { x = v_x, y = v_y, z = v_z } end
globals.color3 = function (c_r, c_... | nilq/small-lua-stack | null |
ChatCmdBuilder.new("info", function(cmd)
cmd:sub(":target", function(name, target)
local player = minetest.get_player_by_name(target)
local realName
if not player then
return false, "Please chose valid player name"
else
return true, target.."'s real name is '"..rn.data:get_string(target)
end
en... | nilq/small-lua-stack | null |
require("shared/src/makeMap")
local specialBooleanAttrs = nil
local isSpecialBooleanAttr = makeMap(specialBooleanAttrs)
local isBooleanAttr = makeMap(specialBooleanAttrs + + + )
-- [ts2lua]tslua无法自动转换正则表达式,请手动处理。
local unsafeAttrCharRE = /[>/="'\u0009\u000a\u000c\u0020]/
local attrValidationCache = {}
function isSSR... | nilq/small-lua-stack | null |
--[[
Framework Unit Testing
Performs unit testing on parts of the engine
]]
local lib
local unit
unit = {
test = function(self)
local out = ""
for name, test in next, self.tests do
out = out .. "\byellow\bRUNNING TEST \"" .. name:upper() .. "\"...\n"
out = out .. self:report_suite(name) .. "\n"
end
o... | nilq/small-lua-stack | null |
local pairs = pairs
local ipairs = ipairs
local smatch = string.match
local ssub = string.sub
local slen = string.len
local cjson = require("cjson")
local utils = require("app.libs.utils")
local pwd_secret = require("app.config.config").pwd_secret
local lor = require("lor.index")
local user_model = require("app.model.u... | nilq/small-lua-stack | null |
sizeTerm = {
termX1 = 0,
termY1 = 0,
termX2 = 0,
termY2 = 0,
setCursorPos = function(self, cursorX, cursorY)
newPosX = termX1 + cursorX
newPosY = termY1 + cursorY
if newPosX <= termX2 and newPosY <= termY2 then
term.setCursorPos(newPosX, newPosY)
end
... | nilq/small-lua-stack | null |
local E, L, V, P, G = unpack(select(2, ...)); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
local UF = E:GetModule('UnitFrames');
--Cache global variables
--Lua functions
local unpack = unpack
--WoW API / Variables
local CreateFrame = CreateFrame
function UF:Construct_RaidDebuffs(frame)
local rdebuff = C... | nilq/small-lua-stack | null |
--[[
TheNexusAvenger
Main module representing the button class. This button
is meant to provide an easy way to make "good looking",
cross platform buttons.
--]]
--The amount cut on the top left and bottom right corners.
local CORNER_CUT_BACKGROUND_RELATIVE = 0.3
--Color multiplier when hovering.
local HOVER_COLOR_MU... | nilq/small-lua-stack | null |
--[[
Name: init.lua
For: SantosRP
By: TalosLife
]]--
AddCSLuaFile "cl_init.lua"
AddCSLuaFile "shared.lua"
include "shared.lua"
local acceptedItems = {
["Dry Cannabis (Low Quality)"] = true,
["Dry Cannabis (Medium Quality)"] = true,
["Dry Cannabis (High Quality)"] = true,
}
function ENT:Initialize()
self:SetMo... | nilq/small-lua-stack | null |
StormFox_SOUND = StormFox_SOUND or {}
if SERVER then
util.AddNetworkString("StormFox - Sound")
function StormFox.CLEmitSound(snd,ply,vol)
net.Start("StormFox - Sound")
net.WriteString(snd)
net.WriteFloat(vol or 1)
if ply then
net.Send(ply)
else
net.Broadcast()
end
end
else
net.Receive("StormFox... | nilq/small-lua-stack | null |
local M = {}
M.config = function()
vim.g.indent_blankline_filetype_exclude = {
"help",
"startify",
"dashboard",
"packer",
"neogitstatus",
"NvimTree",
"Trouble",
}
vim.g.indentLine_enabled = 1
vim.g.indent_blankline_char = "▎"
vim.g.indent_blankline_show_trailing_blankline_indent = false
vim.g.inden... | nilq/small-lua-stack | null |
local ball = Class{ type = 'ball' }
function ball:init (x, y)
self.destroyed = false
if x == nil then
self.x = love.math.random(1,2) == 1 and 258 or 288
self.y = VIRTUAL_HEIGHT-70
self.dx = love.math.random(90, 360) * (self.x == 258 and -1 or 1)
self.dy = -180
self.catched = true
else
sel... | nilq/small-lua-stack | null |
--[[
Shooter Flare Gun [shooter_flaregun]
Copyright (C) 2013-2019 stujones11, Stuart Jones
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option... | nilq/small-lua-stack | null |
do
local corofn
function corofn()
for i=1,10,1 do
print2(i)
coroutine.yield()
end
end
coro = coroutine.create(corofn)
end
--print2(coroutine.status(coro))
--coroutine.resume(coro)
do
closeBuffer()
switchToBuffer("dome2.lua")
end
| nilq/small-lua-stack | null |
VENDOR = "BWT"
MODEL = "THERO 120 H2 MB"
-- Configuration variables must be also defined
-- in `write_configuration` command arguments in manifest.yml
IP_ADDRESS_CONFIG = "ip_address"
UNIT_ID_CONFIG = "modbus_unit_id"
-- Initiate device firmware. Called at the end of the file.
function main()
scheduler.add(30000, s... | nilq/small-lua-stack | null |
local sub = string.sub
local tonumber = tonumber
local redis = require 'resty.redis'
local env = require 'resty.env'
local resty_resolver = require 'resty.resolver'
local resty_balancer = require 'resty.balancer'
local resty_url = require 'resty.url'
local _M = {} -- public interface
local redis_conf = {
timeout... | nilq/small-lua-stack | null |
-- Premake5 file to generate project files for all supported platforms
-- Author: Steven Savold
-- workspace (Solution) for the entire enigne and other addons/plugins
workspace "HazmatBrowser"
architecture "x86_64"
startproject "HazmatBrowser"
configurations
{
"Debug",
"R... | nilq/small-lua-stack | null |
local x
do
local y = 12
goto l1
::l2:: x = x + 1; goto l3
::l1:: x = y; goto l2
end
::l3:: ::l3_1:: assert(x == 13) | nilq/small-lua-stack | null |
module(..., package.seeall)
local spineboy
function onCreate()
local layer = flower.Layer()
layer:setScene(scene)
layer:setSortMode(MOAILayer.SORT_PRIORITY_ASCENDING)
spineboy = spine.Skeleton("spineboy_atlas/spineboy.json", "spineboy_atlas/spineboy.atlas")
spineboy:setLayer(layer)
spin... | nilq/small-lua-stack | null |
-- Copyright (C) Dejiang Zhu (doujiang24)
local pairs = pairs
local insert = table.insert
local type = type
local ok, new_tab = pcall(require, "table.new")
if not ok then
new_tab = function (narr, nrec) return {} end
end
local _M = { _VERSION = '0.01' }
function _M.filter(tbl, func)
local ret = {}
for... | nilq/small-lua-stack | null |
local smb = require "smb"
local vulns = require "vulns"
local stdnse = require "stdnse"
local string = require "string"
local smb2 = require "smb2"
local table = require "table"
description = [[
Attempts to detect missing patches in Windows systems by checking the
uptime returned during the SMB2 protocol negotiation.
... | nilq/small-lua-stack | null |
-- TODO support remaining arguments
local units, chrspecialization, specIndex = ...
local player = units.guids[units.aliases.player]
local roles = {
[0] = 'TANK',
[1] = 'HEALER',
[2] = 'DAMAGER',
}
for row in chrspecialization() do
if row.ClassID == player.class and row.OrderIndex == specIndex - 1 then
retu... | nilq/small-lua-stack | null |
--[[
© Justin Snelgrove
© Morgane Parize
Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WA... | nilq/small-lua-stack | null |
AddCSLuaFile( "cl_init.lua" )
AddCSLuaFile( "shared.lua" )
include('shared.lua')
util.AddNetworkString( "UpdateReward" )
function ENT:Initialize( )
self:SetModel( "models/props/cs_office/plant01.mdl" )
self:PhysicsInit( SOLID_VPHYSICS )
self:SetMoveType( MOVETYPE_VPHYSICS )
self:SetSolid( SOLID_VPH... | nilq/small-lua-stack | null |
return {
{
effect_list = {
{
type = "BattleSkillFire",
casterAniEffect = "",
target_choise = "TargetNil",
targetAniEffect = "",
arg_list = {
weapon_id = 67141
}
},
{
type = "BattleSkillFire",
casterAniEffect = "",
target_choise = "TargetNil",
targetAniEffect = ""... | nilq/small-lua-stack | null |
-- uri component encode/decode (https://github.com/daurnimator/lua-http/blob/master/http/util.lua)
local M = {}
-- Encodes a character as a percent encoded string
local function char_to_pchar(c)
return string.format("%%%02X", c:byte(1,1))
end
-- replaces all characters except the following with the appropriate UTF-... | nilq/small-lua-stack | null |
-- Copyright (C) by Jianhao Dai (Toruneko)
local measurement = require "resty.influx.measurement"
local setmetatable = setmetatable
local concat = table.concat
local sort = table.sort
local md5 = ngx.md5
local ipairs = ipairs
local pairs = pairs
local _M = { _VERSION = '0.0.5' }
local mt = { __index = _M }
local ok... | nilq/small-lua-stack | null |
Config = {}
Config.Gangs = {
['lostmc'] = vector3(0, 0, 0),
['ballas'] = vector3(86.75, -1958.28, 21.12),
['vagos'] = vector3(0, 0, 0),
['cartel'] = vector3(0, 0, 0),
['families'] = vector3(0, 0, 0),
['triads'] = vector3(0, 0, 0)
} | nilq/small-lua-stack | null |
require("examples.utils");
require("examples.base64");
local img = GetFile("./examples/img.png");
local ba = URLEncode(BASE64Encode(img));
--print(ba);
Req:SendMapString("img="..ba); | nilq/small-lua-stack | null |
ParticlePhysics =
{
Properties =
{
object_Model = "Objects/default/primitive_box.cgf",
Particle =
{
mass = 50.0,
radius = 1.0,
air_resistance = 0.0,
gravity = {x=0.0, y=0.0, z=-9.81},
water_resistance = 0.5,
water_gravity = {x=0.0, y=0.0, z=-9.81*0.8},
min_bounce_vel = 1.5,
accel_th... | nilq/small-lua-stack | null |
ESX = nil
TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)
if Config.MaxInService ~= -1 then
TriggerEvent('esx_service:activateService', 'yaku', Config.MaxInService)
end
-- TriggerEvent('esx_phone:registerNumber', 'yaku', _U('alert_yaku'), true, true)
TriggerEvent('esx_society:registerSoci... | nilq/small-lua-stack | null |
--[[
因为后端会发比较大范围的场景对象过来,前端这边也做下更小的 aoi 以降低消耗。
另外后端只是发了角色 id 和坐标,然后前端这边根据特定规则过滤,排序等(比如优先显示队友,好友或是我的敌人等等);
然后根据这个排序会把角色分为三级并告诉后端,后端根据这三级将区别发送信息给前端,三级为(不推送,只推送移动,推送全信息)
--]]
local ecs = require "ecs.ecs"
local mt = ecs.class("aoi_system", ecs.system)
function mt:on_update()
self.filter = self.filter or ecs.all("aoi")
... | nilq/small-lua-stack | null |
-- Copyright 2014 Paul Kulchenko, ZeroBrane LLC; All rights reserved
local winapi
local flags
local needrefresh = {}
local function refreshProjectTree()
for file, kind in pairs(needrefresh) do
-- if the file is removed, try to find a non-existing file in the same folder
-- as this will trigger a refresh of... | nilq/small-lua-stack | null |
--[[
file:mahjongLogic.lua
desc:麻将逻辑
auth:Carol Luo
]]
local class = require("class")
local senum = require("mahjong.enum")
local gameCompetition= require("game.competition")
---@class mahjongCompetition:gameCompetition @麻将桌子
local competition = class(gameCompetition)
local this = competition
---构造函数
fu... | nilq/small-lua-stack | null |
local _, T = ...
local EV, L = T.Evie, T.L
local MR
local function Rewards_FollowerOnEnter(self)
local fi = self.RewardsFollower.info
if not fi then return end
local xp, levelsGained, xpToNext = self.RewardsFollower.xp, 0
if (xp + fi.currentXP) >= fi.maxXP then
local xpTable = C_Garrison.GetFollowerXPTable(123... | nilq/small-lua-stack | null |
--------------------------------------------------------------------------------
-- Handler.......... : onUserWantsToQuit
-- Author........... : Bérenger Calle-Cort
-- Description...... : Display a popup to confirm or not to quit the application.
----------------------------------------------------------------------... | nilq/small-lua-stack | null |
local guiEnabled = false
local snowToggle = true
addEvent("onClientReady",true)
addEventHandler("onClientReady",root,function()
triggerClientEvent(client,"triggerGuiEnabled",client,guiEnabled,snowToggle)
end)
local maxHowTo = 2
local howToTable = {}
addEventHandler("onPlayerLeave",root,function() howToTable[source... | nilq/small-lua-stack | null |
--[[
-- added by wsh @ 2017-12-01
-- UILogin视图层
-- 注意:
-- 1、成员变量最好预先在__init函数声明,提高代码可读性
-- 2、OnEnable函数每次在窗口打开时调用,直接刷新
-- 3、组件命名参考代码规范
--]]
local UILoginView = BaseClass("UILoginView", UIBaseView)
local base = UIBaseView
-- 各个组件路径
local server_text_path = "ContentRoot/SvrRoot/SvrSelectBtn/SvrText"
local account_input_... | nilq/small-lua-stack | null |
side = {}
min = 4;
max = 20;
side[1] = min + math.random(max - min);
side[2] = side[1] + math.random(max - min);
side[3] = side[1] + math.random(side[2] - side[1]);
side[4] = side[1]
side[5] = side[2]
for i=1,3 do
if(side[i] > side[i+1] + side[i+2]) then
side[i] = side[i+1]
end
end
if (ITEM =... | 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.