content
stringlengths
0
1.05M
origin
stringclasses
2 values
type
stringclasses
2 values
-- scaffold geniefile for m4 m4_script = path.getabsolute(path.getdirectory(_SCRIPT)) m4_root = path.join(m4_script, "m4") m4_includedirs = { path.join(m4_script, "config"), m4_root, } m4_libdirs = {} m4_links = {} m4_defines = {} ---- return { _add_includedirs = function() includedirs { m4_includedirs } end,...
nilq/small-lua-stack
null
updateDialogs = function(counter) for npc, v in next, dialogs do if v.running then v.length = v.length + counter gameNpcs.updateDialogBox(npc) end end end
nilq/small-lua-stack
null
TEST [[ <!x!> = 1 <?x?>() ]] TEST [[ do <!global!> = 1 end <?global?>() ]] TEST [[ <!x!> = 1 do local x = 1 end <?x?>() ]] TEST [[ x = 1 do local <!x!> = 1 do <!x!> = 2 end <?x?>() end ]] TEST [[ <!x!> = 1 if y then <!x!> = 2 else <!x!> = 3 end print(<?x?>) ]]
nilq/small-lua-stack
null
import 'class' function test.class_basic() -- Given local list = class 'list' function list:add(value) table.insert(self, value) end function list:count(value) class.mtag(self, 'property') return #self end function list:__index(i) if i <= 0 or i > self.c...
nilq/small-lua-stack
null
local skynet = require "skynet" local socket = require "skynet.socket" local tunpack = table.unpack local tconcat = table.concat local select = select local clientfd, addr = ... clientfd = tonumber(clientfd) local hall local function read_table(result) local reply = {} for i = 1, #result, 2 do reply[result[i]] = ...
nilq/small-lua-stack
null
--[[ TheNexusAvenger Wraps a part for use with VR math. --]] local NexusVRCore = require(script.Parent.Parent) local NexusWrappedInstance = NexusVRCore:GetResource("NexusWrappedInstance") local VRPart = NexusWrappedInstance:Extend() VRPart:SetClassName("VRPart") VRPart:CreateGetInstance() --[[ Creates the VR part...
nilq/small-lua-stack
null
--[[ local stylesheet = StylesheetParser.new():init():parsestr([ [ body{ font-family: Century; background: rgb(51,51,51); color: #fff; padding:20px; } .pagina{ width:auto; height:auto; } .linha{ width:auto; padding:5px; height:auto; display:table; } table,td,th { border:1px...
nilq/small-lua-stack
null
-- set mouse and keyboard options function input_init() mo.setVisible(false) ke.setKeyRepeat(.1, .1) end function input_stream(dt) -- stabilize dt local dt = dt < .1 and dt or .1 if ke.isDown("r") and factor_h/factor_w < 2 then camera_rotate(1, dt) elseif ke.isDown("e") and factor_h/factor_w > 1/2 then ...
nilq/small-lua-stack
null
local mod = { } function mod:onButtonPressed() PlayMacro(self.macroName) end function mod:registerWith(buttonEventHandler, targetButton) buttonEventHandler.buttonDownEventTable:registerHandler(targetButton, self, self.onButtonPressed) end function mod:new(targetMacroName) local object = { macroName = tar...
nilq/small-lua-stack
null
function OnUpdate(dt) end function OnStart() v1 = newVec3(5, 1, -2); v2 = newVec3(5, 3, 2); x = v1 * v2; print(x); end
nilq/small-lua-stack
null
require "luabench.utils" local oo = require "loop.base" local TestWarmUp = [[ do local env = setmetatable({}, { __index = _G }) local function warmup(_ENV) local _START_ = _USAGE_() for _ITERATION_ = 1, $repeats do $testcode if _USAGE_()-_START_ > 1 then break end end end pcall(setfenv, warmup, env) ...
nilq/small-lua-stack
null
require "defines" require "gui" require "settings" script.on_init(function() for _, player in pairs(game.players) do gui.init(player) end end) script.on_event(defines.events.on_player_created, function(event) gui.init(game.players[event.player_index]) end) script.on_event(defines.events.on_gui_click, function(e...
nilq/small-lua-stack
null
data.raw["gui-style"]["default"][BPSB.pfx .. "padded-horizontal-flow"] = { type = "horizontal_flow_style", parent = "horizontal_flow", horizontal_spacing = 6, } data.raw["gui-style"]["default"][BPSB.pfx .. "centered-horizontal-flow"] = { type = "horizontal_flow_style", parent = BPSB.pfx .. "padded-...
nilq/small-lua-stack
null
local class = require 'lulz.types.class' local vec_base = require 'lulz.math.vec_base' local function _vec2_data(args) if #args == 0 then return { 0, 0 } end if #args == 2 then return args end assert(#args == 1, 'Invalid argument') assert(type(args[1] == 'table'), 'Invalid argument') local arg = args[1] ...
nilq/small-lua-stack
null
local ResponseBuilder = { ERR_PARSE_ERROR = -32700, -- Error code for "Parse error" error ERR_INVALID_REQUEST = -32600, -- Error code for "Invalid request" error ERR_METHOD_NOT_FOUND = -32601, -- Error code for "Method not found" error ERR_INVALID_PARAMS = -32602, -- Error code for "Invalid params" erro...
nilq/small-lua-stack
null
Storm = { type = "StormController", Properties = { fRainAmount = 0.5, -- amount of rain, range [0..1] vWindDir={0,1,0}, -- wind direction nRandomFrequency=50, -- chance of occurring of generating a random lighting, range [0..100] nSoundDistortionTime=3, -- distortion time for player and AI, in seconds nDis...
nilq/small-lua-stack
null
local app = app local Class = require "Base.Class" local SpottedStrip = require "SpottedStrip" local SourceGroup = require "Source.ExternalChooser.Group" local externals = { INx = { app.getExternalSource("IN1"), app.getExternalSource("IN2"), app.getExternalSource("IN3"), app.getExternalSource("IN4") ...
nilq/small-lua-stack
null
local geaman = require "luagearman.gearman" local ffi = require "ffi" ffi.cdef([[ gearman_argument_t gearman_argument_make(const char *name, const size_t name_length, const char *value, const size_t value_size); ]]) local argment = {} argment.__index = argment --- -- function argment.init() local self = { _argme...
nilq/small-lua-stack
null
require "config" local function debug(...) if (DEBUG) then print(...) end end local function showUsageAndExit(err) local msg = err or "" msg = msg .. "\n" .. [[ Correct usage: lua LUA_FILE [OPTIONS] [LUA_FILE] Any Lua file that returns a JSON either as a string or as a Lua table. [OPTIONS]: ...
nilq/small-lua-stack
null
--!A cross-platform build utility based on Lua -- -- Licensed to the Apache Software Foundation (ASF) under one -- or more contributor license agreements. See the NOTICE file -- distributed with this work for additional information -- regarding copyright ownership. The ASF licenses this file -- to you under the Apach...
nilq/small-lua-stack
null
--[[ Copyright © 2020, Dean James (Xurion of Bismarck) All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of con...
nilq/small-lua-stack
null
--[[ --Copyright (c) 2022 Bruno Sales <baliestri@icloud.com>. Licensed under the MIT license. --See the LICENSE file in the repository root for full license text. --]] package.loaded["aura-theme"] = nil package.loaded["aura-theme.common"] = nil package.loaded["aura-theme.syntaxes"] = nil package.loaded["aura-theme.laz...
nilq/small-lua-stack
null
local function checkStackpos(item, position) position.stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE local thing = getThingFromPos(position) position.stackpos = STACKPOS_TOP_FIELD local field = getThingFromPos(position) return (item.uid == thing.uid or thing.itemid < 100 or field.itemid == 0) e...
nilq/small-lua-stack
null
include "./vendor/premake/premake_customization/solution_items.lua" workspace "Lambda" architecture "x86_64" startproject "Lambda-Editor" configurations { "Debug", "Release", "Dist" } solution_items { ".editorconfig" } flags { "MultiProcessorCompile" } outputdir = "%{cfg.buildcfg}-%{cfg.system...
nilq/small-lua-stack
null
PluginInfo = { Name = "My Plugins~Log Exporter", Version = "1.0", BuildVersion = "1.1.0.0", Id = "05011a7b-a629-42a6-a561-88f141787f06", Author = "Maxx Sanner", Description = "A simple plugin to export the Core's Event Log to a .csv" }
nilq/small-lua-stack
null
--[[ I use this function to remove an entire category from a table based on the category name. function RemoveItemFromTable(tbl, keyname, keyvalue) for i,v in ipairs(tbl) do if (v[keyname] == keyvalue) then -- If the current table category name is the one we are looking for then -- remove the category from ...
nilq/small-lua-stack
null
VERSION = "Prelease" -- clear some globals -- This will break lua code written for other lua runtimes _G.io = nil _G.os = nil _G.math = nil _G.string = nil _G.coroutine = nil _G.jit = nil _G.bit = nil _G.debug = nil _G.table = nil _G.loadfile = nil _G.dofile = nil _G.print = nil -- Load libraries used in this file loc...
nilq/small-lua-stack
null
C_Navigation = {} ---[Documentation](https://wowpedia.fandom.com/wiki/API_C_Navigation.GetDistance) ---@return number distance function C_Navigation.GetDistance() end ---[Documentation](https://wowpedia.fandom.com/wiki/API_C_Navigation.GetFrame) ---@return table? frame function C_Navigation.GetFrame() end ---[Docume...
nilq/small-lua-stack
null
ys = ys or {} ys.Battle.BattleFleetBuffInk = class("BattleFleetBuffInk", ys.Battle.BattleFleetBuffEffect) ys.Battle.BattleFleetBuffInk.__name = "BattleFleetBuffInk" ys.Battle.BattleFleetBuffInk.Ctor = function (slot0, slot1) slot0.super.Ctor(slot0, slot1) end ys.Battle.BattleFleetBuffInk.onAttach = function (slot0, ...
nilq/small-lua-stack
null
-- loads sectors and data/universe/milky_way.xml -- ./start.sh -testuniv -- TODO : VegaStrike/data/units/factions/planets subfolders contain buy/sell infos gUniv_SectorByName = {} gUniv_SystemByPath = {} kJumpTextureName = "jump.texture" RegisterListener("Hook_CommandLine",function () if (gCommandLineSwitches["-t...
nilq/small-lua-stack
null
return {'pique'}
nilq/small-lua-stack
null
local Class = require("lib.Class") local Anim = require("lib.Animation") local Sprite = require("lib.components.Sprite") local StateMachine = require("lib.components.StateMachine") -- added these for bullet generation local Vector2 = require("lib.Vector2") local PLAYER = require('classes.forms.fPLAYER') local Flour =...
nilq/small-lua-stack
null
return { showDesktop = require("customButton.showDesktop"), addTag = require("customButton.addTag"), delTag = require("customButton.delTag"), lockTag = require("customButton.lockTag"), tagmover = require("customButton.tagmover"), }
nilq/small-lua-stack
null
--[[ MIT License Copyright (c) 2021 Michael Wiesendanger 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 use, copy, mod...
nilq/small-lua-stack
null
local ldexp = math.ldexp or function (x, exp) return x * 2.0 ^ exp end return { ldexp = ldexp, }
nilq/small-lua-stack
null
-- Re-written by bc1 using Notepad++ do include "IconHookup" local CivIconHookup = CivIconHookup --========================================================== -- Minor lua optimizations --========================================================== local math = math local BUTTONPOPUP_DEMOGRAPHICS = ButtonPopupTypes.BU...
nilq/small-lua-stack
null
return { ['windowcontrol'] = { ['functions'] = { ['bringToFront'] = true, ['destroy'] = true, ['getName'] = true, ['getPosition'] = true, ['getScrollState'] = true, ['getSize'] = true, ['getTabTarget'] = true, ['isEnabled'] = true, ['isReadOnly'] = true, ['isVisible'] = true, ['onCli...
nilq/small-lua-stack
null
local json = require('Modules/json') function debug(s) if debug_mode then multitext.append = '['..os.date('%H:%M:%S')..']: ' .. s end end --String Splitting for Adding Lists (Found at https://stackoverflow.com/questions/1426954/split-string-in-lua) function split (inputstr, sep) if(inputstr ~= '' ...
nilq/small-lua-stack
null
if Unit == nil then Unit = class({}) end Unit.UnitTable = dofile("config_unit") function Unit:GetUnitNameByID(id) return self.UnitTable[id] end function Unit.new(npcclass, position, owner, foodCost, goldCost) local self = Unit() self.owner = owner self.player = owner.player self.npcclass = np...
nilq/small-lua-stack
null
-- Variables local event_exitWebsite = "test_exitWebsiteEvent" local event_waitForLoad = "test_waitForLoadEvent" local noQuitPrefix = ":fn2:" -- -------- Override os.pullEvent local oldpullevent = os.pullEvent local oldEnv = {} local env = {} local api = {} local pullevent = function(data) while true do -- P...
nilq/small-lua-stack
null
function root(base, n) if base < 2 then return base end if n == 0 then return 1 end local n1 = n - 1 local n2 = n local n3 = n1 local c = 1 local d = math.floor((n3 + base) / n2) local e = math.floor((n3 * d + base / math.pow(d, n1)) / n2) while c ~= d and c ~= e do c = d ...
nilq/small-lua-stack
null
---@class lstg.mbg.Execution local M = {} --local M = class('lstg.mbg.Execution') local Math = require('game.mbg._math') local MathHelper = Math local float = { Parse = function(s) return tonumber(s) end } function M:ctor() self.parentid = 0 self.id = 0 self.change = 0 self.changetype = 0 self....
nilq/small-lua-stack
null
local api = vim.api local fn = vim.fn local comment = require("translate.util.comment") local utf8 = require("translate.util.utf8") local M = {} local L = {} function M.get(args, is_visual) if args.comment then return comment.get_range() elseif is_visual then return L.get_visual_selected() ...
nilq/small-lua-stack
null
require "Polycode/EventDispatcher" class "Resource" (EventDispatcher) Resource.RESOURCE_TEXTURE = 0 Resource.RESOURCE_MATERIAL = 1 Resource.RESOURCE_SHADER = 2 Resource.RESOURCE_PROGRAM = 3 Resource.RESOURCE_MESH = 5 Resource.RESOURCE_CUBEMAP = 6 Resource.RESOURCE_SPRITE = 7 Resource.RESOURCE_ENTITY_INSTANCE = 8 Reso...
nilq/small-lua-stack
null
local PLUGIN = PLUGIN; Clockwork.setting:AddCheckBox("Framework", "Enable HUD clock.", "cwHudClock", "Whether or not to enable the hud clock.");
nilq/small-lua-stack
null
--[[ LUA TUTORIAL --]] --[[ CHAPTER 6: OPERATORS --]] a = 21 b = 10 c = a + b print("Line 1 - Value of c is ", c) c = a - b print("Line 2 - Value of c is ", c) c = a * b print("Line 3 - Value of c is ", c) c = a / b print("Line 4 - Value of c is ", c) c = a % b print("Line 5 - Value of c is ", c) c = a^2 print(...
nilq/small-lua-stack
null
-- Copyright (c) 2015 Phil Leblanc -- see LICENSE file ------------------------------------------------------------------------ --[[ === test_hecsv - csv unit tests ]] local he = require 'he' local csv = require 'he.csv' local parse = csv.parse -- assert(parse(''):equal{{""}}) assert(parse(','):equal{{"", ""}...
nilq/small-lua-stack
null
-- helper functions --------------------------------------------------------------------- local function GetSongDirs() local songs = SONGMAN:GetAllSongs() local list = {} for item in ivalues(songs) do list[item:GetSongDir()]={title = item:GetMainTitle(), song = item} end return list end --- Get ...
nilq/small-lua-stack
null
NginxRequestLoggerHelper = {} function NginxRequestLoggerHelper.concat_table_keys(input_table, separator) local keys_table = {} for key, _ in pairs(input_table) do table.insert(keys_table, key) end return table.concat(keys_table, separator) end function NginxRequestLoggerHelper.error_if_param_...
nilq/small-lua-stack
null
return {'ofschoon'}
nilq/small-lua-stack
null
return { tllack = { acceleration = 1.92, brakerate = 7.2, buildcostenergy = 8357, buildcostmetal = 635, builddistance = 200, builder = true, buildpic = "tllack.dds", buildtime = 20000, canguard = true, canmove = true, canpatrol = true, canreclamate = 1, canstop = 1, category ...
nilq/small-lua-stack
null
--------------------------------------------------------------------------------- -- Local utility functions --------------------------------------------------------------------------------- local function wrapIndent(text, size, pad) text = pad .. text local p = 0 while true do local q = text:find(" ", size+...
nilq/small-lua-stack
null
--[[ INFO ]]-- --[[ Name: AutoLights Version: 1.1 Date: 11/08/2013 Author: Alex Crawford Notes: A very simple program that will check the time in Minecraft, and automatically activate any lights that are hooked up to the computer, via redstone, at certain times, and deactivates them at certain times, and print so...
nilq/small-lua-stack
null
-- Natural Selection League Plugin -- Source located at - https://github.com/xToken/NSL -- lua/NSL/misc/server.lua -- - Dragon local kNSLTag = "nsl" -- Supposedly this still not syncronized. local function SetupClientRatesandConfig(client) -- Confirm we scanned the defaults already if GetNSLDefaultPerfValue("Interp...
nilq/small-lua-stack
null
----------------------------------- -- Area: Palborough Mines -- NM: Qu'Vho Deathhurler ----------------------------------- function onMobDeath(mob, player, isKiller) end function onMobDespawn(mob) UpdateNMSpawnPoint(mob:getID()) mob:setRespawnTime(math.random(3600, 4200)) end
nilq/small-lua-stack
null
--[[ Copyright (c) 2016-present, Facebook, Inc. All rights reserved. This source code is licensed under the BSD-style license found in the LICENSE file in the root directory of this source tree. An additional grant of patent rights can be found in the PATENTS file in the same directory. ]]-- local tnt ...
nilq/small-lua-stack
null
-- Created by LuaView. -- Copyright (c) 2017, Alibaba Group. All rights reserved. -- -- This source code is licensed under the MIT. -- For the full copyright and license information,please view the LICENSE file in the root directory of this source tree. --工具包引入 require "kit/lv_kit" -- 变量定义 local s_width, s_height = Sy...
nilq/small-lua-stack
null
local NUMBER_EPSILON = 0.00000000000001 -- create a table with values :from until :to local function number_range(from, to, step) local t = {} for value = from, to, step do t[#t + 1] = value end return t end -- create a table with values char of :from to char of :to local function string_range(f...
nilq/small-lua-stack
null
local skynet = require "skynet" local actuator = require "logic.http.actuator" local logger = require "logger" local dispatch = {} for key, value in pairs(actuator) do if dispatch[key] ~= nil then logger.error(string.format("dispatch[%s] ~= nil : ", key)) end dispatch[key] = value end return actuat...
nilq/small-lua-stack
null
if not jit then error("Coudn't find LuaJIT") end if not pcall(require,"ffi") then error("Couldn't find FFI") end local love = love io.stdout:setvbuf("no") m68k = require("68k") local cpu = m68k.make68k() function love.load() -- cpu:load() end function love.update(dt) -- cpu:update() -- TODO end function lo...
nilq/small-lua-stack
null
RCT.FrameStyleCompactList = { } for k, v in pairs(RCT.FrameStyleBase) do RCT.FrameStyleCompactList[k] = v end RCT.FrameStyleCompactList.__index = RCT.FrameStyleCompactList setmetatable(RCT.FrameStyleCompactList, { __index = RCT.FrameStyleBase, __call = function(cls, ...) local self = setmetatable({}, cls) self:n...
nilq/small-lua-stack
null
local bufresize = require("bufresize") bufresize.setup({ register = { keys = {}, trigger_events = { "BufWinEnter", "WinEnter" }, }, resize = { keys = {}, trigger_events = { "VimResized" }, }, })
nilq/small-lua-stack
null
ITEM.name = "Низкий шкаф с книгами" ITEM.desc = "Обыкновенный низкий шкаф из дерева" ITEM.model = "models/aoc_furniture/shelf04.mdl" ITEM.width = 3 ITEM.height = 3
nilq/small-lua-stack
null
ys = ys or {} slot1 = class("BattleEnmeyHpBarView") ys.Battle.BattleEnmeyHpBarView = slot1 slot1.__name = "BattleEnmeyHpBarView" slot1.Ctor = function (slot0, slot1) slot0._monsterTF = slot1 slot0.orgPos = slot1.anchoredPosition slot0.HidePos = slot0.orgPos + Vector2(0, 100) slot0._hpBarTF = slot1:Find("hpbar") s...
nilq/small-lua-stack
null
local utils = require "typesystem_utils" -- Define a data type with all its qualifiers function defineDataType( node, contextTypeId, typnam, descr) local typeId = typedb:def_type( contextTypeId, typnam) local refTypeId = typedb:def_type( contextTypeId, typnam .. "&") if typeId <= 0 or refTypeId <= 0 then ...
nilq/small-lua-stack
null
--[[ Visualization module for glyphnet Copyright 2016 Xiang Zhang --]] local class = require('pl.class') local torch = require('torch') local Scroll = require('scroll') local Visualizer = class() -- Constructor -- config: configuration table -- .width: (optional) width of scrollable window -- .scale: (option...
nilq/small-lua-stack
null
--- KeyValue utils. -- @module invokation.dota2.kv local m = require("moses") local stringx = require("pl.stringx") local ENUMS = require("invokation.const.enums") local M = {} local function warn(fmt, ...) if not IsInToolsMode() then return end print("(WARNING) [kv] " .. fmt:format(...)) end --- Transfo...
nilq/small-lua-stack
null
--[[ File name: backpack.lua Description: save backpack items between places Author: oldmilk --]] local module = {} local ridge = require(game.ReplicatedStorage:WaitForChild("modules").ridge) local extra = require(game.ReplicatedStorage:WaitForChild("modules").extra) local itemLoader = require(game.Replicat...
nilq/small-lua-stack
null
local Bottle, parent = torch.class("nn.Bottle", "nn.Decorator") local unpack = unpack or table.unpack function Bottle:__init(module, nInputDim, nOutputDim) parent.__init(self, module) self.nInputDim = nInputDim or 2 self.nOutputDim = nOutputDim or self.nInputDim self.dimDelta = self.nInputDim - self.nOutpu...
nilq/small-lua-stack
null
-- Code created by Kwik - Copyright: kwiksher.com 2016, 2017, 2018, 2019, 2020 -- Version: -- Project: Tiled -- local _M = {} -- local _K = require "Application" local composer = require("composer") local Navigation = require("extlib.kNavi") -- local xFactor = display.contentWidth/1920 local yFactor = display.contentH...
nilq/small-lua-stack
null
function love.conf(game) game.title = "Minesweeper" game.version = "11.1" game.console = false game.window.width = 200 game.window.height = 200 game.window.fullscreen = false game.window.fullscreentype = "exclusive" game.window.vsync = false game.modules.joystick = false end
nilq/small-lua-stack
null
FACTION.name = "Kartooshka Police Force" FACTION.description = "The primary Police Force of Kartooshka." FACTION.color = Color(255, 200, 100, 255) FACTION.models = { "models/devcon/mrp/act/ranger_2.mdl", "models/nikout/metro_ll/spartan1.mdl", "models/nikout/metro_ll/spartan1_light.mdl", } FACTION.isGloballyRe...
nilq/small-lua-stack
null
----------------------------------- -- Area: Lower Jeuno -- NPC: Garnev -- Starts and Finishes Quest: Deal with Tenshodo -- !pos 30 4 -36 245 ----------------------------------- local ID = require("scripts/zones/Lower_Jeuno/IDs") require("scripts/globals/settings") require("scripts/globals/titles") require("scripts/gl...
nilq/small-lua-stack
null
name = "Damage Indicators" description = "Baaaaam Baam. Take that, nasty brute of hell!" author = "s1m13" version = "0.5.1" dont_starve_compatible = true reign_of_giants_compatible = true shipwrecked_compatible = true api_version = 6 icon_atlas = "damageindicators.xml" icon = "damageindicators.tex" forumthread = "/topi...
nilq/small-lua-stack
null
---@diagnostic disable: undefined-global -- Success function Success() print("======> success") end -- Failed function Failed(error) print("======> failed:", error) end -- Actions Actions = { function(data) print('Data ======> ', data) stdlib:DataToMqttServer('OUTEND_58fa7728-b82e-4124-838...
nilq/small-lua-stack
null
--- -- @module Line local Line = {} -- http://wiki.roblox.com/index.php?title=User:EgoMoose/Articles/3D_line_intersection -- @param a Point -- @param r Offset from a function Line.Intersect(a, r, b, s) local q = a - b; local dotqr = q:Dot(r); -- same as: r:Dot(q) local dotqs = q:Dot(s); -- same as: s:Dot(q) loca...
nilq/small-lua-stack
null
-- Copyright (C) 2012 Nicholas Carlson -- -- 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 use, copy, modify, merge, publi...
nilq/small-lua-stack
null
if not modules then modules = { } end modules ["page-mix"] = { version = 1.001, comment = "companion to page-mix.mkiv", author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", copyright = "PRAGMA ADE / ConTeXt Development Team", license = "see context related readme files" } -- inserts.getname(name...
nilq/small-lua-stack
null
require( "iuplua" ) require( "iupluacontrols" ) require( "iuplua_pplot" ) plot = iup.pplot{TITLE = "A simple XY Plot", MARGINBOTTOM="35", MARGINLEFT="35", AXS_XLABEL="X", AXS_YLABEL="Y" } iup.PPlotBegin(plo...
nilq/small-lua-stack
null
local S = mobs.intllib -- Quest Npc by TenPlus1 and APercy --[[ EXAMPLE: {["greetings"]='Welcome! Can I see your glass?',["default:glass"]={["text"]='Great! Good forged glass',["open"]={["x"]='0',["y"]=0,["z"]=0,["time"]=10},},} the "open" instruction: ["mod:item"]={["text"]="text",["open"]={["x"]='0',["y"]=0,["z...
nilq/small-lua-stack
null
roomReport= { name="roomReport",type=0,typeName="View",time=0,x=0,y=0,width=1280,height=720,visible=1,nodeAlign=kAlignTopLeft,fillParentWidth=1,fillParentHeight=1, { name="touchLayer",type=0,typeName="Image",time=102189444,x=0,y=0,width=1280,height=720,nodeAlign=kAlignTopLeft,visible=1,fillParentWidth=1,fillParentH...
nilq/small-lua-stack
null
local M = {} local api = vim.api local fn = vim.fn local cmd = vim.cmd local qfs = require('bqf.qfwin.session') local wpos = require('bqf.wpos') local config = require('bqf.config') local auto_resize_height local POS local function fix_default_qf(qwinid, pwinid, qf_type, qf_pos) local qf_win = fn.win_id2win(qwin...
nilq/small-lua-stack
null
--- @ignore local base = "pure_skin_element" HUDELEMENT.Base = base HUDELEMENT.togglable = true DEFINE_BASECLASS(base) if CLIENT then local pad = 14 local element_margin = 6 local material_no_team = Material("vgui/ttt/dynamic/roles/icon_no_team") local material_watching = Material("vgui/ttt/watching_icon") ...
nilq/small-lua-stack
null
-- From https://github.com/nvim-treesitter/playground -- Copyright 2021 -- licensed under the Apache License 2.0 -- See playground.LICENSE-APACHE-2.0 local highlighter = require("vim.treesitter.highlighter") local ts_utils = require "nvim-treesitter.ts_utils" local M = {} function M.get_treesitter_hl(cursor) local...
nilq/small-lua-stack
null
----------------------------------- -- Area: Bastok Markets (S) -- NPC: Heumila -- Type: Past Event Watcher -- !zone 87 -- !pos ----------------------------------- function onTrade(player,npc,trade) end; function onTrigger(player,npc) player:startEvent(0); end; function onEventUpdate(player,csid,option) end; f...
nilq/small-lua-stack
null
local AtlasLoot = _G.AtlasLoot local GUI = AtlasLoot.GUI local SoundFrame = {} AtlasLoot.GUI.SoundFrame = SoundFrame local AL = AtlasLoot.Locales local ClickHandler = AtlasLoot.ClickHandler -- lua local str_format = string.format local min, floor = min, floor local ipairs = ipairs -- //\\ local SCROLL_STEP = 1 local ...
nilq/small-lua-stack
null
local _M = require('resty.openssl.bio') describe('OpenSSL BIO', function() describe('.new', function() it('returns cdata', function() assert.equal('cdata', type(_M.new())) end) end) describe(':write', function() it('writes data to bio', function() local bio = _M.new() local str = '...
nilq/small-lua-stack
null
gspotify = gspotify or {} -- The client ID of the Spotify app (the secret will never be public) gspotify.ClientID = "5b94f2519b444963b0a05f93090a4c99" include("authorization.lua") gspotify.RandomCharSet = {} local charset = gspotify.RandomCharSet do for c = 48, 57 do table.insert(charset, string.char(c))...
nilq/small-lua-stack
null
add_rules("mode.debug", "mode.release") -- set cross-compliation platform set_plat("cross") set_arch("arm") -- lock requires set_policy("package.requires_lock", true) -- add library packages -- for testing zlib/xmake, libplist/autoconf, libogg/cmake add_requires("zlib", "libogg", {system = false}) if is_host("macos...
nilq/small-lua-stack
null
local transform_mod = require('telescope.actions.mt').transform_mod local actions = require('telescope.actions') local action_state = require('telescope.actions.state') function delete_bookmark(entry) vim.fn['bm_sign#del'](entry.filename, tonumber(entry.value.sign_idx)) vim.fn['bm#del_bookmark_at_line'](entry...
nilq/small-lua-stack
null
function OnInit(data) this.acquire_events = true this.PlaySound() data.playing = true end function OnUpdate(data, delta) end function OnEvent(data, event, action) if event == EVT_KEY_PRESSED then if action == KEY_SPACE then if data.playing then this.PauseSound() ...
nilq/small-lua-stack
null
local objecteffect = import("..common.NEObjectActionEffect") local uianimationex = import("..ui.UIAnimationEx") local SuccessView = {}; function SuccessView:showSuccess(parent, cb) local currentChapterID = app.currentChapterID local currentChapterIndex = app.currentChapterIndex local Anim_Png ...
nilq/small-lua-stack
null
require('nn') local MeanGrid, parent = torch.class('nn.MeanGrid', 'nn.Module') function MeanGrid:__init(N, dim_size, nInputDim) self.grid = torch.range(1, N):resize(N, 1):repeatTensor(1, dim_size) self.nInputDim = nInputDim parent.__init(self) end function MeanGrid:updateOutput(input) if self.nInputDim and in...
nilq/small-lua-stack
null
--[[ © CloudSixteen.com do not share, re-distribute or modify without permission of its author (kurozael@gmail.com). Clockwork was created by Conna Wiles (also known as kurozael.) http://cloudsixteen.com/license/clockwork.html --]] Clockwork.kernel:IncludePrefixed("shared.lua") -- Called when the entity is drawn...
nilq/small-lua-stack
null
--[[ LuCI - Lua Configuration Interface Copyright 2008 Steven Barth <steven@midlink.org> Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at h...
nilq/small-lua-stack
null
--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
require 'cunn' require 'optim' -- If fbcunn and fbnn exists we'll do a profile of DataParallel local profileDp = pcall(function() require 'fbcunn'; require 'fbnn' end) local baseGpu = 1 -- First GPU to use local numGpus = cutorch.getDeviceCount() torch.setdefaulttensortype('torch.DoubleTensor') torch.setnumthreads(8...
nilq/small-lua-stack
null
local packer = require("packer") local use = packer.use local packer_path = vim.fn.stdpath("data").."/site/pack/packer/start/" describe("Packer use tests", function() after_each(function() packer.reset() end) it("should set the correct install path", function () local spec = {"test/plugin1"} packer....
nilq/small-lua-stack
null
require "setup" local info = artal.newPSD("cases/unicode_names.psd", "info") deepAssert({ name = "very long ☭ unicode name with extra characters wow is this long"}, info[1])
nilq/small-lua-stack
null
-- Copyright © 2018 Daniel Pittman <daniel@rimspace.net> -- See LICENSE for more details. SlippyCheeze = SlippyCheeze or {} if not SlippyCheeze.ReadItOnce then SlippyCheeze.ReadItOnce = { IS_RELEASE_VERSION = false, NAME="SlippyCheezeReadItOnce", DISPLAY_NAME = "|c798BD2ReadItOnce|r", -- for double-t...
nilq/small-lua-stack
null