content stringlengths 5 1.05M |
|---|
-- a plugin fixture to test a method on the admin api
local BasePlugin = require "kong.plugins.base_plugin"
local AdminApiMethod = BasePlugin:extend()
AdminApiMethod.PRIORITY = 1000
function AdminApiMethod:new()
AdminApiMethod.super.new(self, "admin-api-method")
end
return AdminApiMethod
|
-- Quick settings
local Rules = "Do whatever you want! ;)"
-- General
function HandleActionCommand(Split, Player)
if Split[2] == nil then
Player:SendMessageInfo("Usage: " .. Split[1] .. " <message ...>")
else
local PlayerName
if NickList[Player:GetUUID()] == nil then
PlayerName = Player:GetName()
else
... |
build_path = os.getenv("BUILDDIR")
package.cpath = build_path..'/test/box/?.so;'..build_path..'/test/box/?.dylib;'..package.cpath
log = require('log')
net = require('net.box')
c = net.connect(os.getenv("LISTEN"))
box.schema.func.create('function1', {language = "C"})
box.schema.user.grant('guest', 'execute', 'functio... |
local function register_chatcommand(cmd, desc, func, param)
cmdlib.register_chatcommand(
"cells " .. cmd,
{
description = desc,
params = param,
func = function(name, params)
local arena = arena.get_by_name(name)
... |
--- === plugins.core.pasteboard.history ===
---
--- Adds text pasteboard history actions to the Search Console.
local require = require
--local log = require "hs.logger".new "pbHistory"
local fs = require "hs.fs"
local task = require "hs.task"
local i18n ... |
-- load effectively acts as a pcall, but didn't pop the stack as expected
(function()
local ok, err = pcall(function()
load(function()
error("Oh dear")
end)
end)
assert(ok, err)
end)()
|
local BaseMotor = require(script.Parent.BaseMotor)
local SingleMotor = require(script.Parent.SingleMotor)
local isMotor = require(script.Parent.isMotor)
--[=[
@interface GroupMotorValues
@within GroupMotor
@field [string] number | GroupMotorValues
]=]
--[=[
@interface GroupMotorGoals
@within GroupMotor
@field ... |
-------------------------------------------------------------------------------
-- Module Declaration
local mod, CL = BigWigs:NewBoss("Chrono-Lord Epoch", 595, 613)
if not mod then return end
mod:RegisterEnableMob(26532)
mod.engageId = 2003
--mod.respawnTime = 0 -- couldn't wipe, Arthas refuses to die
--------------... |
require('hlslens').setup({
override_line_lens = function(lnum, loc, idx, r_idx, count, hls_ns)
local sfw = vim.v.searchforward == 1
local indicator, text, chunks
local a_r_idx = math.abs(r_idx)
if a_r_idx > 1 then
indicator = string.format('%d%s', a_r_idx, sfw ~= (r_idx >... |
local keyIndex = 1;
local TARGET_KEY = KEYS[keyIndex];
keyIndex = keyIndex + 1;
local TIMESTAMP_SEC_KEY = KEYS[keyIndex];
keyIndex = keyIndex + 1;
local TIMESTAMP_US_KEY = KEYS[keyIndex];
if (not KEYS[keyIndex]) then
return redis.error_reply("Not all keys were provided to setSafe");
end
local argIndex = 1;
local ... |
rocks_trees = {
-- User-local Lua and Lua/C modules.
{ name = 'user',
root = home..'/.luarocks' },
-- System-wide Lua and Lua/C modules for specific Lua version installed by apk.
{ name = 'distro-modules',
root = '/usr' },
-- System-wide Lua modules compatible with Lua 5.1-5.3 installed by apk.... |
-- Scoreboard addon for Windower4. See readme.md for a complete description.
_addon = _addon or {}
_addon.name = 'Scoreboard'
_addon.version = 0.9
require 'tablehelper'
require 'stringhelper'
require 'mathhelper'
require 'logger'
require 'actionhelper'
local config = require 'config'
local Display = require 'display... |
local rspamd_dns = require "rspamd_dns"
local logger = require "rspamd_logger"
local function dns_sync_symbol(task)
local to_resolve = tostring(task:get_request_header('to-resolve'))
local is_ok, results = rspamd_dns.request({
task = task,
type = 'a',
name = to_resolve ,
})
logger.errx(task, "is_o... |
-----------------------------------------------------------------------------------------------
--
-- Reverb entity - to be attached to area
-- will set specified EAX settings when entering area
-- registers/updates/unregisters Presets and supports blending
ReverbVolume = {
type = "ReverbVolume",
Editor={
Model... |
local dec2hex = require('src.helpers').dec2hex
local interpreter = require('src.interpreter.init')
local tests = {}
local function test(name, code, func)
table.insert(tests, {
name = name,
code = code,
func = func
})
end
local function runTests()
local cpu = interpreter.new()
... |
--[[
------------------------------------
Description: HPC ladrangvalley (Spiker Weapon), Phasor V2+
Copyright (c) 2016-2018
* Author: Jericho Crosby
* IGN: Chalwk
* Written and Created by Jericho Crosby
-----------------------------------
]]--
function GetRequiredVersion()
return 200
end
function OnScriptLoad(pro... |
-- Project: OiL - ORB in Lua: An Object Request Broker in Lua
-- Release: 0.6
-- Title : IDL Definition Repository
-- Authors: Renato Maia <maia@inf.puc-rio.br>
local _G = require "_G" --[[VERBOSE]] local verbose = require "oil.verbose"
local error = _G.error
l... |
--[[
Shutdown.lua
Generic shutdown module.
Just sets shutdown flag, which often is enough.
May be copied, but will not be customized by plugin generator.
--]]
rawset( _G, 'shutdown', true ) -- I've never had problem using _G.shutdown = true, but it seems like ... |
include("terms")
addition_table = function()
columns = 5
min = 9
max = 18
q = {}
denom = {}
ind = {}
for i=0,columns-1 do
q[i] = {}
ind[i] = math.random(3)
if (ind[i] < 3) then
fact = 10^ind[i]
min_range = min*fact
max_range = max*fact
q[i][1] = (min_range - m... |
object_static_structure_general_dark_bridge_03 = object_static_structure_general_shared_dark_bridge_03:new {
}
ObjectTemplates:addTemplate(object_static_structure_general_dark_bridge_03, "object/static/structure/general/dark_bridge_03.iff")
|
/*
Simple HTTP Extension
(McLovin)
*/
E2Lib.RegisterExtension( "http", false, "Lets E2 chips make web requests to the real internet.", "Allows any E2 to make your server make arbitrary HTTP GET requests to any site. It can use this to make HTTP requests to any IP address inside your local network." )
local cva... |
Config = {}
Config.DrawDistance = 100.0
Config.MarkerColor = { r = 120, g = 120, b = 240 }
Config.EnablePlayerManagement = false -- If set to true, you need esx_addonaccount, esx_billing and esx_society
Config.EnablePvCommand = false
Config.EnableOw... |
--[[
© CloudSixteen.com
http://crowlite.com/license
--]]
|
BOOKMARK_COLOR = 1459515016
MENU_BAR_HEIGHT = 35
BOTTOM_MENU_HEIGHT = 52
LINE_LENGTH = 0.05
LINE_THICKNESS = 2
LAST_BOOKMARK_OFFSET = 999999
MEMORY_OFFSET = 1000000
function draw()
if not memory.read(LAST_BOOKMARK_OFFSET) then
imgui.Begin("Bookmarks")
if imgui.Button("Initialize") then... |
local stateMenu = g.State:new()
function stateMenu:update(dt)
if love.keyboard.isDown('return') then g.statePlay:load() end
end
function stateMenu:draw()
if (g.lastscore) then
love.graphics.setColor(255, 200, 200)
love.graphics.print("GAME OVER", 80, 30)
love.graphics.setColor(255, 240, 240)
love... |
function onLoad(save_state)
self.interactable = false
-- intialize
listBuilder = Global.getTable("listBuilder")
gameController = Global.getTable("gameController")
optionButton = getObjectFromGUID("4df750")
deckZone = getObjectFromGUID(listBuilder.redDeckZoneGUID)
deckMount = getObjectFromG... |
local COMMAND = Clockwork.command:New("ReadLetter");
COMMAND.tip = "Allows you to read a letter you received.";
COMMAND.text = "<string ID>";
COMMAND.arguments = 1;
function COMMAND:OnRun(player, arguments)
local ID = tonumber(arguments[1]);
local character = player:GetCharacter();
if (letters[character] and ID a... |
local JoinTable, parent = torch.class('nn.JoinTable', 'nn.Module')
function JoinTable:__init(dimension)
parent.__init(self)
self.size = torch.LongStorage()
self.dimension = dimension
self.gradInput = {}
end
function JoinTable:forward(input)
for i=1,#input do
local currentOutput = input[i]
... |
VEHICLE_DATABASE = {};
// Display order for garage.
VEHICLE_DISPLAY_ORDER = {"a", "b", "c", "d", "e", "f", "g", "h", "i","j", "k", "l", "m", "n", "o", "p", "q", "r", "t", "s", "2", "C", "6", "u", "5", "A", "B", "E", "4", "3", "F", "G", "I", "J", "K", "L", "N", "O", "1", "H", "7", "8", "9", "P", "Q", "R", "S", "T"};... |
-- spoon doc support
--
-- [x] find spoons installed
-- [x] identify documentation json file for each
-- [x] if found, register for docs: -- registration happens in hs.doc's init.lua
-- [x] console help
-- [ ] hsdocs
-- [ ] exportable html/md ? -- not in initial release
-- [ ] custom built docset ? ... |
--[[
This file was extracted by 'EsoLuaGenerator' at '2021-09-04 16:42:25' using the latest game version.
NOTE: This file should only be used as IDE support; it should NOT be distributed with addons!
****************************************************************************
CONTENTS OF THIS FILE IS COPYRI... |
local ffi = require("ffi")
local IUnknown = require("IUnknown")
ffi.cdef[[
static const int MF_SDK_VERSION = 0x0002;
static const int MF_API_VERSION = 0x0070; // This value is unused in the Win7 release and left at its Vista release value
static const int MF_VERSION = (MF_SDK_VERSION << 16 | MF_API_VERSION);
static ... |
--[[--------------------------------------------------------------------
Copyright (C) 2012 Sidoine De Wispelaere.
Copyright (C) 2012, 2013, 2014 Johnny C. Lam.
See the file LICENSE.txt for copying permission.
--]]--------------------------------------------------------------------
-- Add-on that reg... |
local function get(what,where,name)
print("Downloading " .. name)
local handle = fs.open(where,"w")
local otherHandle = http.get(what)
handle.write(otherHandle.readAll())
handle.close()
otherHandle.close()
end
if not http then
error("Please enable HTTP in CC config.")
end
if not http.websock... |
----
-- @file SpriteFrameAtlasBuilder
---- Brief description.
-- <#Description#>
-- @return <#return value description#>
function SpriteFrameAtlasBuilder:calculateSerializeBufferSize()
end
---- Brief description.
-- <#Description#>
-- @param btSerializer <#btSerializer description#>
-- @return <#return value descri... |
----------------------------------------------
-- External Vehicle Commands, Made by FAXES --
----------------------------------------------
resource_manifest_version "679-44febabe-d386-4d18-afbe-5e627f4af937"
client_script "client.lua" |
local add1 = function (a: number, b: number)
return a + b
end
local function add2(a: number, b)
return add1(a, tonumber(b))
end
let add3: (number, number) => number
add3 = add1
let a1 = add3(1, 2)
let a2 = add1(1)
let a3 = add1('1')
let a4 = add1('1', '2')
let a5 = add1(1, 2, 3, 4)
let a6 = add1('1', '2', '3', ... |
----------------------------------------------------------------------------
--- Wallpaper changer module
--
-- @author Gerome Matilla <gerome.matilla07@gmail.com>
-- @copyright 2019 Gerome Matilla
-- @module wallchange
--
--- Nevermind this. Do what you want.
-----------------------------------------------------... |
local lpeg = require("lpeg")
local re = require("re")
local locale = lpeg.locale()
-- Match a pattern exactly count times
-- http://hisham.hm/2010/10/21/lpeg-cheat-sheet/
local function X(patt, count)
return count == 1 and patt or patt * X(patt, count - 1)
end
-- Get a pattern that matches the specified number of di... |
require 'loadcaffe'
require 'nn'
require 'cudnn'
require 'cunn'
function createModel(nGPU)
local prototxt = '/data/Ananth/code/summer/Puzzle/puzzle_torch/deploy_cfn_jps.prototxt'
local caffeModel = '/data/Ananth/code/summer/Puzzle/puzzle_torch/cfn_jps.caffemodel'
local raw = loadcaffe.load(prototxt, caff... |
--
-- Please see the readme.txt file included with this distribution for
-- attribution and copyright information.
--
function onInit()
if User.isHost() then
Token.onAdd = onAdd;
Token.onDelete = onDelete;
Token.onClickRelease = onClickRelease;
Token.onWheel = onWheel;
Token.onContainerChanged = onConta... |
local Otokonokontroller = {
_VERSION = 'otokonokontroller v0.0.0',
_URL = 'https://github.com/oniietzschan/otokonokontroller',
_DESCRIPTION = 'Input library for love2d',
_LICENSE = [[
Massachusecchu... あれっ! Massachu... chu... chu... License!
Copyright (c) 1789 shru
Permission is he... |
--[[
POSIX library for Lua 5.1, 5.2 & 5.3.
(c) Gary V. Vaughan <gary@vaughan.pe>, 2014-2015
]]
-- Backwards compatibility alias.
return {
openpty = require "posix".openpty,
}
|
ITEM.name = "7.62x54 Ammo"
ITEM.model = "models/gmodz/ammo/762x54.mdl"
ITEM.ammo = "7.62x54mm"
ITEM.ammoAmount = 20
ITEM.maxRounds = 40
ITEM.description = "Ammo box that contains 7.62x54 mm caliber"
ITEM.price = 32000
ITEM.rarity = { weight = 22 } |
-----------------------------------
-- Area: Windurst Waters
-- NPC: Angelica
-- Starts and Finished Quest: A Pose By Any Other Name
-- !pos -70 -10 -6 238
-----------------------------------
local ID = require("scripts/zones/Windurst_Waters/IDs")
require("scripts/globals/settings")
require("scripts/globals/keyitems")... |
--Rejoiner, helps disconnected players rejoin and replace ghosts.
local process = ...
local misc = {
help = {
{"rejoin","","Reconnects you as your ghost player if it exists on the server."},
}
}
function misc:init(process)
process:registerCallback(self,"command",3,self.command)
end
function misc:command(client, ... |
--------------------------------------------------------------------------------
local _ = require 'cherry.libs.underscore'
--------------------------------------------------------------------------------
local Sound = {}
--------------------------------------------------------------------------------
function Sou... |
return PlaceObj("ModDef", {
"title", "Rover Icons Map Overview",
"version", 2,
"version_major", 0,
"version_minor", 2,
"saved", 0,
"image", "Preview.png",
"id", "ChoGGi_RoverIconsMapOverview",
"steam_id", "1582759681",
"pops_any_uuid", "fc9ebba1-c2dd-4ae8-8f50-f0db29eba2ab",
"author", "ChoGGi",
"lua_revision... |
-- We've seen how to create dice, and modify them. Now we can move on to *combining* them: that is, rolling two dice at once, and doing something with the results. As a boring example, let's redefine addition:
plot(d6:combine(d8, function(x,y)
return x + y
end), "d6 + d8")
-- To convince yourself that it truly go... |
local hotkey = require "hs.hotkey"
local caffeinate = require "hs.caffeinate"
local audiodevice = require "hs.audiodevice"
-- lock screen
hotkey.bind(hyperSimpleAlt, "L", function()
caffeinate.lockScreen()
-- caffeinate.startScreensaver()
end)
-- mute on sleep
function muteOnWake(eventType)
if (eventType == caf... |
--send Data to Server
function sendData(sck, data)
local response = {}
local sublen=255
while true
do
--a problem in print(string.sub(data,i,j)) , get data NULL
ret=string.sub(data,0,sublen)
response[#response + 1]=ret
if #ret ~= sublen then break end
data=string.s... |
local hud = trinium.hud
local cfgs = hud.configurators
local api = trinium.api
local configurator = {description = hud.S"HUD Configuration"}
function configurator.getter(player, context)
local fs_base = ""
if not context.selected_tab then
for k, v in pairs(cfgs) do
fs_base = fs_base .. ("button[%s,%s;4,1;open_... |
ESX = nil
local PlayerData = {}
local PlayerLoaded = false
--[[
Creato da LuisDj#7467
Powered by EliteNetwork
www.elitenetwork.it
Vietata la diffusione senza autorizzazione da LuisDj#7467
]]
Citizen.CreateThread(function()
while ESX == nil do... |
-- Basic eval test
describe("#eval loads and", function()
local eval = require("src.eval")
local inst
setup(function()
inst = eval:new()
end)
it("instanciates", function()
assert.same("table", type(inst))
end)
it("can handle booleans", function()
assert.same(true, inst:run("true"))
assert.same(false, ... |
--ベアルクティ・ディパーチャー
--Ursarctic Departure
--scripted by Warspite
function c100416036.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,100416036)
e1:SetCost(c100416036.cost)
e... |
local cqueues = require"cqueues"
local poll = cqueues.poll
local monotime = cqueues.monotime
local setmetatable = setmetatable
local _ENV = {}
local timer = {__name = "lacord.x.timer"}
timer.__index = timer
--- Create a new timer, which will expire `whence` seconds from now.
-- This object can be given to cqueues... |
-----------------------------------------------------------------------------
-- Name: wxwidgets.lua
-- Purpose: wxWidgets configuration file for Premake4
-- Author: laurent.humbertclaude@gmail.com, v.krishnakumar@gmail.com
-- Modified by: Andrea Zanellato zanellato.andrea@gmail.com
----------------... |
--[[
A Directed Edge class
No methods, just two fields, from and to.
]]--
local Edge = torch.class('graph.Edge')
function Edge:__init(from,to)
self.from = from
self.to = to
end
|
function string.starts(String,Start)
return string.sub(String,1,string.len(Start))==Start
end |
local lfs = require "lfs"
local util = require "util"
local M = {
location = os.getenv("HOME")
.. util.separator .. ".config"
.. util.separator .. "check-republic"
.. util.separator .. "config.lua"
}
local function get_default()
return {
name = "A check has failed",
rat... |
-- For when you need a noop function to pass to something that requires a callback.
function noop_false() return false end
function noop_true() return true end
function noop_blank() return "" end
function noop_nil() end
function noop_retarg(...) return ... end
-- For all those actors that need this for various things.
... |
MissionSetup = function()
MissionDontFadeIn()
DATLoad("2_S04.DAT", 2)
DATInit()
LoadActionTree("Act/Anim/Overrides/Mission/2_S04Greeting.act")
LoadActionTree("Act/Conv/2_S04.act")
LoadActionTree("Act/Gifts/Give2S04.act")
LoadAnimationGroups(true)
PedSetUniqueModelStatus(6, -1)
AreaDisablePatrolPath(... |
---@class FairyGUI.AlignType
---@field public value__ number
---@field public Left number
---@field public Center number
---@field public Right number
---@type FairyGUI.AlignType
FairyGUI.AlignType = {}
-------------------------------------------
---@class FairyGUI.AsyncCreationHelper
---@type FairyGUI.AsyncCreation... |
local wibox = require("wibox")
local gears = require("gears")
local beautiful = require("beautiful")
local dpi = beautiful.xresources.apply_dpi
local clickable_container = require("widgets.clickable-container")
local create_button = {}
function create_button... |
local BasePlugin = require "kong.plugins.base_plugin"
local cache = require "kong.tools.database_cache"
local FirstRequestHandler = BasePlugin:extend()
FirstRequestHandler.PRIORITY = 1000
function FirstRequestHandler:new()
FirstRequestHandler.super.new(self, "first-request")
end
function FirstRequestHandler:acces... |
local M = {}
M.setup = function(user_config)
-- Check if user is on Windows.
if vim.fn.has('win32') == 1 then
require('windex.utils').error_msg('A unix system is required for windex. Have you tried using WSL?')
return
end
local utils = require('windex.utils')
local config = require('windex.config')
... |
local pathlib = require('telescope.path')
local Job = require('plenary.job')
local utils = {}
utils.get_separator = function()
return pathlib.separator
end
utils.if_nil = function(x, was_nil, was_not_nil)
if x == nil then
return was_nil
else
return was_not_nil
end
end
utils.get_default = functio... |
---------------------
-- Helpers
---------------------
local vec = vector.new
local vecw = function(axis, n, base)
local ret = vec(base)
ret[axis] = n
return ret
end
local pos2str = minetest.pos_to_string
local get_node = minetest.get_node
local set_node = minetest.set_node
---------------------
-- Nodes
---------... |
local resty_chash = require("resty.chash")
local util = require("util")
local string_sub = string.sub
local _M = {}
local instances = {}
-- given an Nginx variable i.e $request_uri
-- it returns value of ngx.var[request_uri]
local function get_lua_ngx_var(ngx_var)
local var_name = string_sub(ngx_var, 2)
return ng... |
describe("Binary search", function()
local binary_search = require("searches.binary_search")
it("should return one index if found", function()
assert.equal(2, binary_search({ 1, 2, 3 }, 2))
end)
it("should support a custom less_than function", function()
assert.equal(
1,
binary_search({ 3, 2, 1 }, 3, func... |
object_intangible_pet_mining_droid = object_intangible_pet_shared_mining_droid:new {
}
ObjectTemplates:addTemplate(object_intangible_pet_mining_droid, "object/intangible/pet/mining_droid.iff")
|
--[[===============================================================
===================================================================]]
local I = require 'mimgui'
local new = I.new
local ffi = require "ffi"
local elements = require("interface-designer.elements")
local iDesgn = require("interface-designer.globals").i... |
local Symbol_table = {
[1] = {
['token'] = 'inicio',
['lexeme'] = 'inicio',
['type'] = nil,
['is_terminal'] = true,
},
[2] = {
['token'] = 'varinicio',
['lexeme'] = 'varinicio',
['type'] = nil,
['is_terminal'] = true,
},
[3] = {
... |
--
-- Think() is executed 30 times per seconds for each bot
-- require's are shared for each RADIANT and DIRE team
--
local HOST_TIMESCALE = 8.0
local config = require(GetScriptDirectory() .. "/config")
local version = require(GetScriptDirectory() .. "/protocol/version")
local gameinfo = require(GetScriptDirectory() ... |
function furniture_mod.sit(pos, node, clicker)
local meta = minetest.get_meta(pos)
local param2 = node.param2
local name = clicker:get_player_name()
if name == meta:get_string("is_sit") then
print 'player should be standing.'
meta:set_string("is_sit", "")
pos.y = pos.y-0.5
clicker:setpos(pos)
clicker:set... |
--[[
-------------------------------
Save this file as simplecsv.lua
-------------------------------
Example use: Suppose file csv1.txt is:
1.23,70,hello
there,9.81,102
x,y,,z
8,1.243,test
Then the following
-------------------------------------
local csvfile = require "simplecsv"
local m = csvfile.read('./csv1.txt'... |
function love.conf(t)
t.title = "Aegis"
t.identity = "Aegis"
t.window.icon = "Aegis.png"
t.window.fsaa = 0
t.window.vsync = true
t.window.resizable = false
t.window.borderless = false
--t.window.fullscreen = true
--t.window.fullscreentype = "desktop"
end
|
local M = {}
local format = function(bufnr)
local client = vim.lsp.get_active_clients({ name = "null-ls" })[1]
if not client then
return require("misclib.message").warn("no null-ls client")
end
local params = vim.lsp.util.make_formatting_params()
local method = "textDocument/formatting"
client.request... |
-- runtime.callcontext(contextDef, f, [arg1, ...])
--
-- The runtime.callcontext function creates a new context from the contextDef
-- and runs f(arg1, ...). It always returns the context in which f was run. If
-- that function can be executed within the resource limits in the context, it
-- also returns its return va... |
-- pow client module
-- wraps grease
local _={}
local _log
local _grease
local _tcpClient
local _tserial
local _unpack
local pathOfThisFile = ...
-- 4 is a length(thisFile) - this file
-- todo: universal version
local folderOfThisFile = string.sub(pathOfThisFile, 0, string.len(pathOfThisFile)-7... |
---
--- Created by hepengqi.
--- DateTime: 2019-03-14 10:49
--- lua版的defer,和golang的defer功能相同。比较消耗性能,不建议频繁使用
---
local hooked= false
local deferMap = {}
setmetatable(deferMap, {__mode="k"})
---
--- lua版的defer,和golang的defer功能相同
--- 示例:
--- local function foo()
--- local i = 0
--- defer(
--- function()
--... |
AddCSLuaFile("cl_init.lua")
AddCSLuaFile("shared.lua")
include("shared.lua")
DEFINE_BASECLASS("base_gmodentity")
RespawnPoint = RespawnPoint or {}
--[[ Overrides ]]
function ENT:Initialize()
-- Appearance
self:SetModel("models/props_combine/combine_mine01.mdl")... |
-- Prosody IM
-- Copyright (C) 2019 Manuel Rubio
--
-- This project is MIT/X11 licensed. Please see the
-- COPYING file in the source package for more information.
--
-- This module implements XEP-0372: References
--
local xmlns_references = 'urn:xmpp:reference:0'
module:add_feature(xmlns_references)
local mod_muc =... |
local expect = require("cc.expect").expect
--##############################################################
-- Initial setup stuff, so we can download dependencies we need
--##############################################################
local sAbsoluteDir = shell.dir()
local tFiles = {
self = {
location = "http... |
AddCSLuaFile()
SWEP.Base = "weapon_tttbase"
SWEP.Author = "Rising Darkness"
SWEP.PrintName = "Railgun LEVEL5"
SWEP.ClassName = "Railgun"
SWEP.Spawnable = false
SWEP.AdminSpawnable = true
SWEP.Folder = "weapons/weapon_railgun"
SWEP.CanBuy = { ROLE_TRAITOR }
SWEP.Primary.Reload =... |
Actions = {}
--[[ Functions: Ped ]]--
function Ped:PerformAction(name)
-- Get action.
local action = Actions[name]
if action == nil then return end
-- Trigger event.
TriggerServerEvent("mugging:performAction", self.netId, name)
-- Invoke action.
action(Actions, self, name)
end
function Ped:PlayAnimAction(an... |
function onCreate()
--background boi
makeLuaSprite('back1', 'FarBack', 0, 0)
setLuaSpriteScrollFactor('back1', 0.6, 0.6)
scaleObject('back1', 1.6, 1.6)
addLuaSprite('back1', false)
makeLuaSprite('bg1', 'MainBG', 0, 0)
setLuaSpriteScrollFactor('bg1', 0.6, 0.6)
scaleObject('bg1', 1.6, 1.6)
addLuaSprit... |
function GetRequestedProjectGeneratorVersionOrDefault(default_project_generator_version)
if default_project_generator_version ~= nil then
local default_type = type(default_project_generator_version)
if default_type ~= "number" then
error(string.format("invalid default version for the project generator (type %s)... |
return PlaceObj("ModDef", {
"title", "Show Music Track",
"id", "ChoGGi_ShowMusicTrack",
"steam_id", "2497672357",
"pops_any_uuid", "8f4ffa66-e4fe-45ab-87f5-cc017a10fbf2",
"lua_revision", 1007000, -- Picard
"version", 2,
"version_major", 0,
"version_minor", 2,
"image", "Preview.jpg",
"author", "ChoGGi",
"code... |
minetest.register_node(tm.."vestibule", {
tiles = {"nc_lode_annealed.png"},
drawtype = "nodebox",
sunlight_propagates = true,
paramtype = "light",
node_box = {
type = "fixed",
fixed = {
{0.3125, -0.4375, -0.375, 0.375, 0.5, -0.25}, -- NodeBox1
{-0.375, -0.4375, -0.375, -0.3125, 0.5, -0.25}, -- Node... |
return Def.ActorFrame{
LoadActor("d.txt")..{
OnCommand=function(self)
self:zoom(0.85):wag():effectmagnitude(0,0,10)
end;
},
} |
function executeBot(config, storage, tabs, msgCallback, saveConfigCallback, reloadCallback, websockets)
-- load lua and otui files
local configFiles = g_resources.listDirectoryFiles("/bot/" .. config, true, false)
local luaFiles = {}
local uiFiles = {}
for i, file in ipairs(configFiles) do
local ext = f... |
-- Created by Elfansoer
--[[
Ability checklist (erase if done/checked):
- Scepter Upgrade
- Break behavior
- Linken/Reflect behavior
- Spell Immune/Invulnerable/Invisible behavior
- Illusion behavior
- Stolen behavior
]]
--------------------------------------------------------------------------------
modifier_naga_sire... |
return function()
local result = {}
if not game.active_mods['ElectricVehicles3'] then
return nil
end
return {
categories = {
trains = {
groups = {
trains = {
default_order = 100,
items = {
... |
-- this gets called starts when the level loads.
function start(song) -- arguments, the song name
--showOnlyStrums = true;
end
-- this gets called every frame
function update(elapsed) -- arguments, how long it took to complete a frame
if difficulty == 2 and curBeat > 16 then
showOnlyStrums = true;
... |
local basic_serializer = require "kong.plugins.log_serializers.basic"
local BasePlugin = require "kong.plugins.base_plugin"
local log = require "kong.plugins.httplog.log"
local HttpLogHandler = BasePlugin:extend()
function HttpLogHandler:new()
HttpLogHandler.super.new(self, "httplog")
end
function HttpLogHandler:l... |
local identities = Device2.listIdentities(operation)
if identities.error then
return identities
end
local configIO = require("vendor.configIO")
if configIO and configIO.config_io and identities.devices and next(identities.devices) ~= nil then
local config_io = {
timestamp = require("c2c.utils").getTimestamp(co... |
AddCSLuaFile("shared.lua")
include('shared.lua')
/*-----------------------------------------------
*** Copyright (c) 2012-2019 by DrVrej, All rights reserved. ***
No parts of this code or any of its contents may be reproduced, copied, modified or adapted,
without the prior written consent of the author, unless other... |
local awful = require("awful")
local wibox = require("wibox")
local wifi_card_temp = {}
function wifi_card_temp.init(s, refresh)
return wibox.widget {
{
align = "center",
valign = "center",
widget = awful.widget.watch('bash -c "$HOME/.config/awesome/widgets/wificard_te... |
local tr = aegisub.gettext
script_name = tr"Combine Overlaps"
script_description = tr"Combine subtitle lines whose times are overlapped regardless of tags"
script_author = "domo"
script_version = "1.0"
separator ="\\N"
function combine(subtitles)
dialogue = {}
for i = 1,#subtitles do
if subtitles[i].class == "d... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.