content stringlengths 5 1.05M |
|---|
function assertArgumentIsElement(variable, argumentNumber)
if isElement(variable) then return true end
local variableType = getVariableType(variable)
if argumentNumber then
error(
string.format(
"expected element at argument %d, got %s", argumentNumber, variableType
... |
--[[
More Blocks: registrations
Copyright © 2011-2020 Hugo Locurcio and contributors.
Licensed under the zlib license. See LICENSE.md for more information.
--]]
local S = moreblocks.S
local descriptions = {
["micro"] = "Microblock",
["slab"] = "Slab",
["slope"] = "Slope",
["panel"] = "Panel",
["stair"] = "Stair... |
local Debug = require(script.Parent.Parent.Parent.Debug)
local Typer = require(script.Parent.Parent.Parent.Typer)
local copy = require(script.Parent.copy)
local Debug_Assert = Debug.Assert
local function noUpdate(value)
return value
end
local function call(callback, ...)
if type(callback) == "function" then
retu... |
--[[
Copyright 2021 Manticore Games, Inc.
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, publish, distrib... |
EditorGameDirection = EditorGameDirection or class(MissionScriptEditor)
function EditorGameDirection:create_element()
self.super.create_element(self)
self._element.class = "ElementGameDirection"
end
|
package.path="?/init.lua;"..package.path
-- Note: you need 2 computers to test this! Broadcast does not on local host!
-- I have tested this code and it works, but only on seperate PC's within the same LAN network
require("bin")
require("multi")
require("net")
server=net:newServer(12345)
server.OnDataRecieved(function(... |
local M = {}
function M.is_buffer_empty()
-- Check whether the current buffer is empty
return vim.fn.empty(vim.fn.expand('%:t')) == 1
end
function M.has_width_gt(cols)
-- Check if the windows width is greater than a given number of columns
return vim.fn.winwidth(0) / 2 > cols
end
function remap(x, noremap, s... |
function isemptydir(directory,nospecial)
for filename in require('lfs').dir(directory) do
if filename ~= '.' and filename ~= '..' then
return false
end
end
return true
end
|
function general (dt)
if love.keyboard.isDown("escape") then
love.event.quit()
end
imgToNotBeDrawn = {}
if love.keyboard.isDown("f11") and keyf11pressed == false then
keyf11pressed = true
if fullscren==false then
local a = love.graphics.getWidth()
local b = love.graphics.getHeight()
love.window.setM... |
mod_statusbar.create{
screen=0, pos='bl', fullsize=true, systray=true,
template=" [ %date ] [ load: %>load ] %filler%systray",
}
mod_statusbar.launch_statusd{
date={ date_format='%a %Y-%m-%d %H:%M', },
load={ },
}
|
-- NoIndex: true
--local Properties = require("tab_Properties")
local Sidebar = {}
-- Moved to main script so they can be global; avoids a circular dependency
-- Sidebar_w = 272
-- function Sidebar_ref_x() return (GUI.cur_w or GUI.w or gfx.w) - Sidebar_w end
-- Adjust the sidebar and its contents when the window is... |
-- mud
-- mud example application
function uses_examples()
includedirs {
path.join(MUD_DIR, "example"),
}
end
mud.examples = {}
mud.examples.all = mud_module(nil, "example", MUD_DIR, "example", nil, uses_examples, false, {}, true)
if _OPTIONS["renderer-bgfx"] then
--mud_binary("mud_exampl... |
local size = tonumber(ARGV[1])
local jobs = redis.call('LRANGE', KEYS[1], 0, size-1)
local len_before = redis.call('LLEN', KEYS[1])
if table.getn(jobs) > 0 then
local queue_key = KEYS[2]
redis.call('RPUSH', queue_key, unpack(jobs))
redis.call('LTRIM', KEYS[1], size, -1)
end
local len_after = redis.call('LLEN', ... |
local actions = require('telescope.actions')
local action_state = require('telescope.actions.state')
local finders = require('telescope.finders')
local make_entry = require('telescope.make_entry')
local pickers = require('telescope.pickers')
local utils = require('telescope.utils')
local conf = require('telescope.conf... |
----------------------------------------------------------------------------------------------------
-- localized Spanish (mounts module) strings
--
--get the add-on engine
local Engine = _G.Cecile_QuickLaunch;
--Spanish or Latin America Spanish
local L = LibStub("AceLocale-3.0"):NewLocale(Engine.Name, "esES")
if not... |
local utils = require('utils')
utils.map('n', '<Space>', '')
vim.g.mapleader = ' '
utils.map('i', 'jk', '<Esc>')
utils.map('n', '<leader><esc>', ':nohlsearch<CR>')
-- Telescope
-- Find files using Telescope command-line sugar.
utils.map('n', '<leader>pf', '<cmd>Telescope find_files<CR>')
utils.map('n', '<leader>sp',... |
--[[**********************************
*
* Multi Theft Auto - Admin Panel
*
* client\main\admin_options.lua
*
* Original File by lil_Toady
*
**************************************]]
aOptionsTab = {}
function aOptionsTab.Create(tab)
aOptionsTab.Tab = tab
guiCreateHeader(0.03, 0.05, 0.10, 0.05, "Main:", true, a... |
--- Native Lua implementation of filesystem and platform abstractions,
-- using LuaFileSystem, LuaSocket, LuaSec, lua-zlib, LuaPosix, MD5.
-- module("luarocks.fs.lua")
local fs_lua = {}
local fs = require("luarocks.fs")
local cfg = require("luarocks.core.cfg")
local dir = require("luarocks.dir")
local util = require... |
function love.load()
--- Sprites
sprites = {}
sprites.pusto = love.graphics.newImage('sprites/pusto.png')
sprites.nps = love.graphics.newImage('sprites/zombie.png')
sprites.coin_sheet = love.graphics.newImage('sprites/coin_sheet.png')
sprites.player_jump = love.graphics.newImage('sprites/444.png')
... |
local B = class("BaseView")
function B:ctor(pkgName, uiName)
self._pkgName = pkgName;
self._uiName = uiName;
self._hasShowUI = false;
local pkg = UIPackage.GetByName(self._pkgName)
if pkg then
self:_onUILoaded()
else
local _this = self
UIManager.AddPackage(self._pkgName,... |
local abs = math.abs
local scrollbarColor = tocolor(255, 255, 255, 50)
local SCROLLBAR_THRESHOLD = 10 -- in pixels
function onMove ( _, _, cX, cY )
if not (pressedButton and scrollbar and tobool(getUserConfig("dragmeterEnabled"))) then return end
if not scrollbar.thresholdReached then
if not( abs(scro... |
local E, C, L = select(2, ...):unpack()
if not C.stats.enable or not C.stats.config.Durability.enable then return end
----------------------------------------------------------------------------------------
-- Durability of DataText (modified from ShestakUI)
-----------------------------------------------------------... |
return PlaceObj("ModDef", {
"title", "Fix Flying Drones MidAir Malfunction",
"id", "ChoGGi_FixFlyingDronesMidAirMalfunction",
"steam_id", "2473394779",
"pops_any_uuid", "88b79b2c-a54b-4f9b-8d58-9e69e03def3b",
"lua_revision", 1007000, -- Picard
"version", 1,
"version_major", 0,
"version_minor", 1,
"image", "Pre... |
__game_font_styles =
{
Help = T{984, --[[Help]] "SchemeBk, 15, aa"},
HelpHint = T{986, --[[HelpHint]] "SchemeBk, 16, aa"},
PopupTitle = T{8572, --[[PopupTitle]] "LibelSuitRg, 30, aa"},
PopupDescr = T{8573, --[[PopupDescr]] "SchemeBk, 18, aa"},
HexChoice = T{8574, --[[HexChoice]] "SchemeBk, 16, aa"},
RolloverTi... |
local ch = minetest.mod_channel_join("multiserver")
local rq = 0
local cb = {}
multiserver.do_rpc = function(msg, cbf)
local data = multiserver.tohex(rq) .. " " .. msg
rq = rq + 1
ch:send_all(data)
cb[rq] = cbf
end
minetest.register_on_modchannel_message(function(channel_name, sender, msg)
if channel_name ~= "mu... |
-- Copyright © 2016 g0ld <g0ld@tuta.io>
-- This work is free. You can redistribute it and/or modify it under the
-- terms of the Do What The Fuck You Want To Public License, Version 2,
-- as published by Sam Hocevar. See the COPYING file for more details.
-- Quest: @Rympex
local sys = require "Libs/syslib"
local ga... |
-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * --
group ""
project "modus_launcher"
targetname "%{prj.name}"
targetdir "%{wks.location}/bin-lib/%{cfg.platform}/%{cfg.buildcfg}/"
objdir "%{wks.location}/bin-obj/%{cfg.platform}/%{cfg.buildcfg}/"
location... |
local os = os
local theme = {}
theme.dir = os.getenv("HOME") .. "/.config/awesome"
theme.wallpaper = theme.dir .. "/wall.png"
theme.font = "xos4 Terminus 9"
theme.fg_normal = "#DDDDFF"
theme.fg_focus = "#EA6F81"
theme.fg_urgent = "#CC9393"
theme.bg_normal = "#1A1A1A"
theme.bg_focus = "#313131"
theme.bg_urgent = "#1A1A1... |
DoReady.Warlock.Affliction.MythicPlus.Fortified.Legendarys = {
[1] = 356362,
[2] = 337128,
[3] = 337122,
[4] = 337057,
[5] = 337020,
[6] = 337106,
[7] = 337111,
[8] = 356259,
[9] = 356342,
[10] = 337141,
}
DoReady.Warlock.Affliction.MythicPlus.Fortified.Talents = {
[1] = 198590,
[2] = 196102,
[3] = 108416,
[4] = 196226... |
--[[
OEML - REST API
This section will provide necessary information about the `CoinAPI OEML REST API` protocol. This API is also available in the Postman application: <a href=\"https://postman.coinapi.io/\" target=\"_blank\">https://postman.coinapi.io/</a>
The version of the OpenAPI document: v1
Con... |
local f = CreateFrame("Frame")
f:SetScript("OnEvent", function()
local c = 0
for b=0,4 do
for s=1,GetContainerNumSlots(b) do
local l = GetContainerItemLink(b, s)
if l then
local p = select(11, GetItemInfo(l))*select(2, GetContainerItemInfo(b, s))
if select(3, GetItemInfo(l))==0 then
UseContainerI... |
local skynet = require "skynet"
local skymgr = require "skynet.manager"
skynet.start(function()
skymgr.abort()
end)
|
--[[
* The MIT License
* Copyright (C) 2011 Derick Dong (derickdong@hotmail.com). All rights reserved.
*
* 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
* with... |
frozen = false
-- Freeze (stops players from moving)
function tvRP.toggleFreeze()
frozen = not frozen
if frozen then
FreezeEntityPosition(GetPlayerPed(-1), true)
else
FreezeEntityPosition(GetPlayerPed(-1), false)
end
end |
--
local base = require('imgui.widgets.Window')
---@class icp.AssetManager:im.Window
local M = class('icp.AssetManager', base)
local im = imgui
local wi = require('imgui.Widget')
local ins
---@return icp.AssetManager
function M:getInstance()
ins = ins or M()
return ins
end
function M:ctor()
base.ctor(self,... |
-----------------------------------------------------------------------------
-- Warning: -
-- If you edit the files below, do not request support if something breaks! -
-----------------------------------------------------------------------------
-- API ... |
local config = require 'config'
local u = require 'utilities'
local api = require 'methods'
local JSON = require 'dkjson'
local plugin = {}
local function save_data(filename, data)
local s = JSON.encode(data, {indent = true})
local f = io.open(filename, 'w')
f:write(s)
f:close()
end
local function lo... |
--[[
defineComponent is a utility function for defining a component. Given an
argument table, it creates a component class.
The argument table should have the following keys:
- name (string)
- generator (() -> table)
- entityFilter (entity -> bool)
The name must be a string; there are no ... |
SMA="SMA"
WMA="WMA"
EMA="EMA"
SMMA="SMMA"
WILLMA="WILLMA"
Settings=
{
Name = "**NRTR_LUA",
period = 21,
multiple = 0.7,
value_type = "ATR",
showNRTR = 0,
line =
{
{
Name = "NRTR_buy",
Color = RGB(40,240,250),
Type = TYPE_POINT,
Width = 4
},
{
Name = "NRTR_sell",
Color = RGB(255,0,255),
Ty... |
-- Written by SolarCrane
local HEALTH_BACKGROUND_COLOR = Color3.new(228/255, 236/255, 246/255)
local HEALTH_RED_COLOR = Color3.new(255/255, 28/255, 0/255)
local HEALTH_YELLOW_COLOR = Color3.new(250/255, 235/255, 0)
local HEALTH_GREEN_COLOR = Color3.new(27/255, 252/255, 107/255)
local MIN_COLOR_POSITION = 0.1
local M... |
local Q = require 'Q'
local calc_benefit = require 'Q/ML/DT/lua/calc_benefit'
local chk_params = require 'Q/ML/DT/lua/chk_params'
local is_in = require 'Q/UTILS/lua/is_in'
local function check_extract_goal(
T, -- table of m lvectors of length n, indexed as 1, 2, 3, ...
g, -- lVector of length n
ng,
is_goal_rea... |
--- 模块功能:DTU主逻辑
-- @author openLuat
-- @module create
-- @license MIT
-- @copyright openLuat
-- @release 2018.12.27
require "pm"
require "iic"
require "sms"
require "pins"
require "misc"
require "mqtt"
require "utils"
require "lbsLoc"
require "socket"
require "update"
require "httpv2"
require "gpsv2"
require "common"
r... |
--[[
HTTP Header data structure/type
Design criteria:
- the same header field is allowed more than once
- must be able to fetch seperate occurences (important for some headers e.g. Set-Cookie)
- optionally available as comma seperated list
- http2 adds flag to headers that they should never be indexed
... |
ITEM.name = "Browing Hi-Power"
ITEM.desc = "Модифицированная модель пистолета первой половины 20-ого века, которая такая же надежная, точная и мощна, как оригинальный образец. Эта модель получила репутацию одного из лучших пистолетов 20-ого века и пользуется большой популярностью среди сталкеров. \n\nБоеприпасы 9х19"... |
NOOP = function() end
local input = require "input"
local log = require "lib.log"
local lume = require "lib.lume"
local profi = require "lib.profi"
log.usecolor = love.system.getOS() ~= "Windows"
lg = love.graphics
lg.quad = lume.memoize(lg.newQuad)
lm = love.math
lc = love.mouse
la = love.audio
lt = love.timer
State... |
function momoTweak.recipe.Silver()
local AddIng = momoIRTweak.recipe.SafeAddIngredient
local ITEM = momoIRTweak.FastItem
local FLUID = momoIRTweak.FastFluid
local NEWComplex = momoIRTweak.recipe.NewComplexRecipe
local UnlockAt = momoIRTweak.recipe.UnlockAtRef
local fluidName = momoTweak.fluid
-- add liquid cop... |
_G.LuaNetworking = _G.LuaNetworking or {}
LuaNetworking.HiddenChannel = 4
LuaNetworking.AllPeers = "GNAP"
LuaNetworking.AllPeersString = "{1}/{2}/{3}"
LuaNetworking.SinglePeer = "GNSP"
LuaNetworking.SinglePeerString = "{1}/{2}/{3}/{4}"
LuaNetworking.ExceptPeer = "GNEP"
LuaNetworking.ExceptPeerString = "{1}/{2}/{3}/{4}... |
--This program demonstrates how to use digital lines as simple counters.
--Most commonly users should throttle their code execution using the functions:
--'LJ.IntervalConfig(0, 1000)', and 'if LJ.CheckInterval(0) then' ...
--Array indeces 1-23 correspond with DIO0-22 as the following:
--Index: 1 Channel... |
-- (c) Fabien Fleutot, 2014.
-- Released under the MIT public license.
--- @module victron.bmv
-- Reads and decodes Victron BMV60x frames.
--
-- This module generates specific instances of the more generic handlers
-- provided by `victron.ve-direct`: it acquires the frames by pairs
-- (a snapshot frame and an hist... |
local CorePackages = game:GetService("CorePackages")
local Roact = require(CorePackages.Roact)
local RoactRodux = require(CorePackages.RoactRodux)
local Components = script.Parent.Parent.Parent.Components
local ServerStatsChart = require(Components.ServerStats.ServerStatsChart)
local UtilAndTab = require(Components.Ut... |
--[[
WEAPON ICONS
Icons by default are resources searched in the texture table. In order
to link one of these icons to a weapon, you need to add an entry on
the 'WeaponIcons' table.
But because it's not recommended to edit the default skin in order to add
more icons, they can be added as if they were text... |
for i,v in ipairs({
{4103,1019.9004,-2177.5996,19.7,0,0,175.995,3,121, false},
{9339,978.40039,-2127.2998,27.7,0,0,86.248,3,121, false},
{9339,964.70001,-2139.3,27.7,0,0,356.248,3,121, false},
{9339,990.5,-2141,27.7,0,0,356.243,3,121, false},
{9339,976.7998,-2153,27.7,0,0,266.243,3,121, false},
... |
vim.opt_local.colorcolumn = ""
|
--[=[
A BaseObject basically just adds the `:Destroy()` interface, and a `Janitor`, along with an optional object it references.
@class BaseObject
]=]
local Janitor = require(script.Parent.Parent.Parent.Janitor)
local BaseObject = {}
BaseObject.ClassName = "BaseObject"
BaseObject.__index = BaseObject
--[=[
Constr... |
local PartyPoseUI =
{
Name = "PartyPose",
Type = "System",
Namespace = "C_PartyPose",
Functions =
{
{
Name = "GetPartyPoseInfoByMapID",
Type = "Function",
Arguments =
{
{ Name = "mapID", Type = "number", Nilable = false },
},
Returns =
{
{ Name = "info", Type = "PartyPoseInfo", Ni... |
-- -*- lua -*-
-- Module file created by Pawsey
--
whatis([[Name : singularity-hpc]])
whatis([[Version : 0.0.37]])
whatis([[Short description : Local filesystem registry for containers (intended for HPC) using Lmod or Environement Modules. Works for users and admins. ]])
help([[Local filesystem registry for container... |
local formats = { details = {} }
-- Common object properties.
formats.Object = [[
used:b1
class:u1
subclass:u1
detail_index:u2
xref_index:u2
prev:u2
next:u2
x:p2,8
y:p2,8
z:u1
pitch:u1
yaw:u1
roll:u1
ai_maybe:u1
type:u1
hp_maybe:u2
state:u1
unknown:s3
]]
-- Weapons.
formats[0] = [[... |
--------------------------------------------------------------------------------
-- Array Support
-- Original author: Unknown (But the Wiki mentions Erkle)
-- Rewritten by Divran at 2010-12-21
--------------------------------------------------------------------------------
---------------------------------------------... |
local ChatInfo =
{
Name = "ChatInfo",
Type = "System",
Namespace = "C_ChatInfo",
Functions =
{
{
Name = "GetChannelRosterInfo",
Type = "Function",
Arguments =
{
{ Name = "channelIndex", Type = "number", Nilable = false },
{ Name = "rosterIndex", Type = "number", Nilable = false },
},
... |
-- Automation 4 test file
-- Create a Macro feature, that displays some text
script_name = "Automation 4 test 1"
script_description = "Hello World in Automation 4/Lua"
script_author = "Niels Martin Hansen"
script_version = "1"
function macro_test1(subtitles, selected_lines, active_line)
--aegisub.debug.out(3, "Hel... |
--[[
管理玩家的个人信息
]]
GamePlayerManager2 = class(DataInterfaceBase);
GamePlayerManager2.Delegate = {
onPlayerInfoChanged = "onPlayerInfoChanged";
onPlayerPropertyChanged = "onPlayerPropertyChanged";
onPlayerIdentityChanged = "onPlayerIdentityChanged";
};
GamePlayerManager2.getInstance ... |
-- This simply returns ABI information
-- Makes it easier to substitute for non-ffi solution, eg to run tests
local require, error, assert, tonumber, tostring,
setmetatable, pairs, ipairs, unpack, rawget, rawset,
pcall, type, table, string =
require, error, assert, tonumber, tostring,
setmetatable, pairs, ipairs, unp... |
// Generated by github.com/davyxu/tabtoy
// Version: 2.8.10
module table {
export var PalaceMap : table.IPalaceMapDefine[] = [
{ Id : 1, Name : "永和宫", BannerPath : "Image/GameScene/Palace/image_palaceCard1", UlockPath : "Image/GameScene/Palace/image_palaceunlock1", Lockpath : "Image/GameScene/Palace/image_palacelock... |
--------------------------------
-- @module VertexStepMode
-- @parent_module ccb
--- Enum ccb.VertexStepMode
---@class ccb.VertexStepMode
local VertexStepMode = {}
ccb.VertexStepMode = VertexStepMode
---@type number
VertexStepMode.VERTEX = 0
---@type number
VertexStepMode.INSTANCE = 1
return nil
|
g_ItemPrecache = {
"item_bubble_orb_1",
"item_stoneskin",
"item_greater_phase_boots",
"item_greater_power_treads",
"item_greater_tranquil_boots",
"item_dagon",
"item_vampire",
"item_regen_crystal_1",
"item_trumps_fists",
"item_enrage_crystal_1",
"item_dagger_of_moriah",
"item_dispel_orb_1",
"i... |
local Directions = assert(foundation.com.Directions)
local Vector3 = assert(foundation.com.Vector3)
local Cuboid = assert(foundation.com.Cuboid)
local ng = Cuboid.new_fast_node_box
local g_inventory_id = 0
local function create_inventory(self)
g_inventory_id = g_inventory_id + 1
local inventory_name = "yatm_armou... |
--------------------------------
-- @module TransitionCrossFade
-- @extend TransitionScene
-- @parent_module cc
--------------------------------
-- Creates a transition with duration and incoming scene.<br>
-- param t Duration time, in seconds.<br>
-- param scene A given scene.<br>
-- return A autoreleased Transitio... |
-- Natural Selection 2 Competitive Mod
-- Source located at - https://github.com/xToken/CompMod
-- lua\CompMod\CommAbilities\HallucinationCloud\shared.lua
-- - Dragon
HallucinationCloud.kRadius = kHallucinationCloudRadius |
function saida()
for i=1,101,1
do
if (i%2==0) then
io.write(i,"\n")
end
end
end
function main()
saida()
end
main() |
-- Takes a JSON value and sets it to the root using msgpack
local js = ARGV[1]
local v = cjson.decode(js)
local mp = cmsgpack.pack(v)
redis.call('SET', KEYS[1], mp)
return 'OK'
|
local filesystem = require('filesystem')
local fse = require('fs-extra')
local LOG_DIRECTORY = '/var/log/'
local LOG_EXTENSION = 'log'
local createLogger = function(loggerName, withStackTrace)
if isNotString(loggerName) or isEmpty(loggerName) then error('invalid loggerName') end
if withStackTrace == nil then
... |
local load_crafting_queue = require("modules/inventory_sync/load_crafting_queue")
function restore_crafts(event)
if event.player_index then
local player = game.get_player(event.player_index)
local crafting_queue = global.inventory_sync.saved_crafting_queue[player.name]
if crafting_queue == nil then
player.p... |
ithorian_defender_armor_leggings = {
minimumLevel = 0,
maximumLevel = -1,
customObjectName = "",
directObjectTemplate = "object/tangible/wearables/armor/ithorian_defender/ith_armor_s01_leggings.iff",
craftingValues = {
{"armor_rating",1,1,0},
{"blasteffectiveness",10,45,10},
{"armor_effectiveness",8,29,10},
... |
if GetLocale() ~= "zhTW" then return end
local L
---------------------------
-- The Restless Cabal --
---------------------------
L= DBM:GetModLocalization(2328)
L:SetMiscLocalization({
Zaxasj = "札克沙吉",
Fathuul = "法蘇爾"
})
---------------------------
-- Uu'nat, Harbinger of the Void --
---------------------------
... |
-- LuaJIT implementation Limited memory BFGS (L-BFGS), based on libLBFGS
-- Copyright (c) 1990, Jorge Nocedal
-- Copyright (c) 2007-2010 Naoaki Okazaki
-- Copyright (c) 2014 Stefano peluchetti
-- All rights reserved.
-- TODO:
-- + method proposed by More and Thuente
-- + stop criteria (delta and past parameters)
loca... |
-----------------------------------------------------
--name : lib/drivers/stdio.lua
--description: adds /dev/stdin, /dev/stdout and /dev/stderr
--author : mpmxyz
--github page: https://github.com/mpmxyz/ocprograms
--forum page : none
-----------------------------------------------------
--loading libraries
... |
require 'luacov'
local _ = require 'moses'
context('Table functions specs', function()
context('clear', function()
test('', function()
local t = _.clear({'a', true, 'hello'})
assert_true(_.isEqual(t,{}))
assert_nil(next(t))
end)
end)
context('each', function()
test('provides values and i... |
lfs = require ("lfs")
FileMonitor = {};
--[[funcao que retorna o nome dos arquivos dentro de um diretorio ]]
function FileMonitor.le_diretorio (path,extension)
files = {};
print(path .. ' file monitor')
for file in lfs.dir(path) do
if file ~= "." and file ~= ".." and string.sub(file,-4) == ext... |
return {
id = 22,
x1 = 1,
x2 = 2,
x3 = {
x1 = 3,
},
x4 = {
_name = 'DemoD2',
x1 = 1,
x2 = 2,
},
s1 = "asfs",
s2 = {key='/asf/asfa',text="abcdef"},
} |
--[[
* MOCK framework for Moai
* Copyright (C) 2012 Tommo Zhou(tommo.zhou@gmail.com). All rights reserved.
*
* 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
*... |
local n_name, NeP = ...
NeP.Config = {}
local Data = {}
NeP.Listener:Add("NeP_Config", "ADDON_LOADED", function(addon)
if addon:lower() == n_name:lower() then
NePDATA = NePDATA or {}
Data = NePDATA
end
end)
function NeP.Config.Read(_, a, b, default)
return Data[a] and Data[a][b] or default
end
function NeP.C... |
function onCreate()
-- background shit
makeLuaSprite('comicglitch', 'comicglitch', -600, -300);
setScrollFactor('comicglitch', 0.9, 0.9);
addLuaSprite('comicglitch', false);
close(true); --For performance reasons, close this script once the stage is fully loaded, as this script won't be used anymore after loadi... |
local fn = vim.fn
local g = vim.g
local o, wo, bo = vim.o, vim.wo, vim.bo
-- Bootstrap paq
local install_path = fn.stdpath('data')..'/site/pack/packer/start/packer.nvim'
if fn.empty(fn.glob(install_path)) > 0 then
packerBootstrap = fn.system({'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvi... |
local coroutine = require "coroutine"
local math = require "math"
local nmap = require "nmap"
local shortport = require "shortport"
local stdnse = require "stdnse"
local comm = require "comm"
local vulns = require "vulns"
local http = require "http"
description = [[
Tests a web server for vulnerability to the Slowlor... |
local lunajson = require('libraries/lunajson')
-- Tilesetter map loading and drawing library
-- REQUIRES lunajson AND cargo
-- Made by Bardificer
MapCell = {
src = nil,
json = nil,
tile_size = 0,
map_width = 0,
map_height = 0,
funct = nil,
bkg = nil,
pos = nil,
sources = nil,
bk... |
local _ENV = {}
local components = {}
for _, value in pairs{
"luon",
"raycast",
"schematic",
"colorspec",
"media",
"encode_png",
} do
components[value] = value
end
for filename, comps in pairs{
misc = {
"max_wear",
"override",
"after",
"register_globalstep",
"form_listeners",
"register_form_listene... |
#!/usr/bin/env lua
local AXIUS = {
j2 = "HgHg PuFe ____ ____ CuNp PbAu ____ AuPb ____ AgUr ____ FePu ",
j3 = "HgSn ____ SnHg UrFe ____ PbAg ____ AuAu ____ AgPb ____ FeUr ",
j5 = "PbCu ____ AuSn ____ AgHg TiFe FeTi ____ ____ SnAu ____ CuPb ",
j6 = "HgAu ____ SnPb ____ CuUr PbSn ____ AuHg NpFe __... |
local menuactive = false
function ToggleActionMenu()
menuactive = not menuactive
if menuactive then
SetNuiFocus(true,true)
TransitionToBlurred(1000)
SendNUIMessage({ showmenu = true })
else
SetNuiFocus(false)
TransitionFromBlurred(1000)
SendNUIMessage({ hidemenu = true })
end
end
--[ BUTTON ]----------... |
local class = require 'middleclass'
local Object = class.Object
local Model = require 'core/graphics/Model'
local Material = class('core/graphics/GraphicalMaterial')
function Material:initialize()
self.overlayLevel = 0
self.programFamilyList = nil
self.shaderVariables = {}
end
function Materi... |
Button = Class("Button", Base)
--[[
-- Button.initialize
-- Room - The room that the object is allowed to exist in
-- X - The X position of the Button
-- Y - The Y position of the button
-- Text - The text that appears in the center of the button
-- Operation - The function that is executed when the button is clicked
... |
-- Copyright 2006-2021 Mitchell. See LICENSE.
-- Actionscript LPeg lexer.
local lexer = require('lexer')
local token, word_match = lexer.token, lexer.word_match
local P, S = lpeg.P, lpeg.S
local lex = lexer.new('actionscript')
-- Whitespace.
lex:add_rule('whitespace', token(lexer.WHITESPACE, lexer.space^1))
-- Keyw... |
--[[
Name: sponge mod
Vers: 1.0
Desc: adds minecraft style sponges to minetest
Auth: emjds
Date: 10/04/2017
Ghub: emjds
]]
--defines the search radius for the sponge
RANGE = 2
minetest.register_node("wetsponge:sponge",{
description = "Sponge",
tiles = {"wetsponge_sponge.png"},
groups = {crumbly=1,flamable=1,dig_im... |
-- Load support for Minebase translation.
local S = minetest.get_translator("buckets_river_water")
-- River water source is 'liquid_renewable = false' to avoid horizontal spread
-- of water sources in sloping rivers that can cause water to overflow
-- riverbanks and cause floods.
-- River water source is instead made ... |
local module = {
authenticationRequired = false;
};
function module.run(authentication,groupId)
local endpoint = "https://groups.roblox.com/v1/groups/"..groupId.."/roles";
local response,body = api.request("GET",endpoint,{},{},authentication,false,false);
return json.decode(body)["roles"];
end
return module; |
function draw()
imgui.Begin("Timing Line Hider")
state.IsWindowHovered = imgui.IsWindowHovered()
if imgui.Button("click me") then
local start = state.SongTime + 1
local stop = state.CurrentTimingPoint.StartTime + map.GetTimingPointLength(state.CurrentTimingPoint)
if stop - ... |
require("core/object");
require("core/eventDispatcher");
require("core/system");
require("common/nativeEvent");
require("ubReport/ubReport");
require("netWork/ServerConfig");
require("util/log");
require("common/httpModule");
require("common/commonLogic")
UploadImgLogic = class(CommonLogic);
UploadImgLogi... |
-- The stamina bar shown in the game screen.
local stamina_builder = {}
function stamina_builder:new(game, config)
local stamina = {}
stamina.dst_x, stamina.dst_y = config.x, config.y
stamina.max_width = game:get_value("max_stamina") or 100
stamina.amount_displayed = stamina.max_width
stamina.surface = so... |
--GPU: Canvas into window rendering.
--luacheck: push ignore 211
local Config, GPU, yGPU, GPUVars, DevKit = ...
--luacheck: pop
local lg = love.graphics
local events = require("Engine.events")
local coreg = require("Engine.coreg")
local Path = GPUVars.Path
local MiscVars = GPUVars.Misc
local VRamVars = GPUVars.VRam... |
local Transform = {}
Transform.__index = Transform;
-- A more-sane way to transform points
function Transform.new(x, y)
return setmetatable({
x = x or 0,
y = y or 0,
scalex = 1,
scaley = 1,
rotation = 0,
_id = 0,
_matid = -1,
_matcache = jge.Matrix3():const(),
_invid = -1,
_invcache = jge.Matrix3(... |
local assets =
{
--FE
Asset("ANIM", "anim/credits.zip"),
Asset("ANIM", "anim/credits2.zip"),
Asset("ATLAS", "bigportraits/locked.xml"),
Asset("IMAGE", "bigportraits/locked.tex"),
Asset("IMAGE", "images/customisation.tex" ),
Asset("ATLAS", "images/customisation.xml" ),
Asset("ATLAS... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.