content stringlengths 0 1.05M | origin stringclasses 2
values | type stringclasses 2
values |
|---|---|---|
----------------------------
-- @file utils.lua
-- @brief
-- @author yingx
-- @date 2019-08-15
----------------------------
--执行随机种子
math.randomseed(ngx.now())
local invalid_mobile_id = {
["000000000000000"] = 1,
["111111111111111"] = 1,
["012345678912345"] = 1,
["null"] = 1,
["null_imei"] = 1,
... | nilq/small-lua-stack | null |
#!/usr/bin/env lua
local io = require("io")
local from, tover = ...
if not from or not tover then
print("Format: prepareNextRelease.lua <from-tag> <tover-tag>")
return
end
local f = assert(io.open("docs/ReleaseNotes-" .. tover .. ".txt", "w"))
local headLine = "luajson v" .. tover .. " Release Notes"
f:write(headLin... | nilq/small-lua-stack | null |
local sonic_screwdriver_max_charge = 200000
local S = technic.getter
technic.register_power_tool("technic:sonic_screwdriver", sonic_screwdriver_max_charge)
-- screwdriver handler code reused from minetest/minetest_game screwdriver @a9ac480
local ROTATE_FACE = 1
local ROTATE_AXIS = 2
local function nextrange(x, max)... | nilq/small-lua-stack | null |
-- VARIABLE INITIALIZATION
local thismod = minetest.get_current_modname()
local modpath = minetest.get_modpath(thismod)
old_expansion = {
growNodes = {"default:dirt","default:dirt_with_grass","default:dirt_with_snow"},
growthSources = {},
schems = {},
types = { logs = {"cinnamon", "paperbark"}}
}
old_... | nilq/small-lua-stack | null |
-- Add the path to the draggin lua files.
-- When building for release you won't/can't do it this way. You should copy the src/draggin
-- directory into your program's main directory.
package.path = package.path .. ';' .. os.getenv("DRAGGIN_FRAMEWORK") .. '/src/?.lua'
| nilq/small-lua-stack | null |
kata = {}
function kata.save(sizes, hd)
local sum = 0
for index = 1, #sizes do
sum = sum + sizes[index]
if sum > hd then
return index - 1
end
end
return #sizes
end
return kata | nilq/small-lua-stack | null |
--[[ Lua --]]
local version, name;
name = "lua_playground";
version = nil;
print(name) | nilq/small-lua-stack | null |
local menu_service = require('services/menu')
local net_service = require('services/net')
return function()
menu_service.load('main-menu')
net_service.disconnect()
end
| nilq/small-lua-stack | null |
local json = require("misc.libs.json") -- JSON Library
-- Write command to file; then send signal to python script
local function focusTab(id)
awful.spawn.with_shell('echo "focusTab ' .. id .. '" >> /tmp/ff-tabs-input; kill -s SIGUSR1 $(pgrep server.py)')
end
local function removeTab(id)
awful.spawn.with_shell('ech... | nilq/small-lua-stack | null |
--[[
Replacement tool for creative building (Mod for MineTest)
Copyright (C) 2013 Sokomine
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the Lice... | nilq/small-lua-stack | null |
local presetMessages = {
["SIGN"] = "You have joined the league!",
["ASIGN"] = "You have already joined the league!",
["INPROG"] = "The league is already in progress.",
}
local player = Game.GetLocalPlayer()
function OnReceivedMessage(message, color)
if presetMessages[message] ~= nil then message = presetMes... | nilq/small-lua-stack | null |
ITEM.name = "Marijuana Joint"
ITEM.description = "A rolled up cigarette featuring marijuana instead of tobacco."
ITEM.model = Model("models/mosi/fallout4/props/junk/cigar.mdl")
ITEM.category = "Drugs"
ITEM.width = 1
ITEM.height = 1
ITEM.chance = 55
ITEM.functions.Consume = {
OnRun = function(itemTable)
local clien... | nilq/small-lua-stack | null |
local Modules = game:GetService("Players").LocalPlayer.PlayerGui.AvatarEditorInGame.Modules
local Rodux = require(Modules.Packages.Rodux)
local IncrementTryOnCharacterModelVersion =
require(Modules.AvatarExperience.Catalog.Actions.IncrementTryOnCharacterModelVersion)
return Rodux.createReducer(0, {
[IncrementTryOnC... | nilq/small-lua-stack | null |
--Point
--author: SukaiPoppuGo
if not _POSAPI and not os.loadAPI("/api/pos/turtle.lua") then
error("Pos API required", 2)
return
end
if not utils then os.loadAPI("/api/utils.lua") end
-- shortcuts
local _abs = math.abs
local _pow = math.pow
local _max = math.max
local _min = math.min
local _sqrt = math.sqrt
local ... | nilq/small-lua-stack | null |
if matches[2] then
dx.mining:goProspect(matches[3])
else
dx.mining:goProspect()
end | nilq/small-lua-stack | null |
vim.g.nvim_tree_icons = {
default = "",
symlink = "",
git = {
unstaged = "",
staged = "S",
unmerged = "",
renamed = "➜",
deleted = "",
untracked = "U",
ignored = "◌",
},
folder = {
default = "",
open = "",
empty = "",
empty_open = "",
symlink = "",
}... | nilq/small-lua-stack | null |
local getChildrenArrayByLevelIndex
getChildrenArrayByLevelIndex = function (id, level, index, limit, offset, children, result)
level = level - 1
-- current level = maxlevel - level
local value = redis.call('get', prefix .. id)
if not value then
return result
end
local list = cmsgpack.unpack(value)
fo... | nilq/small-lua-stack | null |
RECIPE.name = "Manhack"
RECIPE.description = "recipeManhackDesc"
RECIPE.category = "Assembly"
RECIPE.model = "models/manhack.mdl"
RECIPE.requirements = {
["manhack_gib01"] = 1,
["manhack_gib02"] = 1,
["manhack_gib03"] = 1,
["manhack_gib04"] = 1,
["manhack_gib05"] = 2,
}
RECIPE.results = {
["manhack"] = 1
}
RECI... | nilq/small-lua-stack | null |
local EventRegistry = {}
local EventRegistry_mt = { __index = EventRegistry }
function EventRegistry:Create(frame)
local event_registry = {}
setmetatable(event_registry, EventRegistry_mt)
event_registry:Initialize(frame)
return event_registry
end
function EventRegistry:Initialize(frame)
self.frame = CreateFrame(... | nilq/small-lua-stack | null |
--[[
Strict variable declarations for Lua 5.1, 5.2 & 5.3
Copyright(C) 2014-2021 Gary V. Vaughan
Copyright(C) 2010-2014 Reuben Thomas <rrt@sc3d.org>
Copyright(C) 2006-2011 Luiz Henrique de Figueiredo <lhf@tecgraf.puc-rio.br>
]]
--[[--
Diagnose uses of undeclared variables.
All variables(including functions!) must... | nilq/small-lua-stack | null |
GM.Name = "PeterPVP"
GM.Author = "Peter Soboyejo<thepcmrtim@gmail.com>"
GM.Email = "thepcmrtim@gmail.com"
GM.Website = "http://petersoboyejo.com/"
team.SetUp( 0, "Blue", Color(0, 0, 255) )
team.SetUp( 1, "Red", Color(255, 0, 0) )
function GM:Initialize() -- called when the gamemode is first started
self.BaseClass.... | nilq/small-lua-stack | null |
local assets =
{
Asset("ANIM", "anim/evergreen_new.zip"), --build
Asset("ANIM", "anim/evergreen_new_2.zip"), --build
Asset("ANIM", "anim/evergreen_tall_old.zip"),
Asset("ANIM", "anim/evergreen_short_normal.zip"),
Asset("ANIM", "anim/dust_fx.zip"),
Asset("SOUND", "sound/forest.fsb"),
}
local pre... | nilq/small-lua-stack | null |
-- this file is outdated now, I think.
-- colors for each theme should live somewhere else because I'm nutty like that.
themeColors = {
Player = {
P1 = HSV(38,0.8,1),
P2 = HSV(195,0.8,1),
},
Difficulty = {
Beginner = color("#ff32f8"), -- light cyan
Easy = color("#2cff00"), -- green
Medium = color("#... | nilq/small-lua-stack | null |
-- Timing is a namespace of functions dealing with time. Timing.OnUpdate is likely to be
-- the most familiar timer for any newbies.
--
-- local r=Timing.OnUpdate(print, "This is printed every frame!");
-- r() -- Remove the timer
--
-- Timing also lets you call a function periodically. All periods in Timing are specifi... | nilq/small-lua-stack | null |
local ipairs=ipairs
local type=type
local print=print
local naughty=require('naughty')
module('z.debug')
function print_table(t)
for i,element in ipairs(t)do
print(i.." type:"..type(element))
end
end
function dump(e)
naughty.notify({text="type"..type(e)})
print ("type"..type(e).."\n")
-- i... | nilq/small-lua-stack | null |
-- @docconsts @{
AnchorNone = 0
AnchorTop = 1
AnchorBottom = 2
AnchorLeft = 3
AnchorRight = 4
AnchorVerticalCenter = 5
AnchorHorizontalCenter = 6
LogDebug = 0
LogInfo = 1
LogWarning = 2
LogError = 3
LogFatal = 4
MouseFocusReason = 0
KeyboardFocusReason = 1
ActiveFocusReason = 2
OtherFocusReason = 3
AutoFocusNone = ... | nilq/small-lua-stack | null |
--------------------------------------------------
-- =============== Autorun File ===============
-- *** Copyright (c) 2012-2017 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... | nilq/small-lua-stack | null |
package.path = "../?.lua;../webtersen/?.lua;" .. package.path
print("LUA MODULES:\n",(package.path:gsub("%;","\n\t")))
local js = require "js"
local window = js.global
local lut_mod = require 'tersen.lut'
local trace_mod = require 'tersen.trace'
local tersen_mod = require 'tersen.tersen'
local function elem(name)
... | nilq/small-lua-stack | null |
local LOCAL_PLAYER = Game.GetLocalPlayer()
function Tick()
for _, ability in ipairs(LOCAL_PLAYER:GetAbilities()) do
ability:Activate()
Task.Wait(1)
end
end
| nilq/small-lua-stack | null |
local skynet = require "skynet"
local i = 10
skynet.start(function()
skynet.fork(function ( )
while true do
skynet.sleep(100)
skynet.error("hello bo222y",i)
i=i+1
end
end)
skynet.dispatch("lua", function(_,_,msg)
skynet.sleep(100)
--skynet.ret(skynet.pack(msg))
end)
end)
| nilq/small-lua-stack | null |
local sadb
local AceConfigDialog = LibStub("AceConfigDialog-3.0")
local AceConfig = LibStub("AceConfig-3.0")
local L = LibStub("AceLocale-3.0"):GetLocale("SoundAlerter")
local self, SoundAlerter = SoundAlerter, SoundAlerter
local function initOptions()
if SoundAlerter.options.args.general then
return
end
SoundAle... | nilq/small-lua-stack | null |
require('constants')
require('stdlib/table')
local Entity = require('stdlib/entity/entity')
-- Split a string in to tokens using whitespace as a seperator.
local function split( str )
local result = {}
for sub in string.gmatch( str, "%S+" ) do
table.insert( result, sub )
end
return result
end
... | nilq/small-lua-stack | null |
return {
{
effect_list = {
{
type = "BattleBuffFixRange",
trigger = {
"onAttach"
},
arg_list = {
bulletRange = 75,
weaponRange = 75,
index = {
1
}
}
},
{
type = "BattleBuffAddAttr",
trigger = {
"onAttach"
},
arg_list = {
attr = "da... | nilq/small-lua-stack | null |
--//////////////////////////////////////////////////////
-- Name: Operation Clear Field Escalation - Navy Module
-- Author: Surrexen ༼ つ ◕_◕ ༽つ (づ。◕‿◕。)づ
--//////////////////////////////////////////////////////
--////MAIN
trigger.action.outSound('Background Chatter.ogg')
CarrierPhase = 1
---------------------... | nilq/small-lua-stack | null |
aliveai_threats.fort={furnishings={"aliveai_threats:toxic_tank","aliveai_threats:labbottle_containing","aliveai_threats:timed_bumb","aliveai_threats:timed_nitrobumb","aliveai_threat_eletric:timed_ebumb","aliveai_threats:landmine","aliveai_threats:deadlock","aliveai_massdestruction:nuclearbarrel"},}
minetest.register... | nilq/small-lua-stack | null |
local L = LibStub("AceLocale-3.0"):NewLocale("Skada", "enUS", true)
L["Include set"] = true
L["Include set name in title bar"] = true
L["Disable"] = true
L["Profiles"] = true
L["Hint: Left-Click to toggle Skada window."] = true
L["Shift + Left-Click to reset."] = true
L["Right-click to open menu"] = true
L["Options"] ... | nilq/small-lua-stack | null |
-- ~~~~~~~~
-- hud.lua
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- In-game HUD elements for Mars Lander
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
local HUD = {}
HUD.font = love.graphics.newFont(20)
-- TODO: Create variables in a init or create function
-- Fuel indicator elements
HUD.fuel = {x = 20, y = 20, width = SC... | 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 |
package.path = package.path .. ";data/scripts/lib/?.lua"
package.path = package.path .. ";data/scripts/?.lua"
include ("galaxy")
include ("randomext")
include ("stringutility")
include ("player")
include ("relations")
ESCCUtil = include("esccutil")
local Placer = include ("placer")
local AsyncPirateGenerator = inclu... | nilq/small-lua-stack | null |
-- Mixes in a large suite of iteration functions to the specified library. This
-- mixin allow you to interact with various iterable types with a healthy baseline
-- of functionality.
--
-- Specifically, this mixin adds a set of generic accessors and modifiers, insertion
-- and removal functions, cloning, updating, and... | nilq/small-lua-stack | null |
function BadCoderz.ReadReport()
local len = net.ReadUInt(16)
local data = net.ReadData(len)
local json = util.Decompress(data)
local table = util.JSONToTable(json)
return table
end
net.Receive("BadCoderz_status_request", function()
local codeSmellsScan = net.ReadBool()
local compiledFuncsScan = net.ReadBool()
... | nilq/small-lua-stack | null |
Propagation = {
Unhandled = 0,
Handled = 1
}
-- Represents the buttons on the gameboy system
Button = {
Right = 0,
Left = 1,
Up = 2,
Down = 3,
A = 4,
B = 5,
Select = 6,
Start = 7
}
-- Virtual keycodes for keyboard input
Key = {
Unknown = 0x00,
Backspace = 0x08,
Tab = 0x09,
Clear = 0x0C,
Enter = 0x0D,
... | nilq/small-lua-stack | null |
-- deque.lua: tests for double-ended queue wrapper
-- This file is a part of lua-nucleo library
-- Copyright (c) lua-nucleo authors (see file `COPYRIGHT` for the license)
dofile('lua-nucleo/strict.lua')
dofile('lua-nucleo/import.lua')
local make_suite = select(1, ...)
assert(type(make_suite) == "function")
math.rand... | nilq/small-lua-stack | null |
local localization = {
mod_description = {
en = "Press \"r\" over inventory items to mark as a favorite.",
ru = "Нажатие \"r\" над вещами в инвентаре добавляет их в избранное.",
},
help_message_1 = {
en = "----------FILTERING AND FAVORITES----------",
ru = "----------ФИЛЬТРАЦИЯ И ИЗБРАННОЕ----------",
},
h... | nilq/small-lua-stack | null |
local AddonName, AddonTable = ...
AddonTable.cooking = {
-- Ingredients
43011,
43012,
43013,
43501,
}
| nilq/small-lua-stack | null |
firstSpawn = true
SetManualShutdownLoadingScreenNui(true)
local weapons =
{
"weapon_Knife",
"weapon_Nightstick",
"weapon_Hammer",
"weapon_Bat",
"weapon_GolfClub",
"weapon_Crowbar",
"weapon_Bottle",
"weapon_SwitchBlade",
"weapon_Pistol",
"weapon_CombatPistol",
"weapon_APPistol",
"weapon_Pistol50",
"weapon_... | nilq/small-lua-stack | null |
local K, C = unpack(select(2, ...))
local _G = _G
local SetCVar = _G.SetCVar
local SetInsertItemsLeftToRight = _G.SetInsertItemsLeftToRight
local UnloadBlizzardFrames = CreateFrame("Frame")
UnloadBlizzardFrames:RegisterEvent("PLAYER_LOGIN")
UnloadBlizzardFrames:RegisterEvent("ADDON_LOADED")
UnloadBlizzardFrames:SetS... | nilq/small-lua-stack | null |
-- Return an abstract syntax tree
local M = {}
local format = string.format
local util = require("lunamark.util")
local generic = require("lunamark.writer.generic")
local entities = require("lunamark.entities")
function M.new(options)
local options = options or {}
local AST = generic.new(options)
function AST... | nilq/small-lua-stack | null |
if not cleaner.unsafe then return end
local aux = dofile(cleaner.modpath .. "/misc_functions.lua")
local ores_data = aux.get_world_data().ores
for _, ore in ipairs(ores_data.remove) do
cleaner.register_ore_removal(ore)
end
core.register_on_mods_loaded(function()
for _, ore in ipairs(cleaner.get_remove_ores()) do... | nilq/small-lua-stack | null |
require "src/core/arrays"
local stack = {}
stack.__index = stack
function stack.new()
local self = setmetatable({}, stack)
self.list = {}
return self
end
function stack.push(self, value)
table.insert(self.list, value)
end
function stack.pop(self)
local value = self:top()
self.list[#(self.... | nilq/small-lua-stack | null |
---@class CS.UnityEngine.Pose : CS.System.ValueType
---@field public position CS.UnityEngine.Vector3
---@field public rotation CS.UnityEngine.Quaternion
---@field public forward CS.UnityEngine.Vector3
---@field public right CS.UnityEngine.Vector3
---@field public up CS.UnityEngine.Vector3
---@field public identity CS.U... | nilq/small-lua-stack | null |
--[[------------------------------------------------------------------
ARMOUR
Vignette effects to reflect player's current suit battery level
]]--------------------------------------------------------------------
if CLIENT then
-- Parameters
local WIDTH, HEIGHT = 163, 41;
local VIGNETTE_YELLOW = surface.Get... | nilq/small-lua-stack | null |
---@meta
---#if VERSION >=5.4 then
---#DES 'require>5.4'
---@param modname string
---@return any
---@return any loaderdata
function require(modname) end
---#else
---#DES 'require<5.3'
---@param modname string
---@return any
function require(modname) end
---#end
---#DES 'package'
---@class packagelib
---#DES 'package.... | nilq/small-lua-stack | null |
object_tangible_loot_creature_loot_generic_liver_s02 = object_tangible_loot_creature_loot_generic_shared_liver_s02:new {
}
ObjectTemplates:addTemplate(object_tangible_loot_creature_loot_generic_liver_s02, "object/tangible/loot/creature/loot/generic/liver_s02.iff")
| nilq/small-lua-stack | null |
local Cutscene = {}
local self = Cutscene
function Cutscene.start(cutscene)
if self.current_coroutine and coroutine.status(self.current_coroutine) ~= "dead" then
error("Attempt to start a cutscene while already in a cutscene . dumbass ,,")
self.current_coroutine = nil
end
local func = ni... | nilq/small-lua-stack | null |
project( "Utils" )
currentSourceDir = path.join( sourceDir, "Core", "Utils" )
currentBinaryDir = path.join( binaryDir, "Core", "Utils" )
kind( "StaticLib" )
targetdir( path.join( outputDir, "%{cfg.architecture}", "%{cfg.buildcfg}", staticLibDir ) )
location( currentBinaryDir )
files{
"**.hpp",
"**.inl",
"**.cpp"
... | nilq/small-lua-stack | null |
package.path = '../lib/?.lua;' .. package.path
require 'busted.runner'()
require '../lib/utils'
describe("Reverse Table", function()
it("should reverse a table", function()
foo = {1, 2, 3, 4, 5}
rev = {5, 4, 3, 2, 1}
utils.reverse_table(foo)
assert.are_same(foo, rev)
end)
end)
describe("Find next... | nilq/small-lua-stack | null |
package("libgpg-error")
set_homepage("https://www.gnupg.org/related_software/libgpg-error/")
set_description("Libgpg-error is a small library that originally defined common error values for all GnuPG components.")
set_license("GPL-2.0")
add_urls("https://www.gnupg.org/ftp/gcrypt/libgpg-error/libgpg-er... | nilq/small-lua-stack | null |
local math = require("math")
local Rope = {}
Rope.__index = Rope
setmetatable(Rope, {
__call = function(cls, ...)
return cls.new(...)
end,
})
-- Non-leaf nodes are represented by empty strings in the `string` field.
local RopeNode = {}
RopeNode.__index = RopeNode
setmetatable(RopeNode, {
__call = ... | nilq/small-lua-stack | null |
print("twat")
| nilq/small-lua-stack | null |
-- Apartment 1: -787.78050000 334.92320000 215.83840000
exports('GetExecApartment1Object', function()
return ExecApartment1
end)
ExecApartment1 = {
currentInteriorId = -1,
Style = {
Theme = {
modern = {interiorId = 227329, ipl = "apa_v_mp_h_01_a"},
moody = {inte... | nilq/small-lua-stack | null |
--====================================================================--
-- dmc_ui/dmc_widget/widget_scrollview/axis_motion.lua
--
-- Documentation:
--====================================================================--
--[[
The MIT License (MIT)
Copyright (C) 2015 David McCuskey. All Rights Reserved.
Permission ... | nilq/small-lua-stack | null |
return {
include = function()
includedirs "../vendor/cpprestsdk/Release/include/"
defines { '_NO_PPLXIMP', '_NO_ASYNCRTIMP', '_PPLTASK_ASYNC_LOGGING=0' }
if _OPTIONS['with-asan'] then
defines { 'CPPREST_FORCE_PPLX' }
end
end,
run = function()
language "C++"
kind "StaticLib"
includedirs "../ven... | nilq/small-lua-stack | null |
object_building_player_player_guildhall_corellia_style_04 = object_building_player_shared_player_guildhall_corellia_style_04:new {
}
ObjectTemplates:addTemplate(object_building_player_player_guildhall_corellia_style_04, "object/building/player/player_guildhall_corellia_style_04.iff")
| nilq/small-lua-stack | null |
module(..., package.seeall)
local constants = require("apps.lwaftr.constants")
local bit = require("bit")
local ffi = require("ffi")
local band, rshift, bswap = bit.band, bit.rshift, bit.bswap
local cast = ffi.cast
local uint16_ptr_t = ffi.typeof("uint16_t*")
local uint32_ptr_t = ffi.typeof("uint32_t*")
function g... | nilq/small-lua-stack | null |
local Bot={};
function Bot.initialize(agent)
local agentId=agent:getAgentId();
Bot[agentId]={};
local PredatorBrainFactory=dofile(agent:getScriptClassPath() .. "\\TransformerBrain.lua");
Bot[agentId].brain=PredatorBrainFactory.create(agent);
--attack any type of bots
end
function Bot.think(agent)
local agentI... | nilq/small-lua-stack | null |
-- Make lldb available in global
lldb = require('lldb')
-- Global assertion functions
function assertTrue(x)
if not x then error('assertTrue failure') end
end
function assertFalse(x)
if x then error('assertNotNil failure') end
end
function assertNotNil(x)
if x == nil then error('assertNotNil failure') en... | nilq/small-lua-stack | null |
function onCreate()
-- background shit
makeLuaSprite('back2', 'back2', -250, 0);
setScrollFactor('back2', 0.9, 0.9);
addLuaSprite('back2', false);
close(true); --For performance reasons, close this script once the stage is fully loaded, as this script won't be used anymore after loading the stage
end | nilq/small-lua-stack | null |
local prefix = '{' .. KEYS[1] .. '}' .. '::'
local id = ARGV[1]
local key = prefix .. id
local updateHasChildenCache = function (target, hasChild)
local parentKey = prefix .. target .. '::P'
local parents = redis.call('smembers', parentKey)
for _, parent in ipairs(parents) do
if parent then
local pare... | nilq/small-lua-stack | null |
minetest.register_craftitem("technic_diamond:diamond_dust", { description="Diamond Dust", inventory_image = "technic_diamond_dust.png"})
technic.register_grinder_recipe({ input = {"default:diamond"}, output = {"technic_diamond:diamond_dust 2"}})
technic.register_compressor_recipe({ input = {"technic_diamond:diamon... | nilq/small-lua-stack | null |
-- Collection of utility functions for the ConstructBot library
-- Runs func untill it returns either true or nil
function tillDone(func)
local r = {func()}
while(next(r) ~= nil and r[1] ~= true) do
r = {func()}
end
end
-- Runs tillDone(func) num times
-- This means func will be ran until it returns nil or ... | nilq/small-lua-stack | null |
require "utils"
utils.dofile("wifi")
require "am2302"
am2302.start()
| nilq/small-lua-stack | null |
-- Multi-threading
-- referenced (https://github.com/soumith/dcgan.torch/blob/master/data)
-- Copyright (c) 2017, Minchul Shin [See LICENSE file for details]
require 'os'
local Threads = require 'threads'
Threads.serialization('threads.sharedserialize')
local data = {}
local result = {}
local unpack = unpack and unp... | nilq/small-lua-stack | null |
--[[ Global scope variables ]]--
local WinWidth, WinHeight = love.graphics.getDimensions()
-- Global scope objects
local Ball
local Enemy
local Player
-- This basic object will hold the score info
local Score = {}
function Score.increase()
Score.score = Score.score + 1
end
function Score.draw()
love.gra... | nilq/small-lua-stack | null |
-- Sector A2: Destroy the Enemy Ship
obj_prim_newobj_id = 0
enemy_ping = 0
function OnInit()
Rule_Add("Rule_Init")
end
function Rule_Init()
StartMission()
if (questsStatus.a2_ShipHasBeenDestroyed ~= 1) then
Event_Start( "IntelEvent_Intro" )
enemy_ping = Ping_AddSobGroup("Enemy Ship", "anomaly", "EnyGroup")
R... | nilq/small-lua-stack | null |
generator_list["json"] =
{
os.projectdir().."/tools/codegen/serialize_json.py",
os.projectdir().."/tools/codegen/json_reader.h.mako",
os.projectdir().."/tools/codegen/json_reader.cpp.mako",
os.projectdir().."/tools/codegen/json_writer.h.mako",
os.pro... | nilq/small-lua-stack | null |
---
--- Copyright (c) GoGo Easy Team & Jacobs Lei
--- Author: Jacobs Lei
--- Date: 2018/4/7
--- Time: 上午10:44
local utils = require("core.utils.utils")
local tonumber = tonumber
local global_cache = require("core.cache.local.global_cache_util")
local global_cache_prefix = require("core.cache.local.global_cache_prefix"... | nilq/small-lua-stack | null |
require "util.class"
require "util.event"
require "system.system"
local tt = require "util.table"
class("Font")
function Font:Font(font, size)
self.font = font or nil
self.size = size or 16
end
local DefaultFont = Font()
class("Noder")
function Noder:Noder(font, justify, color, hoffset)
self.font = fon... | nilq/small-lua-stack | null |
-- include useful files
u_execDependencyScript("ohvrvanilla", "base", "vittorio romeo", "utils.lua")
u_execDependencyScript("ohvrvanilla", "base", "vittorio romeo", "common.lua")
u_execDependencyScript("ohvrvanilla", "base", "vittorio romeo", "commonpatterns.lua")
u_execDependencyScript("ohvrvanilla", "base", "vittorio... | nilq/small-lua-stack | null |
function lt.constant(value)
function f(iter) return value end
return f
end
--[[
Used to decay the learning rate. This schedule is advocated by Leon Bottou in "Stochastic Gradient
Descent Tricks".
--]]
function lt.gentle_decay(init, decay)
function f(iter) return init / (1 + iter * decay) end
return f
end
--[[
Use... | nilq/small-lua-stack | null |
ENT.Type = "brush"
function ENT:Initialize()
-- ParticleEffectAttach("portal_cleanser",PATTACH_ABSORIGIN,self,1)
self:SetTrigger(true)
end
function ENT:Touch( ent )
end
function ENT:StartTouch( ent )
if ent:IsPlayer() and ent:Alive() then
plyweap = ent:GetActiveWeapon()
if IsValid( plyweap ) and plyweap:Get... | nilq/small-lua-stack | null |
local SCREEN_WIDTH = 640
local SCREEN_HEIGHT = 480
local BLUE = "blue"
local RED = "red"
local GREEN = "green"
local COLOR_COUNT = 3
local TO_RIGHT = 1
local TO_LEFT = -1
local CORRECT = "correct"
local WRONG = "wrong"
local CODES_IN_PROD_DISPLAY_SIZE = 5
local TILE_DIMENSION = 32
local MARGIN = 10
local PLAYER_BA... | nilq/small-lua-stack | null |
function ISatyr_OnEnterCombat(Unit,Event)
if Unit:GetHealthPct() == 97 then
Unit:FullCastSpellOnTarget(38048,Unit:GetClosestPlayer())
end
end
RegisterUnitEvent(21656, 1, "ISatyr_OnEnterCombat") | nilq/small-lua-stack | null |
---@class Ability
Ability = {}
---@class AbilityBlueprint
AbilityBlueprint = {}
---@class ActorID
ActorID = {}
---@class Ai
Ai = {}
---@class AIEncounter
AIEncounter = {}
---@class AITacticType
AITacticType = {}
---@class AllianceResult
AllianceResult = {}
---@class Availability
Availability = {}
---@class blip... | nilq/small-lua-stack | null |
local api = trinium.api
local DataMesh = api.DataMesh
function api.initialize_inventory(inv, def)
for k, v in pairs(def) do
inv:set_size(k, v)
end
end
function api.initializer(def0)
return function(pos)
local def = table.copy(def0)
local meta = minetest.get_meta(pos)
if def.formspec then
meta:set_string... | nilq/small-lua-stack | null |
-- Commands interface. A simple way to handle dispatching commands and parse
-- arguments.
--
-- This file is licensed under the BSD 2-Clause license.
--
-- Copyright (c) 2016 Aaron Bolyard.
local function perform_dispatch(self, ...)
local command = select(1, ...)
if command and #command > 1 then
local func = sel... | nilq/small-lua-stack | null |
local api = vim.api
local custom_options = { noremap = true, silent = true }
local M = {}
M.map = function(mode, target, source, opts)
api.nvim_set_keymap(mode, target, source, opts or custom_options)
end
for _, mode in ipairs({ "n", "o", "i", "x", "t" }) do
M[mode .. "map"] = function(...)
M.map(mode, ...)
en... | nilq/small-lua-stack | null |
BASE_DIR = path.getabsolute("..")
THIRD_PARTY_DIR = path.join(BASE_DIR, "3rdparty")
TUTORIAL_BUILD_DIR = path.join(BASE_DIR, "build")
BGFX_DIR = path.join(THIRD_PARTY_DIR, "bgfx")
BX_DIR = path.join(THIRD_PARTY_DIR, "bx")
BIMG_DIR = path.join(THIRD_PARTY_DIR, "bimg")
SRC_DIR = path.join(BASE_DIR, "src")
function cop... | nilq/small-lua-stack | null |
project "BenchLib"
kind "StaticLib"
if zpm.option( "ProfileMemory" ) then
zpm.export [[
defines "BENCHLIB_ENABLE_MEMPROFILE"
]]
end
zpm.export [[
includedirs "benchmark/include/"
flags "C++11"
]]
| nilq/small-lua-stack | null |
--[[
Name: cl_init.lua
For: SantosRP
By: TalosLife
]]--
include "shared.lua"
ENT.RenderGroup = RENDERGROUP_BOTH
function ENT:Initialize()
self.m_sndBurnSound = CreateSound( self, "weapons/flaregun/burn.wav" )
end
function ENT:OnRemove()
if self.m_sndBurnSound then self.m_sndBurnSound:Stop() end
end
function EN... | nilq/small-lua-stack | null |
--[[ Copyright (c) 2019 dgw
* Part of the Warehousing mod
*
* See License.txt in the project directory for license information.
--]]
-- migrate from old single logistic research to the new pair of techs
-- relies on JSON migration to rename the old tech to level 2 first
for index, force in pairs(game.forces) do
l... | nilq/small-lua-stack | null |
local function map(list, mapper)
local listType = type(list)
assert(listType == "table", "expected a table for first argument, got " .. listType)
local mapperType = type(mapper)
assert(mapperType == "function", "expected a function for second argument, got " .. mapperType)
local new = {}
local index = 1
fo... | nilq/small-lua-stack | null |
return setmetatable({},{
__index = function(_, key: string)
return function(duration: number?)
return TweenInfo.new(duration or 0, Enum.EasingStyle[key])
end
end,
}) | nilq/small-lua-stack | null |
-- Copyright (C) Miracle
-- Copyright (C) OpenWAF
local _M = {
_VERSION = "0.0.3"
}
local ffi = require "ffi"
local cjson = require "cjson.safe"
local twaf_action = require "lib.twaf.inc.action"
local ngx_ERR = ngx.ERR
local ngx_log = ... | nilq/small-lua-stack | null |
FACTION.name = "Hauptamt SS-Gericht"
FACTION.desc = "SS Court Main Office"
FACTION.color = Color(255, 0, 0)
FACTION.isDefault = false
FACTION.pay = 125
FACTION.payTime = 900
FACTION.isGloballyRecognized = true
FACTION_GERICH = FACTION.index | nilq/small-lua-stack | null |
return function(args)
local weblit = require 'weblit-app'
weblit.use(require 'weblit-auto-headers')
local web_hook_server = require './src/WebHookServer'(weblit)
weblit.start()
local build_manager = require './src/BuildManager'()
build_manager.add_builder(require './src/SshBuilder'({
server = 'ryan@192... | nilq/small-lua-stack | null |
-- neovim_helpers.lua
-- Set of wrappers to ease interaction with the neovim api
local cmd = vim.cmd
local global = vim.o
local map_key = vim.api.nvim_set_keymap
-- Set an option to a value
-- If no scopes specified then use global
local function opt(option, value, scopes)
scopes = scopes or {global}
for _, s in i... | nilq/small-lua-stack | null |
if not modules then modules = { } end modules ['attr-col'] = {
version = 1.001,
comment = "companion to attr-col.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
license = "see context related readme files"
}
-- this module is being... | nilq/small-lua-stack | null |
require('stdlib/string')
local tools = {}
function tools.protect_entity(entity)
entity.minable = false
entity.destructible = false
end
function tools.link_in_spawn(pos)
local link_in = game.surfaces[GAME_SURFACE_NAME].create_entity {
name = "linked-belt",
position = pos,
force = ga... | nilq/small-lua-stack | null |
local utils = require "../sel/utils"
local stringSplit = utils.stringSplit
local stringTrim = utils.stringTrim
return {
populateContextByDefaultHandlers = function(context)
context:registerHandler('not', function(arg)
arg = tostring(arg)
arg = arg:lower();
local args = ... | 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.