content stringlengths 5 1.05M |
|---|
#!/usr/bin/env luajit
-- this file only exists so I have a filename that matches its output
os.execute'luajit "Kaluza-Klein - index.lua" varyingScalarField'
|
project "mpg123"
uuid "7adfafb9-0a83-4d35-9891-fb24fdf30b53"
language "C"
location ( "../../build/" .. mpt_projectpathname .. "/ext" )
mpt_projectname = "mpg123"
dofile "../../build/premake/premake-defaults-DLL.lua"
dofile "../../build/premake/premake-defaults.lua"
dofile "../../build/premake/premake-de... |
-- dependancies
local Vector3 = require("vector3");
-- CFrame class
local cframe = {__type = "cframe"};
local mt = {__index = cframe};
local prettyPrint = false; -- mainly for debug (not a feature in real CFrames)
-- built-in functions
local pi = math.pi;
local max = math.max;
local cos = math.cos;
local si... |
function error_404()
local page_length = 300
guiSetText(internet_address_label, "Error - Page not found - Waterwolf")
bg = guiCreateStaticImage(0,0,660,page_length,"websites/colours/1.png",false,internet_pane)
local image = guiCreateStaticImage(130,150,64,64,":help-system/info.png",false,bg)
local tex... |
-- lib/client/players.lua
function BSU.SendClientInfo()
net.Start("BSU_ClientInfo")
net.WriteString(system.IsWindows() and "Windows" or system.IsLinux() and "Linux" or system.IsOSX() and "macOS")
net.WriteString(system.GetCountry())
net.WriteInt((os.time() - BSU.UTCTime()) / 3600, 5)
net.SendToServer()... |
local opt = vim.opt
opt.autochdir = true
opt.cmdheight = 1
opt.colorcolumn = '80'
opt.completeopt = { 'menu', 'menuone', 'noselect' }
opt.cursorcolumn = true
opt.cursorline = true
opt.errorbells = false
opt.expandtab = true
opt.guicursor = ''
opt.hlsearch = false
opt.ignorecase = true
opt.number = true
opt.path:append... |
AddCSLuaFile()
-- Build
function SWEP:ModeBuildPrimary(ent, normal, x, y, z, alt)
if not normal then
return
end
ent:Set(x, y, z, nil)
end
function SWEP:ModeBuildSecondary(ent, normal, x, y, z, alt)
if not normal then
return
end
x = x + normal.x
y = y + normal.y
z = z + normal.z
if not self:CheckBound... |
-- This module is deprecated and must not be used.
-- This file serves as a tombstone to prevent old ip_score to be loaded
return |
name="login"
template="blank"
|
TEST [[
local <!x!>
function _(x)
end
function _()
<?x?>()
end
]]
TEST [[
function _(<!x!>)
do return end
<?x?>()
end
]]
TEST [[
local <!a!>
function a:b()
a:b()
<?self?>()
end
]]
--TEST [[
--function _(...)
-- function _()
-- print(<?...?>)
-- end
--end
--]]
TEST [[
local <!a!>
(<?... |
return {'neuken','neukpartij','neuraal','neuralgie','neuralgisch','neurastheen','neurasthenicus','neurasthenie','neurasthenisch','neurend','neurien','neuriend','neurobiologie','neurobioloog','neurochirurg','neurochirurgie','neurofysiologie','neurofysiologisch','neurologe','neurologie','neurologisch','neuroloog','neuron... |
local bench = script and require(script.Parent.bench_support) or require("bench_support")
bench.runCode(function()
for outer=1,28,3 do
for inner=1,28,3 do
local t2 = table.create(20, string.rep("n", outer))
local str = ""
for i=1,500 do
str = table.concat(t2, string.rep("!", inner))
end
assert(#s... |
ITEM.name = "Kantrael Pattern M36 Shotlas Black"
ITEM.description = "This is a standard issue Lasgun with a questionable modification to its barrel."
ITEM.model = "models/bloocobalt/dow/weapons/w_lasgun.mdl"
ITEM.class = "weapon_lasrifle_ig_shot"
ITEM.weaponCategory = "primary"
ITEM.width = 4
ITEM.height = 2
ITEM.price... |
return {--!addadmin
check = function (data)
return (data.msg:find("! *addadmin *.+") == 1 or data.msg:find("! *addadmin *.+") == 1) and
data.qq == Utils.Setting.AdminQQ
end,
run = function (data,sendMessage)
local keyWord = data.msg:match("(%d+)")
if keyWord and XmlApi.Get("adminList",keyWord) ==... |
local uuid = require("kong.tools.utils").uuid
local helpers = require "spec.helpers"
local timestamp = require "kong.tools.timestamp"
for _, strategy in helpers.each_strategy() do
describe("Plugin: rate-limiting (policies) [#" .. strategy .. "]", function()
describe("cluster", function()
local iden... |
require("lualib_bundle");
__TS__SourceMapTraceBack(debug.getinfo(1).short_src, {["4"] = 1,["5"] = 1,["6"] = 17,["7"] = 17,["8"] = 17,["9"] = 17,["10"] = 36,["11"] = 36,["12"] = 36,["14"] = 36,["15"] = 36,["17"] = 20,["18"] = 37,["19"] = 38,["20"] = 40,["21"] = 36,["27"] = 21,["36"] = 26,["45"] = 29,["47"] = 28,["48"] =... |
---------------------------------------------
-- Allows for hot-swappable classes
class = require("libs.sunclass")
---------------------------------------------
-- reloads modules
function reload(modulename)
local oldPackage = package.loaded[modulename]
package.loaded[modulename] = nil
local ret = {pcall... |
-- include useful files
u_execScript("utils.lua")
u_execScript("common.lua")
u_execScript("commonpatterns.lua")
u_execScript("nextpatterns.lua")
u_execScript("evolutionpatterns.lua")
u_execScript("ctpatterns.lua")
math.random()
-- this function adds a pattern to the timeline based on a key
function addPattern(mKey)
... |
local _, nMainbar = ...
local cfg = nMainbar.Config
MultiBarBottomLeft:SetAlpha(cfg.multiBarBottomLeft.alpha)
|
#!/usr/bin/env lua
local utils = require 'src.utils'
local gpio = require 'src.gpio'
local config = require 'src.config'
local function setup()
for _, pinID in pairs(config.leds) do
gpio.configureOutGPIO(pinID)
gpio.writeGPIO(pinID, 0)
end
for _, pinID in pairs(config.buttons) do
gpio.configureInGPI... |
local statsd = require("plugins.statsd_monitor.statsd")
local defer_to_timer = require("plugins.statsd_monitor.defer_to_timer")
local split = require("util.split")
local _M = {}
local function send_response_data(upstream_state, client_state)
local status_class
if upstream_state.status then
for i, status in ip... |
slot0 = class("YostarAlertView", import("...base.BaseSubView"))
slot0.getUIName = function (slot0)
return "YostarAlertView"
end
slot0.OnLoaded = function (slot0)
return
end
slot0.SetShareData = function (slot0, slot1)
slot0.shareData = slot1
end
slot0.OnInit = function (slot0)
slot0.yostarAlert = slot0._tf
slo... |
local f = function(xyz)
print('calling 1', xyz)
local foo = coroutine.yield()
print('calling 2', foo)
return 5
end
local x = coroutine.wrap(f)
x('bar')
x('zap')
-- x()
-- x()
|
ITEM.name = "Glowing Ceramic Plate"
ITEM.description = "A ceramic plate with a faint glow, could absorb most impacts against a body armor."
ITEM.model = "models/lostsignalproject/items/outfit_parts/ballistic8.mdl"
ITEM.category = "Attachments"
ITEM.width = 1
ITEM.height = 1
ITEM.upgradeIcon = Material("materials/vgui/u... |
CATEGORY_NAME = "PIXELCredits"
// Give Credits
function ulx.givecredits( calling_ply, target_ply, num )
if SERVER then
PIXEL.Credits.DebugLog(target_ply)
PIXEL.Credits.DB.GiveCredits(target_ply, num)
end
local name = "credits"
if num == "1" then name = "credit" end
ulx.fancyLogAdmi... |
require "test-setup"
require "lunit"
local Cairo = require "oocairo"
module("test.pdf_surface", lunit.testcase, package.seeall)
teardown = clean_up_temp_files
if Cairo.HAS_PDF_SURFACE then
local function check_pdf_surface (surface)
assert_userdata(surface)
assert_equal("cairo surface object", sur... |
languages = {
"Turkce",
}
flags = {
"tr",
}
function getLanguageName(language)
return languages[language] or 'Turkce'
end
function getLanguageCount()
return #languages
end
function getLanguageList()
return languages
end |
-- ffi.os, ffi.arch is not tested as that will vary by platform
-- same with other ffi.abi parameters, etc
local ffi = require("cffi")
if ffi.abi("be") then
assert(not ffi.abi("le"))
else
assert(ffi.abi("le"))
assert(not ffi.abi("be"))
end
if ffi.abi("64bit") then
assert(ffi.sizeof("void *") == 8)
el... |
function include_demo(name)
project(name)
location(name)
kind 'WindowedApp'
language 'C++'
cppdialect 'C++latest'
targetdir ('%{wks.location}/bin/' .. OutputDir)
objdir ('%{wks.location}/bin-int/' .. OutputDir .. '/%{prj.name}')
files { '%{prj.location}/src/**.cpp', '%{prj.location}/src/**.h' }
link... |
-- almost the same as process_fulfill.lua which is used to settle when balance is over the settlement threshold:
-- returns similarly the balance and the amount to settle, but is called with only the account id as the only argument.
--
-- upon completion the `balance` is at the level of `settle_to`
local accounts_key =... |
vt = voxtrees
vr = voxrnd
vs = voxsdl
function init (ctx)
local test = function (sample) return sample > 40 end
--[[
Build tree from a raw file 'skull.dat' in voxvision's system-wide data
directory. 'skull.dat' is provided as an example.
]]--
local tree = vt.read_raw_data (vt.find_data_file "sk... |
--- Tests for the @{LinkedList} class.
return function()
local module = game:GetService("ReplicatedStorage").Monolith
local LinkedList = require(module.LinkedList)
describe("Constructor", function()
it("should create an empty LinkedList", function()
local list = LinkedList.new()
expect(list:Empty()).to.equ... |
-- create node from file with cursor position
local filename = moon.gui.open_file_dlg("select scene node")
if filename then
local node = moon.scene.new_node(filename)
if node then
node:set_pos(moon.mouse.get_position())
end
end
|
local EventManager = require 'utils.EventManager';
local NetworkService = require "utils.NetworkService";
local ModuleDataArr = nil
local SnArr = {}
local function Set(data)
if data then
local temp = {
pid = data[1],
type = data[2],--1.好友2.好友黑名单3.特别关注4.陌生人黑名单
name = utils.SGKTools.matchingName(data[3]),
on... |
--[[
--MIT License
--
--Copyright (c) 2019 PapyElGringo
--Copyright (c) 2019 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 th... |
-- Standard awesome library
local gears = require("gears")
local awful = require("awful")
require("awful.autofocus")
-- Widget and layout library
local wibox = require("wibox")
-- Theme handling library
local beautiful = require("beautiful")
-- Notification library
local naughty = require("naughty")
local menubar = req... |
require 'pl'
local text = [[
981124001 2.0 18988.4 10047.1 4149.7
981125001 0.8 19104.0 9970.4 5088.7
981127003 0.5 19012.5 9946.9 3831.2
]]
local sum,count = seq.sum(input.fields ({3},' ',text))
print(sum/count)
|
local LibEvent = LibStub:GetLibrary("LibEvent.7000")
local addon = TinyTooltip
local function ColorBorder(tip, r, g, b)
if (addon.db.quest.coloredQuestBorder) then
LibEvent:trigger("tooltip.style.border.color", tip, r, g, b)
end
end
hooksecurefunc(ItemRefTooltip, "SetHyperlink", function(self, link)... |
local TXT = Localize{
[0] = " ",
[1] = "Door",
[2] = "Leave the Titan Stronghold",
[3] = "Chest",
[4] = "Button",
[5] = "Lever",
[6] = "Vault",
[7] = "Cabinet",
[8] = "Switch",
[9] = "",
[10] = "Bookcase",
[11] = "Strange Torch",
[12] = "Strange Torch",
[13] = "Cleric's Totem",
[14] = "You Successfully d... |
return {
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
desc_get = "",
name = "",
init_effect = "",
time = 5,
color = "yellow",
picture = "",
desc = "",
stack = 1,
id = 13921,
icon = 13920,
last_effect = "",
effect_list = {
{
type = "BattleBuffCastSkillRandom",
trigger = {
"onAttach"
},
... |
--[[
******************************************************************
* _____ ___ _ *
* ( _ ) ( _`\ _ ( )_ *
* | (_) | _ __ ___ | (_(_) ___ _ __ (_) _ _ | ,_) *
* | _ |( '__)/'___)`\__ \ /'___)( '__... |
laptop.register_theme("Fruit", {
desktop_background = "laptop_theme_fruit_desktop_background.png",
app_background = "laptop_theme_blue_app_background.png",
os_min_version = '6.33',
})
|
local utils = require "kong.tools.utils"
local filters = {}
function filters.by_request(conf, request)
local rules = {
function()
local method = request.get_method()
return not utils.table_contains(conf.request_method, method)
end,
}
for _, rule in ipairs(rules) do if rule() then return true... |
-- @Author: Ritesh Pradhan
-- @Date: 2016-04-10 20:45:50
-- Enemy: bird
-- This enemy doesn't fire back
local physics = require("physics")
local enemy = require("classes.enemy")
local utils = require('libs.utils')
local sounds = require( "libs.sounds" );
local _M = enemy:newEnemy({hp=5, health=4, type='birdEnemy... |
J = J or path.join
IF = IF or lake.choose or choose
function run(file, cwd)
print()
print("run " .. file)
if not TESTING then
if cwd then lake.chdir(cwd) end
os.execute( LUA_RUNNER .. ' ' .. file )
if cwd then lake.chdir("<") end
print()
end
end
function as_bool(v,d)
if v == nil then return... |
--[=[
Helper methods for cooldown
@class CooldownUtils
]=]
local require = require(script.Parent.loader).load(script)
local CooldownConstants = require("CooldownConstants")
local CooldownUtils = {}
function CooldownUtils.findCooldown(cooldownBinder, parent)
assert(cooldownBinder, "Bad cooldownBinder")
assert(ty... |
local ItemVariables = pExodus.ItemVariables
local ItemId = pExodus.ItemId
local rng = RNG()
pExodus.ItemId.CURSED_METRONOME = Isaac.GetItemIdByName("Cursed Metronome")
pExodus.CostumeId.CURSED_METRONOME = Isaac.GetCostumeIdByPath("gfx/characters/costume_Cursed Metronome.anm2")
pExodus:AddItemCostume(ItemId.CURSED_METR... |
RosettaRngState = State:new()
function RosettaRngState:needToRun(game_context, bot_context)
if game_context.battle.is_in_battle then
return false
end
bot_context.rng1 = mainmemory.read_u8(0x0562D4)
bot_context.rng2 = mainmemory.read_u8(0x0562D5)
bot_context.rng3 = mainmemory.read_u8(0x0562D6)
bot_co... |
--- `ds.Evaluation` class.
-- Evaluation of binary classifiers.
-- @classmod Evaluation
local Evaluation = {}
package.loaded['Evaluation'] = Evaluation
Evaluation.__index = Evaluation
--- Sensitivity.
-- @param tp true positive
-- @param fp false positive
-- @param tn true negative
-- @param fn false negative
-- @ret... |
--[[ System.lua
Handles internal updating of the graphical effects of the arcs,
as well as performing throttling for performance.
This module is licensed under MIT, refer to the LICENSE file or:
https://github.com/buildthomas/ElectricArc/blob/master/LICENSE
]]
local System = {}
local Players = game:GetService... |
-- xtool_init.lua
-- _______ _____ _______
-- |__ __| | __ \__ __|
-- | | ___ ___ _ __ _ _| | | | | |
-- | |/ _ \/ _ \ '_ \| | | | | | | | |
-- | | __/ __/ | | | |_| | |__| | | |
-- |_|\___|\___|_| |_|\__, |_____/ |_|
-- ... |
local ffi = require 'ffi'
local ffi_new = ffi.new
local ffi_str = ffi.string
local ffi_copy = ffi.copy
local setmetatable = setmetatable
local _M = { _VERSION = '0.01' }
local mt = { __index = _M }
ffi.cdef[[
struct CRYPT_STREAM;
typedef struct CRYPT_STREAM *MCRYPT;
MCRYPT mcrypt_module_open(char *algorithm,
... |
Game = {}
require 'Game.GameState'
require 'Game.Map'
require 'Enemy.EnemyBrain'
require 'Game.Effects'
Game.State = GameState.New
Game.InputAllowed = false
local turnLength = 1 -- Seconds per tick. Will max out at your FPS e.g. 0.016s per tick ~ 60fps (0.016*60 ~ 1)
-- TODO: Difficulty as turn length
local timeSinc... |
--[[
Data for Navigational Computer
]]
local function printtable (t, offset)
if type (t) == "table" then
offset = offset or ""
for k,v in pairs (t) do
if type (v) == "table" then
print (string.format ("%s%s", offset, tostring (k)))
printtable (v, offset .. "- ")
else
print (string.format ("%s%s... |
--Automatically generated by SWGEmu Spawn Tool v0.12 loot editor.
liquid_delivery_suspension_advanced = {
minimumLevel = 0,
maximumLevel = -1,
customObjectName = "",
directObjectTemplate = "object/tangible/component/chemistry/liquid_delivery_suspension_advanced.iff",
craftingValues = {
{"power", 40,200,0},
{"... |
local AS = unpack(AddOnSkins)
if not AS:CheckAddOn('ColorPickerPlus') then return end
function AS:ColorPickerPlus()
--Make sure the color picker is not click-through anymore
ColorPickerFrame:EnableMouse(true)
-- AS:SkinFrame(ColorPickerFrame) --Using StripTextures causes a WoW crash for some reason
for i = 1, Co... |
local Lgt = {}
Lgt["layer"] = 1
Lgt["mapLight"] = {["r"] = 20, ["g"] = 20, ["b"] = 20}
local function setTileLight(RGBLight, x,y)
local element = {["name"] = "", ["RGBLight"] = true, ["position"] = true}
element["name"] = "tileLight"
element["RGBLight"] = RGBLight
element["position"] = {["x"] = x, ["y"] = y}
MpR... |
function onCreate()
--variables
Dodged = false;
canDodge = false;
DodgeTime = 0.5;
precacheSound('notice');
precacheSound('dodge');
precacheImage('DodgeMechs');
precacheImage('spacebar_icon');
end
function onEvent(name, value1, value2)
if name == "DodgeEvent" then
--Get Dodge... |
require "Client.Scripts.Modulus.Net.Protos.__init"
require "Client.Scripts.Modulus.Net.ProtocolMgr" |
cflags{'-I $srcdir/include'}
lib('libmtdev.a', {
'src/caps.c',
'src/core.c',
'src/iobuf.c',
'src/match.c',
'src/match_four.c',
})
fetch 'git'
|
require('libraries/functional')
-- Only one instance of the effect modifier is allowed
AURA_TYPE_NON_STACKING = 0
-- This is like vanilla Dota behaviour where multiple instances
-- of the same aura from the same unit do not stack, but can stack with
-- other units having the same aura
AURA_TYPE_STACK_DIFF_CASTER = 1
-... |
require('lspconfig').yamlls.setup{ on_attach = require('maps').on_attach }
|
local pnlWorkshop = vgui.RegisterFile( "vgui/workshop.lua" )
local vgui_workshop = nil
hook.Add( "WorkshopStart", "WorkshopStart", function()
if ( IsValid( vgui_workshop ) ) then vgui_workshop:Remove() end
vgui_workshop = GetOverlayPanel():Add( pnlWorkshop )
end )
hook.Add( "WorkshopEnd", "WorkshopEnd", functio... |
-- Copyright (c) 2019 PG1003
--
-- 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, distri... |
local opts = {
on_attach = function(client, bufnr)
-- your code here
require('aerial').on_attach(client, bufnr)
end,
}
return {
on_setup = function(server)
server:setup(opts)
end,
}
|
EditorTeamAICommands = EditorTeamAICommands or class(MissionScriptEditor)
EditorTeamAICommands.ELEMENT_FILTER = {}
EditorTeamAICommands.SAVE_UNIT_POSITION = false
EditorTeamAICommands.SAVE_UNIT_ROTATION = false
function EditorTeamAICommands:create_element(...)
EditorTeamAICommands.super.create_element(self, ...)
self... |
ys = ys or {}
slot1 = ys.Battle.BattleConfig
slot2 = ys.Battle.BattleTargetChoise
slot3 = ys.Battle.BattleDataFunction
slot4 = ys.Battle.BattleUnitEvent
ys.Battle.BattlePatternFunnelUnit = class("BattlePatternFunnelUnit", ys.Battle.BattleAircraftUnit)
ys.Battle.BattlePatternFunnelUnit.__name = "BattlePatternFunnelUnit"... |
require("curl")
local curl = curl_easy_init()
if not curl then
print("curl did not init!")
return
end
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com")
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1)
local res = curl_easy_perform(curl)
if res != CURLE_OK then
print("curl_easy_perform() failed: "..cur... |
if not vim.keymap or not vim.keymap.set then
require('legendary.utils').notify('Sorry, legendary.nvim requires Neovim 0.7.0 or higher!')
return
end
require('legendary.cmds').bind()
|
local str = {}
function str.split (str, pat)
local t = {}
local fpat = "(.-)" .. pat
local last_end = 1
local s, e, cap = str:find (fpat, 1)
while s do
if s ~= 1 or cap ~= "" then
table.insert (t,cap)
end
last_end = e + 1
s, e, cap = str:find (fpat, last_end)
end
if ... |
---@class UnityEngine.Material : UnityEngine.Object
---@field shader UnityEngine.Shader
---@field color UnityEngine.Color
---@field mainTexture UnityEngine.Texture
---@field mainTextureOffset UnityEngine.Vector2
---@field mainTextureScale UnityEngine.Vector2
---@field renderQueue int
---@field globalIlluminationFlags U... |
--require('xxtsp')
--TODO: 这里要改成你的APP_KEY
APP_KEY = '90BB9337D7B1ACC0CA642C5726D227CB'
--TODO: 这里要改成你的APP_SECRECT
APP_SECRECT = '**'
--md5
function md5str(text)
return string.upper(string.md5(text))
end
--将sign字典排序
function signlist(tables)
local list={}
for i in pairs(tables) do
if i ~= nil then
table.inse... |
--[[
This file was extracted by 'EsoLuaGenerator' at '2021-09-04 16:42:26' using the latest game version.
NOTE: This file should only be used as IDE support; it should NOT be distributed with addons!
****************************************************************************
CONTENTS OF THIS FILE IS COPYRI... |
-- get and build a slice of the construction
function analyse()
tryRefuel()
yfound = false
-- proccess all blocks with the y coordinates
for k,v in pairs(darray) do
if v[2] == y then
yfound = true
print("Moving to ", v[1], ",", v[2], ",", v[3])
move(v[1], v[2] + 1, v[3])
placeBlockDown()
end
end
... |
HOOFPRINTS = {
Material("materials/textures/sn_hoofprints/horseshoe.png"),
Material("materials/textures/sn_hoofprints/horseshoe1.png"),
Material("materials/textures/sn_hoofprints/horseshoe2.png"),
Material("materials/textures/sn_hoofprints/horseshoe3.png")
}
MODELS = {
"models/ppm/player_default_base... |
MgrScene = {}
screenWidth = nil
screenHeight = nil
screenScale = nil
isSceneChanging = nil
isSceneOrPopupChanging = nil
useGUILayout = nil
runInEditMode = nil
enabled = nil
isActiveAndEnabled = nil
transform = nil
gameObject = nil
tag = nil
rigidbody = nil
rigidbody2D = nil
camera = nil
light = nil
animation = nil
con... |
-- title: sfx
-- author: Nesbox
-- desc: how to play SFX demo
-- script: lua
-- input: gamepad
t=0
id=0
function TIC()
if btnp(0) then sfx(id,"E-4")
elseif btnp(1) then sfx(id,"E-6")
elseif btnp(2) then sfx(id,"E-7")
elseif btnp(3) then sfx(id,"E-5")
end
cls(15)
spr(1+(t%20)/10,102,24,1,4)
print("PRESS ... |
--- author:??? current maintainer: mcb v1.0
-- mathematisch runden
function Round( _n )
return math.floor( _n + 0.5 );
end
---@diagnostic disable-next-line: lowercase-global
round = Round
|
local U = require "togo.utility"
local FS = require "togo.filesystem"
local T = require "Quanta.Time"
require "Quanta.Time.Gregorian"
local O = require "Quanta.Object"
local Vessel = require "Quanta.Vessel"
local Tool = require "Quanta.Tool"
local entity_type_shorthands = {"T", "C", "U"}
function entity_type_shortha... |
name = "Chris"
age = 46
abletoDrive = true
longString =
[[Roses are red
Violets are blue
Valentines day sucks
and so do you!]]
longString = longString .. "\n" .. name .. " age:" .. age .. "\n"
io.write("Konichiwa isekai!\n", #name, "\n", age, "\n")
io.write("name\t", type(name), "\tage\t", type(age), "\tAble to Dri... |
local Messages = {}
local soundList = {}
function Messages.broadcast(msg)
--inline to prevent circular reference
for k,v in pairs(require("server").getSingleton().clients) do
soundList[k] = soundList[k] or {}
table.insert(soundList[k],msg)
end
end
function Messages.getMessages(entity)
... |
function Update()
m_parent = SKIN:GetMeasure('WeatherParent')
content = m_parent:GetStringValue()
hour, min, meridiem = content:match("<sunr>(%d+):(%d+)%s+(%a+)</sunr>")
if (string.upper(meridiem) == 'PM') then
hour = hour + 12
end
return hour .. ":" .. min
end |
return {
In = 0,
Out = 1,
InOut = 2,
}
|
--[[
Small library to work with a tree farm.
Setup with a drawer controller and a buffer chest
on consecutive sides, counter-clockwise.
i.e.: drawer behind, buffer chest right.
Tested on Minecraft 1.16.5
]]--
lumberjack = {}
lumberjack.SAPLING_TAG = "minecraft:saplings"
lumberjack.FERTILIZER_TAG = "forge:fertilizer"... |
function onCreate()
--background boi
makeLuaSprite( 'back1', 'clubroom/sky', 0, 0)
setLuaSpriteScrollFactor('back1', 0.6, 0.6)
scaleObject('back1', 1.6, 1.6)
addLuaSprite('back1', false)
makeLuaSprite( 'back2', 'clubroom/clubfarbg', 0, 0)
setLuaSpriteScrollFactor('back2', 0.6, 0.6)
scaleObject('back2'... |
local parser = require("parse_rpc")
local function table_index(table, elem)
for i, v in ipairs(table) do
if v.name == elem then
return i - 1
end
end
return -1
end
local type_2_value_meta = {
['int'] = 0,
['int32_t'] = 0,
['string'] = 1,
['class'] = 2,
['object'] = 3,
['mixed'] = 4,
['buffer'] = 5,
... |
local objc = require "objc/init"
local now = objc.NSDate:date()
local localizedDate = objc.NSDateFormatter:localizedStringFromDate_dateStyle_timeStyle_(now, 2, 2)
print(localizedDate)
-- => "10. Sep 2017, 13:22:27"
|
local ffi = require "ffi"
local C = ffi.C
local ffi_gc = ffi.gc
local ffi_cast = ffi.cast
require "resty.openssl.include.x509"
require "resty.openssl.include.x509v3"
local altname_lib = require "resty.openssl.x509.altname"
local stack_lib = require "resty.openssl.stack"
local _M = {}
local authority_info_access_ptr_... |
local drawableSprite = require("structs.drawable_sprite")
local cassetteDB = {}
local colors = {
{73 / 255, 170 / 255, 240 / 255},
{240 / 255, 73 / 255, 190 / 255},
{252 / 255, 220 / 255, 58 / 255},
{56 / 255, 224 / 255, 78 / 255},
}
local colorNames = {
["Blue"] = 0,
["Rose"] = 1,
["Brig... |
local Entity = require("lib.Entity")
local Vector2 = require("lib.Vector2")
local EF = {}
local Class = require("lib.Class")
local ent_classes = {}
ent_classes.ENTITY = require('classes.entities.ENTITY')
ent_classes.HP = require('classes.entities.HP')
ent_classes.CREATURE = require('classes.entities.CREATURE')
... |
AuctionatorPanelConfigMixin = {}
function AuctionatorPanelConfigMixin:SetupPanel()
self.cancel = function()
self:Cancel()
end
self.okay = function()
self:Save()
end
InterfaceOptions_AddCategory(self, "Auctionator")
end
function AuctionatorPanelConfigMixin:IndentationForSubSection()
return " "
... |
-- Log messages to riak
local jid_bare = require "util.jid".bare
local riak = module:depends "riak/pb".new ( assert ( module:get_option ( "my_riak_servers" ) ) )
local stanza_bucket_type = module:get_option_string ( "my_riak_type" , "message" )
local function log_message ( bucket , stanza )
module:log ( "debug" , "S... |
-- by default a DocView's on_text_input is pretty useless for our use
-- we need to detect actual keypresses to appear snappy
local TextBox = require "widget.textbox"
local textbox_new = TextBox.new
function TextBox:new(...)
textbox_new(self, ...)
local this = self
local doc_raw_insert = self.textview.doc.raw... |
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
-- F I N A L C U T P R O A P I --
-----------------------------------------------------------------------------... |
local spell = Spell("instant")
function spell.onCastSpell(creature, variant)
return creature:conjureItem(0, 3448, 7, CONST_ME_MAGIC_BLUE)
end
spell:name("Conjure Poisoned Arrow")
spell:words("exevo con pox")
spell:group("support")
spell:vocation("paladin;true", "royal paladin;true")
spell:id(48)
spell:cooldown(2 * 1... |
--[[
"Hydrosion"
Simplified hydraulic erosion on the gpu in love
]]
--shorthand
lg = love.graphics
--no conf
love.window.setMode(0, 0, {
fullscreen = "desktop"
})
require("batteries"):export()
require("util")
require("shaders")
require("gen_terrain")
require("erosion")
------------------------------------------... |
function onEvent(name, value1, value2)
function opponentNoteHit(id, noteData, noteType, isSustainNote)
if getProperty('health') > (value2 / 50) and getProperty('health') < (value1 / 50) then -- Health is from 0 to 2, so dividing the value by 50 allow to just turn it into percentage easly
setProperty('health', ... |
#!/usr/bin/env luajit
-- print_hwdb.lua
package.path = package.path..";../?.lua"
local UDVHwdb = require("UDVHwdb")
local aliases = require("modalias")
local fun = require("fun")()
local ctxt, err = require("UDVContext")()
assert(ctxt ~= nil, "Error creating context")
local hwdb, err = UDVHwdb();
local function pr... |
local StringBuffer = require("string_buffer")
return {
{
id = "hwnd",
content = function(shiori, ref)
local __ = shiori.var
local sep = string.char(0x01)
local hwnd = {
ghost = {},
balloon = {},
}
for ghost in string.gmatch(ref[0], "[^" .. sep .. "]*") do
... |
-- Stuff that should live in some standard library.
local Job = require("plenary.job")
local a = require("plenary.async")
-- local control = require'plenary.async.control'
local M = {}
--- Return an array-like table with a value repeated the given number of times.
---
--- Will hopefully move upstream, see neovim/neov... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.