content stringlengths 0 1.05M | origin stringclasses 2
values | type stringclasses 2
values |
|---|---|---|
local kernel = {}
kernel.language = "glsl"
kernel.category = "filter"
kernel.name = "grayscale"
kernel.fragment =
[[
const P_COLOR vec3 kWeights = vec3( 0.2125, 0.7154, 0.0721 );
P_COLOR vec4 FragmentKernel( P_UV vec2 texCoord )
{
P_COLOR vec4 texColor = texture2D( u_FillSampler0, texCoord ) * v_ColorScale;
... | nilq/small-lua-stack | null |
local Players = game:GetService("Players")
local Modules = Players.LocalPlayer.PlayerGui.AvatarEditorInGame.Modules
local AppPage = require(Modules.NotLApp.AppPage)
local ResetNavigationHistory = require(Modules.NotLApp.Thunks.ResetNavigationHistory)
local NavigateToRoute = require(Modules.NotLApp.Thunks.NavigateToRo... | nilq/small-lua-stack | null |
--
-- Created by IntelliJ IDEA.
-- User: chen0
-- Date: 9/7/2017
-- Time: 10:12 AM
-- To change this template use File | Settings | File Templates.
--
describe('BreadthFirstSearch()', function()
local g = require('luagraphs.data.graph').create(6)
g:addEdge(0, 5);
g:addEdge(2, 4);
g:addEdge(2, 3);
g... | nilq/small-lua-stack | null |
-- ========== THIS IS AN AUTOMATICALLY GENERATED FILE! ==========
PlaceObj('StoryBit', {
ActivationEffects = {},
Comment = "make this Follow-up immediate (no sol delay after the choice)",
Effects = {},
Image = "UI/Messages/Events/02_video_call_2.tga",
Prerequisites = {},
ScriptDone = true,
Text = T(576575765241... | nilq/small-lua-stack | null |
function Boss2Spinner(x,y, index, core, direction, angular_speed)
local spinner = pewpew.new_customizable_entity(x, y)
pewpew.customizable_entity_set_mesh(spinner, "/dynamic/BossPack/enemy_meshes.lua", index)
pewpew.customizable_entity_set_position_interpolation(spinner, true)
local angle = 0fx
... | nilq/small-lua-stack | null |
vector = {}
--vector.__index = vector
vector.isMathType = true
vector.isvector = true
function vector.zero( len, con )
con = con or 0
local v = {}
for i = 1, len do
v[i] = con
end
return vector.new( v )
end
-- function vector.isvector( v )
-- return getmetatable( v ) == vector
-- end
functio... | nilq/small-lua-stack | null |
target("DopplerEffect")
set_group("Examples")
set_kind("binary")
add_deps("NazaraAudio", "NazaraPlatform")
add_files("main.cpp") | nilq/small-lua-stack | null |
--lua端的全局事件号以10000起始,c#的是1~9999
local GlobalEvents = BaseClass(CS.UnityMMO.GlobalEvents)
GlobalEvents.GameStart = 10000
GlobalEvents.SetMainUIVisible = 10001
return GlobalEvents | nilq/small-lua-stack | null |
#!/usr/bin/env tarantool
local test = require("sqltester")
test:plan(4)
-- Make sure that the comparison between DECIMAL and large DOUBLE is correct.
test:do_execsql_test(
"gh-6376-1",
[[
SELECT CAST(1 AS DECIMAL) < -1e40;
]], {
false
})
test:do_execsql_test(
"gh-6376-2",
[[
... | nilq/small-lua-stack | null |
---------------
--Unbreakable--
---------------
--Stone
minetest.register_node("tower_defense:red_stone", {
tiles = {"tower_defense_red_stone.png"},
description = "Unbreakable stone for TD games",
groups = {not_in_creative_inventory = 1, unbreakable = 1},
})
--Sand
minetest.register_node("tower_defense:yellow_ston... | nilq/small-lua-stack | null |
local state = {}
state._NAME = ...
local Body = require'Body'
local util = require'util'
local vector = require'vector'
local HT = require'libHeadTransform'
local T = require'Transform'
local movearm = require'movearm'
local forwardR = movearm.rPlanner.forward
local t_entry, t_update
-- TODO: need to compensate the... | nilq/small-lua-stack | null |
mineunit:set_modpath("technic", "spec/fixtures")
technic = {}
technic.chests = {}
technic.chests.colors = {
{"black", S("Black")},
{"blue", S("Blue")},
{"brown", S("Brown")},
{"cyan", S("Cyan")},
{"dark_green", S("Dark Green")},
{"dark_grey", S("Dark Grey")},
{"green", S("Green")},
{"grey", S("Grey")},
{"mag... | nilq/small-lua-stack | null |
module 'mock'
CLASS: PhysicsBodyDef ()
:MODEL{
Field 'tag' :string();
'----';
Field 'bodyType' :enum( EnumPhysicsBodyType );
'----';
Field 'allowSleep' :boolean();
Field 'isBullet' :boolean();
Field 'fixedRotation' :boolean();
'----';
Field 'gravityScale' :number();
F... | nilq/small-lua-stack | null |
local archetypes = {}
local CACHE_WITH = {}
local CACHE_WITHOUT = {}
-- Version of the last registered archetype. Used to cache the systems execution plan
local Version = 0
--[[
An Archetype is a unique combination of component types. The EntityRepository uses the archetype to group all
entities that have th... | nilq/small-lua-stack | null |
need_boolean(in_site({'setup_mode', 'skip'}), false)
| nilq/small-lua-stack | null |
local utils = require("browse.utils")
local M = {}
M.devdocs_search = function()
vim.ui.input("Search String: ", function(input)
if input == nil or input == "" then
return
end
local open_cmd = utils.get_open_cmd()
local input_with_filetype = vim.bo.filetype .. " " .. input
vim.fn.jobstart(... | nilq/small-lua-stack | null |
-------------------------------------------------------------------------------
-- modt.lua
--
-- author: Lawrence Hoffman
--
-- an example of how to write unit tests with bgtest
-------------------------------------------------------------------------------
local function add(a, b)
return a+b
end
-- Tests have ... | nilq/small-lua-stack | null |
local ffi = require "ffi"
local bit = require "bit"
local string = require "string"
local table = require "table"
local ffi_new = ffi.new
local ffi_str = ffi.string
local ffi_cast = ffi.cast
local is_luajit = pcall(require, "jit")
local clib
local consts = {}
---
-- aux
---
local aux = {}
if is_lu... | nilq/small-lua-stack | null |
local Drop, Version = MakeSushi(7, 'Frame', 'DropdownFrame', nil, nil, SushiGroup)
if not Drop then
return
elseif not Version then
local function closeAll()
Drop:CloseAll()
end
hooksecurefunc('ToggleDropDownMenu', closeAll)
hooksecurefunc('CloseDropDownMenus', closeAll)
end
local function get(value, ...)
if t... | nilq/small-lua-stack | null |
local Rule = require('nvim-autopairs.rule')
local cond = require('nvim-autopairs.conds')
local npairs = require('nvim-autopairs')
local ignored_next_char = string.gsub([[ [%w%%%[%.] ]],"%s+", "")
npairs.setup {
ignored_next_char = ignored_next_char
}
npairs.add_rule(
Rule('<', '>')
:with_pair(cond.not_after_r... | nilq/small-lua-stack | null |
local awful = require("awful")
local gears = require("gears")
local wibox = require("wibox")
local beautiful = require("beautiful")
local dpi = beautiful.xresources.apply_dpi
local helpers = require('helpers')
local ram = wibox.widget.textbox("")
awesome.connect_signal("watches::ram", function(used, total)
local ... | nilq/small-lua-stack | null |
loader.SetFillMode((loader.GetFillMode() + 1) % 2) -- SOLID / WIREFRAME
loader.SetWindMode((loader.GetWindMode() + 1) % 2) -- STRAIGHT / RADIAL
wind_speed = loader.GetWindSpeed()
loader.SetWindSpeed((wind_speed + 25.0) % 100.0)
wave_width = loader.GetWaveWidth()
loader.SetWaveWidth((wave_width + 6.0) % 20.0)
wind_st... | nilq/small-lua-stack | null |
local restserver = {}
local request = require("wsapi.request")
local response = require("wsapi.response")
local json = require("dkjson")
local unpack = unpack or table.unpack
local function add_resource(self, name, entries, authfunc)
for _, entry in ipairs(entries) do
local path = ("^/" .. name .. "/" .. en... | nilq/small-lua-stack | null |
return {'vorderen','vordering','vorderingsrecht','vore','voren','vorenbedoeld','vorengenoemd','vorenstaand','vorig','vork','vorkbeen','vorken','vorkheftruck','vorm','vormbak','vormbehoud','vormcrisis','vormeis','vormelijk','vormelijkheid','vormeling','vormeloos','vormeloosheid','vormen','vormend','vormenrijkdom','vorme... | nilq/small-lua-stack | null |
-------------------------------------------------------------------------=---
-- Name: dialog.wx.lua
-- Purpose: Dialog wxLua sample, a temperature converter
-- Based on the C++ version by Marco Ghislanzoni
-- Author: J Winwood, John Labenski
-- Created: March 2002
-- Copyright: (c) 2... | nilq/small-lua-stack | null |
local _CreateConVar = CreateConVar
local _CurTime = CurTime
local _hook_Add = hook.Add
local _player_GetAll = player.GetAll
if !gAC.config.NEKO_LUA_CHECKS then return end
local Neko_Value = gAC.Encoder.stringrandom(8, true)
_CreateConVar("neko_exit", Neko_Value, { FCVAR_CHEAT, FCVAR_PROTECTED, FCVAR_NOT_CONNECTED, F... | nilq/small-lua-stack | null |
pg = pg or {}
pg.medal_template = {
[10011] = {
target_num = 2000,
name = "海军优秀服役勋章",
explain2 = "表现优秀的指挥官",
type = 0,
count_inherit = 0,
desc = "该勋章授予在服役期间表现优秀的指挥官",
next = 10012,
icon = "2021",
target_type = 1022,
start = 0,
hide = 0,
label = "l_201",
condition = "舰队出征累积胜利2000次 ",
rank = ... | nilq/small-lua-stack | null |
-- include useful files
u_execScript("utils.lua")
u_execScript("common.lua")
u_execScript("commonpatterns.lua")
u_execScript("nextpatterns.lua")
u_execScript("evolutionpatterns.lua")
-- onInit is an hardcoded function that is called when the level is first loaded
function onInit()
l_setSpeedMult(5.0)
l_setSpeedInc(0... | nilq/small-lua-stack | null |
return nn.Sequential():add(nn.Linear(4096,config.nClasses)):add(nn.LogSoftMax()) | nilq/small-lua-stack | null |
object_tangible_holiday_empire_day_empire_day_space_station = object_tangible_holiday_empire_day_shared_empire_day_space_station:new {
}
ObjectTemplates:addTemplate(object_tangible_holiday_empire_day_empire_day_space_station, "object/tangible/holiday/empire_day/empire_day_space_station.iff")
| nilq/small-lua-stack | null |
WorldItem = {}Apartment = {}
Bank = {}
Business = {}
Carwash = {}
ClothingStore = {}
Dmv = {}
DriveThrough = {}
DrugProcessor = {}
Fbi = {}
Fishing = {}
FlightSchool = {}
Ganglands = {}
Garage = {}
Hospital = {}
House = {}
MechanicShop = {}
MoneyTruck = {}
Prison = {}
Simeons = {}
Store = {}
TattooParlor = {}
Taxi = {}... | nilq/small-lua-stack | null |
local function Cake()
a = "EAT THIS LAST"
print(a)
end
Cake() | nilq/small-lua-stack | null |
-- Generated By protoc-gen-lua Do not Edit
local protobuf = require "protobuf"
module('BceLeaveHall_pb', package.seeall)
local BCELEAVEHALL = protobuf.Descriptor();
BCELEAVEHALL.name = "BceLeaveHall"
BCELEAVEHALL.full_name = ".com.xinqihd.sns.gameserver.proto.BceLeaveHall"
BCELEAVEHALL.nested_types = {}
BCELEAVEHALL... | nilq/small-lua-stack | null |
local ga = gajosframework
ga.MainMenu = classExtends(Controller, function(user)
self.user = user
self.model = ga.MainMenuModel.new(self, user)
self.view = ga.MainMenuView.new(user)
function self:setBackground(path, darkness)
self.model:setBackground(path)
if darkness then
... | nilq/small-lua-stack | null |
-----------------------------------
-- Area: Chateau d'Oraguille
-- NPC: Faurie
-- Chat Text and Zone Exit Menu
-----------------------------------
require("scripts/globals/settings");
-----------------------------------
function onTrade(player,npc,trade)
end;
function onTrigger(player,npc)
player:startEvent(506... | nilq/small-lua-stack | null |
workspace "gperftools_test"
configurations { "Debug", "Release" }
platforms { "x64" }
targetdir "../bin/%{cfg.buildcfg}"
language "C++"
flags {
"C++11",
"StaticRuntime",
}
includedirs {
"../deps/include/",
}
libdirs {
"../deps/lib_win",
"../dep... | nilq/small-lua-stack | null |
local value = {
x = 0,
y = 0,
minvalue = 0,
maxvalue = 100,
value = 10,
w = 60,
h = 60,
background = { 255, 255, 255 },
buttons = { 200, 200, 200 },
foreground = { 21, 21, 21 },
valtimer = timer.new(0.3),
incriment = 1,
substate = "Main",
visible = true
}
value.__index = value
function value:new( data,... | nilq/small-lua-stack | null |
ATJ.lcm = {}
function ATJ.lcm.wait_fifo_empty()
while (bit32.band(HW.YUV2RGB.CTL.read(), 0x04) == 0) do
end
end
function ATJ.lcm.rs_command()
ATJ.lcm.wait_fifo_empty()
HW.YUV2RGB.CTL.write(0x802ae)
end
function ATJ.lcm.rs_data()
ATJ.lcm.wait_fifo_empty()
HW.YUV2RGB.CTL.write(0x902ae)
end
fun... | nilq/small-lua-stack | null |
local swap_next, swap_prev = (function()
local swap_objects = {
p = "@parameter.inner",
f = "@function.outer",
e = "@element",
}
local n, p = {}, {}
for key, obj in pairs(swap_objects) do
n[string.format("<M-l>%s", key)] = obj
p[string.format("<M-h>%s", key)] = obj
end
return n, p
end)()
require("nvi... | nilq/small-lua-stack | null |
-- Combat settings
-- NOTE: valid values for worldType are: "pvp", "no-pvp" and "pvp-enforced"
worldType = "pvp"
hotkeyAimbotEnabled = true
protectionLevel = 35
pzLocked = 50 * 1000
removeChargesFromRunes = true
removeChargesFromPotions = true
removeWeaponAmmunition = true
removeWeaponCharges = true
timeToDecreaseFrags... | nilq/small-lua-stack | null |
local parser = require("moocscript.parser")
local compile = require("moocscript.compile")
describe("test success 1 #table", function()
local mnstr=[[
b = 9 + ...
a = {
--- 111
3,
4 = 3, --- 222
fn(){} = 4,
{fn(){}} = fn(){}, --[=[ 901... | nilq/small-lua-stack | null |
--[[
Sklepy z odzieza
@author Jakub 'XJMLN' Starzak <jack@pszmta.pl
@package PSZMTA.gracz-sklep_odziezowy
@copyright Jakub 'XJMLN' Starzak <jack@pszmta.pl>
Nie mozesz uzywac tego skryptu bez mojej zgody. Napisz - byc moze sie zgodze na uzycie.
]]--
local s_active = nil
local i = 1
local sw, sh = guiGetScreenSize()
l... | nilq/small-lua-stack | null |
object_tangible_component_clothing_trim_outbreak_prison_guard_jacket = object_tangible_component_clothing_shared_trim_outbreak_prison_guard_jacket:new {
}
ObjectTemplates:addTemplate(object_tangible_component_clothing_trim_outbreak_prison_guard_jacket, "object/tangible/component/clothing/trim_outbreak_prison_guard_ja... | nilq/small-lua-stack | null |
setfenv(1, require "sysapi-ns")
ffi.cdef [[
typedef void VOID;
typedef signed char CCHAR, CHAR, INT8;
typedef unsigned char BYTE, UCHAR, UINT8, BOOLEAN;
typedef signed short SHORT, INT16;
typedef unsigned short WORD, USHORT, UINT16;
typedef signed int INT, INT32, BOOL;
typedef unsigned int UINT, UINT32;
... | nilq/small-lua-stack | null |
package.path="lualib/?.lua;"
local lproto = require "lproto"
local protDict = {}
local function registprot(p)
table.insert(protDict,p)
return #protDict
end
--[[
-- define protocol dict
--]]
local dp = {
user = "hanxi",
money = 100,
list = { -- it mean's array. the element is the table content.
... | nilq/small-lua-stack | null |
local status_ok, bufferline = pcall(require, 'bufferline')
if not status_ok then
return
end
bufferline.setup({
options = {
mode = 'buffers', -- set to 'tabs' to only show tabpages instead
close_command = 'bdelete! %d', -- can be a string | function, see 'Mouse actions'
right_mouse_comm... | nilq/small-lua-stack | null |
local PANEL = {}
function PANEL:Init()
self:Receiver("impulseInv", self.OnDrop)
self:SetMouseInputEnabled(false)
self:SetSize(140, 140)
self:Hide()
end
function PANEL:SetItem(panel)
self.Item = panel
self:SetPos(gui.MouseX() + 6, gui.MouseY() - self:GetTall() - 6)
self.ItemName = panel.Item.Name
self.ItemCol... | nilq/small-lua-stack | null |
<form action="." class="form-horizontal hidden-print" id="main" method="GET">
<div class="form-group">
<input type="hidden" name="database" value="<%= html.dbactive %>">
<input type="hidden" name="action" value="new_task">
<input type="hidden" name="tagid" value="<%= html.taglist[html.options.tag].id %>">
<div clas... | nilq/small-lua-stack | null |
Outfitter.EquipmentUpdateCount = 0
----------------------------------------
Outfitter._EquipmentChanges = Outfitter:newClass()
----------------------------------------
function Outfitter._EquipmentChanges:construct()
end
function Outfitter._EquipmentChanges:addChange(change)
table.insert(self, change)
en... | nilq/small-lua-stack | null |
package.path = "../?.lua;"..package.path;
require("p5")
function setup()
rectMode(CORNER); -- Default rectMode is CORNER
fill(255); -- Set fill to white
rect(25, 25, 50, 50); -- Draw white rect using CORNER mode
rectMode(CORNERS); -- Set rectMode to CORNERS
fill(100)... | nilq/small-lua-stack | null |
-- Snippets
vim.g.coc_snippet_next = '<C-j>'
vim.g.coc_snippet_prev = '<C-k>'
vim.cmd("autocmd CursorHold * silent call CocActionAsync('highlight')")
| nilq/small-lua-stack | null |
local M = {}
function M.setup(config)
local defaults = require 'flavours.defaults'
local cfg = vim.tbl_deep_extend('force', defaults, config or {})
vim.cmd 'hi clear'
if vim.fn.exists('syntax_on') then
vim.cmd 'syntax reset'
end
vim.o.background = cfg.background
vim.o.termguicolor... | nilq/small-lua-stack | null |
local K = require("game.constants")
local LG = love.graphics
local renderWindow = require('game.render.window')
local renderBoardGems = require('game.render.gems.bgem')
local function renderNext(nextColumn, coords)
renderWindow.render("Next!", coords, function(w, h)
local scale = h / ( K.GEM_SIZE * 3.25 )
l... | nilq/small-lua-stack | null |
return require("kong.plugins.pre-function.migrations._001_280_to_300")("pre-function")
| nilq/small-lua-stack | null |
--
---- Copyright (c) 2014, Facebook, Inc.
---- All rights reserved.
----
---- This source code is licensed under the Apache 2 license found in the
---- LICENSE file in the root directory of this source tree.
----
ok, cunn = pcall(require, 'fbcunn')
if not ok then
ok,cunn = pcall(require,'cunn')
if ok then
pr... | nilq/small-lua-stack | null |
-- ========== THIS IS AN AUTOMATICALLY GENERATED FILE! ==========
PlaceObj('StoryBit', {
ActivationEffects = {},
Category = "Tick_BeforeFounders",
Effects = {},
EnableChance = 40,
Enabled = true,
Image = "UI/Messages/Events/03_discussion.tga",
Prerequisites = {},
ScriptDone = true,
Text = T(525807588817, --[[... | nilq/small-lua-stack | null |
-- local dbg = require("debugger")
-- dbg.auto_where = 2
local chunk = require'tools.string'.chunk
local subject
local function set_subject(str, spos, epos)
subject = chunk(str, spos, epos)
end
local function assert_chunk_is(string, startpos, endpos, chunk)
local chunk = chunk or string
it("has the correct stri... | nilq/small-lua-stack | null |
-- Copyright (c) 2020 Kirazy
-- Part of Bob's Logistics Belt Reskin
--
-- See LICENSE.md in the project directory for license information.
-- Create belt particles
if data.raw["transport-belt"]["basic-transport-belt"] then
beltReskin.createParticles("basic")
end
if data.raw["transport-belt"]["turbo-transport... | nilq/small-lua-stack | null |
-- This information tells other players more about the mod
name = "Monster Healthbars"
description = "Healthbar for enemies"
author = "nlight"
version = "1.2d"
forumthread = ""
-- This lets other players know if your mod is out of date, update it to match the current version in the game
api_version = 6
api_version_... | nilq/small-lua-stack | null |
inspect = require 'lib.inspect'
GameState = require 'lib.hump.gamestate'
HumpCamera = require 'lib.hump.camera'
Vector = require 'lib.hump.vector'
class = require 'lib.hump.class'
Timer = require 'lib.hump.timer'
anim8 = require 'lib.anim8'
bump = require 'lib.bump'
tiny = require 'li... | nilq/small-lua-stack | null |
-- the standard cubemap
plates = {
{ { 0, 0, 1 }, { 0, 1, 0 }, 90 }, -- front
{ { 1, 0, 0 }, { 0, 1, 0 }, 90 }, -- right
{ { -1, 0, 0 }, { 0, 1, 0 }, 90 }, -- left
{ { 0, 0, -1 }, { 0, 1, 0 }, 90 }, -- back
{ { 0, 1, 0 }, { 0, 0, -1 }, 90 }, -- top
{ { 0, -1, 0 }, { 0, 0, 1 }, 90 } -- bottom
}
| nilq/small-lua-stack | null |
return {
PlaceObj('ModItemCode', {
'name', "ExtractorAvailableDepositScript",
'FileName', "Code/ExtractorAvailableDepositScript.lua",
}),
}
| nilq/small-lua-stack | null |
credits.settings = {}
local set = credits.settings
--[[ See your `minetest.conf` file after first run to change these settings
credits.settings.interest_rate = 0.05 -- Equates to 5% per in-game day (Only executed once)
credits.settings.bal_refresh_rate = 3 -- Every 3 seconds, updates the HUD and checks if interest ca... | nilq/small-lua-stack | null |
--[[
© 2018 Thriving Ventures AB do not share, re-distribute or modify
without permission of its author (gustaf@thrivingventures.com).
]]
local plugin = plugin
plugin.name = "MOTD"
plugin.author = "`impulse"
plugin.version = "1.0"
plugin.description = "An MOTD that is displayed when a player joins the server."
plu... | nilq/small-lua-stack | null |
--[[
Copyright (c) 2019 igor725, scaledteam
released under The MIT license http://opensource.org/licenses/MIT
]]
local survBlocknames = {
'Stone', 'Grass', 'Dirt', 'Cobblestone',
'Planks', 'Sapling', 'Bedrock', 'Water',
'Water', 'Lava', 'Lava', 'Sand', 'Gravel',
'Gold ore', 'Iron ore', 'Coal ore', 'Log',
'Leave... | nilq/small-lua-stack | null |
local screenWidth, screenHeight = guiGetScreenSize()
local phi, theta = false, false
local elem = false
local distance = false
local height = false
local sin = math.sin
local cos = math.cos
local pi = math.pi
local rad = math.rad
local function scale(factor, baseX, baseY, baseZ, x, y, z)
return baseX + factor*(x-ba... | nilq/small-lua-stack | null |
return {'mexicaan','mexicaans','mexicaanse','mexico','mex','mexx','mexicanen','mex','mexx'} | nilq/small-lua-stack | null |
print("main.lua start")
BAD_REQUEST=400
OK=200
powersave_flag = false
print("load config.lua")
dofile("config")
print("sda", sda, "scl", scl)
print("load util.lua")
dofile("util.lua")
function init_display(disp)
disp:setFlipMode(1)
disp:clearBuffer()
disp:setContrast(255)
disp:setFontMode(0)
disp:setDrawColo... | nilq/small-lua-stack | null |
psAir={
getGravity=function()
if player.vel.y<0 then
return 0.015
else
return 0.01
end
end,
update=function()
pAirUpdate(psAir.getGravity())
end,
checkTransition=function()
if (btnp(btnWhip)) return psWhip
if (pAirFrames<6 and b... | nilq/small-lua-stack | null |
--[[
Main entry point for the mod.
This file holds all general event handlers.
]]--
if not todo then
todo = {}
end
-- features
require("todo/features/add_task")
require("todo/features/delete_task")
require("todo/features/details_view")
require("todo/features/edit_task")
require("todo/features/export_task")
req... | nilq/small-lua-stack | null |
---------------------
-- Local variables --
---------------------
local g_Wnd, g_Anim, g_Visible
local g_PosX, g_PosY = g_ScreenSize[1] - 260, (g_ScreenSize[2] - 280)/2
local g_Width = 250
local g_StatsView
--------------------------------
-- Local function definitions --
--------------------------------
... | nilq/small-lua-stack | null |
local keyboard = libs.keyboard;
--@help Lower volume
actions.volume_down = function()
toast();
keyboard.stroke("down");
end
--@help Raise volume
actions.volume_up = function()
toast();
keyboard.stroke("up");
end
--@help Rewind
actions.rewind = function()
keyboard.stroke("left");
end
--@help Fast forward
action... | nilq/small-lua-stack | null |
--[[
Modefied version of Direwolf20`s button API
http://pastebin.com/cK9wnj7X
]]
local mon = peripheral.wrap("right")
local button = {}
mon.setTextScale(1)
mon.setTextColor(colors.white)
mon.setBackgroundColor(colors.black)
function setTable(name, func, arg, xmin, xmax, ymin, ymax)
button[name] = {}
... | nilq/small-lua-stack | null |
--- 模块功能:Lua补丁
-- @module patch
-- @author openLuat
-- @license MIT
-- @copyright openLuat
-- @release 2017.10.21
require"pm"
module(..., package.seeall)
--[[
模块名称:Lua自带接口补丁
模块功能:补丁某些Lua自带的接口,规避调用异常时死机
模块最后修改时间:2017.02.14
]]
--保存Lua自带的os.time接口
local oldostime = os.time
--[[
函数名:safeostime
功能 :封装自定义的os.time接口
参数 :... | nilq/small-lua-stack | null |
local ca_pass = {}
function ca_pass:evaluation()
return 999980
end
function ca_pass:execution(cfg, data)
end
return ca_pass | nilq/small-lua-stack | null |
function mobs.on_step(self,dtime)
if self.type == "monster" and minetest.setting_getbool("only_peaceful_mobs") then
self.object:remove()
return
end
if self.lifetimer ~= false then
self.lifetimer = self.lifetimer - dtime
if self.lifetimer <= 0 and not self.tamed and self.type ~= "npc" then
local player_c... | nilq/small-lua-stack | null |
function torch.find(tensor, val, dim)
local i = 1
local indice = {}
if dim then
assert(tensor:dim() == 2, "torch.find dim arg only supports matrices for now")
assert(dim == 2, "torch.find only supports dim=2 for now")
local colSize, rowSize = tensor:size(1), tensor:size(2)
... | nilq/small-lua-stack | null |
ENT.Type = "ai"
ENT.Base = "base_ai"
ENT.PrintName = "Prison Warden"
ENT.Author = "Owain Owjo"
ENT.Category = "The XYZ Network Custom Stuff"
ENT.Spawnable = true
ENT.AdminSpawnable = true
| nilq/small-lua-stack | null |
local colors = require('colors')
local os = require('os')
local c = require('component')
local noop = function() end
local setPal = c and c.gpu and c.gpu.setPaletteColor or noop
if not setPal then
printError('Error: 99_color_palette.lua is unable to find the current gpu')
os.sleep(4)
end
-- Monokai theme
setPal... | nilq/small-lua-stack | null |
class("MapInstance" , MapEditor)
-- I borrowed this code from an ancient version of Racing, which was borrowed from when I was new at
-- Lua and playing around with tables. Let's hope me from 2 years ago wasn't an idiot.
MapEditor.MapInstance.CopyTable = function(t , copiedTables)
-- this will be returned as the... | nilq/small-lua-stack | null |
----------------------------
-- LORE Premake5 script --
----------------------------
targetdir "../bin/%{cfg.buildcfg}/Run"
objdir "../bin/%{cfg.buildcfg}/Obj"
debugdir "../bin/%{cfg.buildcfg}/Run"
includedirs { ".",
"%{prj.location}",
"%{sln.location}/External",
"%{sln.locat... | nilq/small-lua-stack | null |
-- internationalization boilerplate
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
-- Note: diggers go in group 3 and have an execute_dig method.
local digger_nodebox = {
{-0.5, -0.5, 0, 0.5, 0.5, 0.4375}, -- Block
{-0.4375, -0.3125, 0.4375, 0.4375, 0.3125, ... | nilq/small-lua-stack | null |
function getTableKeys(tab)
local keyset = {}
for k,v in pairs(tab) do
keyset[#keyset + 1] = k
end
return keyset
end
FsmMachine = {}
function FsmMachine:New(opts)
opts = opts or {}
self.__index = self
local o = setmetatable({}, self)
o.states = {}
o.curState = nil
o.debug = opts["d... | nilq/small-lua-stack | null |
--[[
Author: Noya
Date: April 5, 2015
Get a point at a distance in front of the caster
]]
function GetFrontPoint( event )
local caster = event.caster
local fv = caster:GetForwardVector()
local origin = caster:GetAbsOrigin()
local distance = event.Distance
local front_position = origin + fv * distance
local r... | nilq/small-lua-stack | null |
--ZFUNC-clamp-v1
local function clamp( num, min, max ) --> res
if num < min then return min
elseif num > max then return max
else return num
end
end
return clamp
| nilq/small-lua-stack | null |
monitoring.wrap_global({"minetest", "set_node"}, "set_node")
| nilq/small-lua-stack | null |
-- vshard.util
local log = require('log')
local fiber = require('fiber')
local lerror = require('vshard.error')
local lversion = require('vshard.version')
local lmsgpack = require('msgpack')
local MODULE_INTERNALS = '__module_vshard_util'
local M = rawget(_G, MODULE_INTERNALS)
if not M then
--
-- The module is... | nilq/small-lua-stack | null |
#!/usr/bin/env lua
require "ex"
for e in assert(os.dir(".")) do
print(string.format("%.3s %9d %s", e.type or 'Unknown', e.size or -1, e.name))
end
--[[
local f,s,i = assert(os.dir(".."))
print(f,s,i)
i=assert(f(s,i))
for e in f,s,i do
print(e.name,e.type,e.size)
end
--]]
| nilq/small-lua-stack | null |
require "model"
-- Make sure that model exists
assert(model, "Model namespace does not exist")
-- Create a sample user model with username, password, and usgn
User = model{
"user", -- Table name, lowercase
username = model.CharField{max_length = 10, null = false, unique = true},
password = model.CharField{max_leng... | nilq/small-lua-stack | null |
import "darkroom"
(terralib.loadfile("test.t"))()
width = 584
height = 388
--local frame1 = orion.image(orion.type.uint(8),width,height)
local frame1 = testinput
im vectorField(x,y) [uint8[3]]( {frame1(x,y),frame1(x,y)+3,0} ) end
test({vectorField, im(x,y) [uint8[3]]( {(frame1(x,y))*50+128, (frame1(x,y))*50+12,0})... | nilq/small-lua-stack | null |
--[[--
h1. four.Effect
An effect defines either a configuration of the graphics pipeline
or a list of Effects for rendering a Geometry object.
--]]--
local lub = require 'lub'
local four = require 'four'
local lib = lub.class 'four.Effect'
local Color = four.Color
local Effect = lib
-- Meta table to detect ... | nilq/small-lua-stack | null |
if (CLIENT) then
net.Receive("GPM.Where_Are_You?", function()
net.Start( "GPM.Where_Are_You?" )
net.WriteString( system.GetCountry():lower() )
net.SendToServer()
end)
end
local default_language = "gb"
local cvar = GetConVar( "default_language" )
if (cvar) then
default_language... | nilq/small-lua-stack | null |
-- Bahama Mamas: -1388.0013, -618.41967, 30.819599
exports('GetBahamaMamasObject', function()
return BahamaMamas
end)
BahamaMamas = {
ipl = "hei_sm_16_interior_v_bahama_milo_",
Enable = function(state)
EnableIpl(BahamaMamas.ipl, state)
end
}
| nilq/small-lua-stack | null |
local lu = require('luaunit')
print( lu.EPS )
local pi_div_6_deg_expected, pi_div_6_deg_calculated, pi_div_3_deg_expected, pi_div_3_deg_calculated
pi_div_6_deg_calculated = math.deg(math.pi/6)
pi_div_6_deg_expected = 30
pi_div_3_deg_calculated = math.deg(math.pi/3)
pi_div_3_deg_expected = 60
print( (pi_div_6_deg_... | nilq/small-lua-stack | null |
local function GetInserterImage(path)
return "__MomoPyTweak__/graphics/entity/inserter/" .. path .. ".png"
end
local function ConvertSpriteToOnlyHR(sprite)
if (sprite.hr_version) then
sprite.filename = sprite.hr_version.filename
sprite.width = sprite.hr_version.width
sprite.height = sprite.hr_version.height
e... | nilq/small-lua-stack | null |
-- Settings, Using Global Variables
-- Apple
gapple_apple = "default:apple"
-- Exteriors
gapple_gold = "default:gold_ingot"
gapple_steel = "default:steel_ingot"
gapple_copper = "default:copper_ingot"
gapple_diamond = "default:diamond"
gapple_mese = "default:mese_crystal"
gapple_obsidian = "default:obsidian_block"
--... | nilq/small-lua-stack | null |
local teleports = {
[2150] = {text = 'Entering Ushuriel\'s ward.', newPos = Position(33158, 31728, 11), storage = 0, alwaysSetStorage = true}, -- to ushuriel ward
[2151] = {text = 'Entering the Crystal Caves.', bossStorage = 200, newPos = Position(33069, 31782, 13), storage = 1}, -- from ushuriel ward
[2152] = {text... | nilq/small-lua-stack | null |
local S = aurum.get_translator()
gemai.register_action("aurum_npcs:avatar_caligula_attack_modify", function(self)
local nearby = math.max(1, aurum.mobs.helper_nearby_players(self))
self.data.regen_rate = nearby * 10
end)
aurum.mobs.register("aurum_npcs:avatar_caligula", {
description = S"Avatar of Caligula",
herd... | nilq/small-lua-stack | null |
--[[ Copyright (C) 2018-2019 Google Inc.
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 2 of the License, or
(at your option) any later version.
This program is distributed in the ho... | nilq/small-lua-stack | null |
--Make sure the commonjs loader pattern is in
require '../node-resolve'
--Make sure you `npm install luadash` first
local __ = require 'luadash'
local input = {1, 2, 3}
print("in: ", table.concat(input, ", "))
function double (value)
return value * 2
end
print("out: ", table.concat(__.map(double, input), ", "))
| 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.