content stringlengths 5 1.05M |
|---|
-- Copyright (c) 2016 Thermo Fisher Scientific
--
-- 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, ... |
local lush = require("lush")
local c = require("gruvboy.colors")
local theme = lush(function()
return {
markdownItalic({ fg = c.fg3 }),
markdownH1({ fg = c.green, gui = "bold" }),
markdownH2({ markdownH1 }),
markdownH3({ fg = c.yellow, gui = "bold" }),
markdownH4({ markdownH... |
-- Example controlling RGB LED strip with PCA9685 I2C PWM controller
-- Requires Lua PCA9685 driver: https://github.com/lexszero/esp8266-pwm/
-- Initialize I2C bus with SDA on GPIO0, SCL on GPIO2
-- https://github.com/nodemcu/nodemcu-firmware/wiki/nodemcu_api_en#new_gpio_map
i2c.setup(0, 3, 4, i2c.SLOW)
-- Initialize... |
global["backup_inventories"] = global["backup_inventories"] or {}
global["armor_bonus"] = global["armor_bonus"] or {}
local function on_inventory_grow(player, old_armor_bonus, new_armor_bonus)
local new_bonus = new_armor_bonus - old_armor_bonus
player.character_inventory_slots_bonus = player.character_invento... |
local SymbolTable = require("lunar.compiler.semantic.symbol_table")
local Scope = {}
Scope.__index = {}
function Scope.new(level, parent, env, file_path)
return Scope.constructor(setmetatable({}, Scope), level, parent, env, file_path)
end
function Scope.constructor(self, level, parent, env, file_path)
self.symbol_t... |
local hello = require 'lib/hello'
function main()
hello.sayHello()
end
main() |
return {
Name = "takeItem";
Aliases = {};
Description = "Removes quantity of item from players inventory";
Group = "Admin";
Args = {
{
Type = "itemId";
Name = "itemId";
Description = "Item to remove";
},
{
Type = "player";
Name = "target";
Description = "Player to remove item from";
},
... |
dofile(reaper.GetResourcePath().."/UserPlugins/ultraschall_api.lua")
reaper.CF_ShellExecute(ultraschall.Api_Path.."/Scripts")
|
m=component.proxy(component.list("modem")())
d=component.proxy(component.list("drone")())
m.setWakeMessage("RISE")
local CMD_PORT = 2412
m.open(CMD_PORT)
computer.beep(2000)
local eventStack = {}
local listeners = {}
event = {}
function event.listen(evtype,callback)
if listeners[evtype] ~= nil then
table.insert(list... |
function renderFile(fileBlob)
if not fileBlob then
return nil
end
local html = string.format([[
<html>
<body>
<h1>Content of file:</h1>
<p id="blob">%s</p>
</body>
</html>]],
fileBlob)
return html
end
|
--[[
* Configuration for <scheduler.lua> script.
*
* Provides a time table to schedule actions.
*
* The actions' implementation is left to the user.
]]
-- ----------------------------------------------------------------------------
local trace = require("lib.trace")
-- -------------------------------... |
local StatBoundedStat = require("bin.StatBoundedStat")
local BoundedStat = require("bin.BoundedStat")
local Stat = require("bin.Stat")
local private = require("bin.instances")
--local inspect = require("lib.inspect.main")
local Health = Object:extend()
function Health:new(max, bonus, val, reason)
bonus... |
-- Use of this source code is governed by the Apache 2.0 license; see COPYING.
module(...,package.seeall)
-- Default to not using any Lua code on the filesystem.
-- (Can be overridden with -P argument: see below.)
package.path = ''
local STP = require("lib.lua.StackTracePlus")
local ffi = require("ffi")
local zone =... |
organicOres = {"minecraft:coal_ore", "minecraft:diamond_ore"} --This is a table of organic ores, SUPPORTING MODDED ORES
nonOrganicOres = {"minecraft:gold_ore", "minecraft:lapis_ore", "minecraft:redstone_ore", "minecraft:iron_ore"} --This is a table of nonorganic ores, SUPPORTING MODDED ORES
organicMinAtmosphere = 25 ... |
Saw = Class {
__includes=MeleeTower,
init = function(self, gridOrigin, worldOrigin)
self.towerType = "SAW"
MeleeTower.init(self, animationController:createInstance(self.towerType),
gridOrigin, worldOrigin, constants.STRUCTURE.SAW.WIDTH,
constants.STRUCTURE.SAW.HEIGHT, con... |
describe("Validation of absent rule", function()
local rule = require("rules.absent")
local valid_inputs = {
nil
}
local invalid_inputs = {
"foo",
true,
{},
}
it("Must set result as True when matches expected value", function()
for _, value in ipairs(valid_inputs) do
local conte... |
function onCreate()
-- background shit
makeLuaSprite('stageback5', 'stageback5', -600, -500);
setScrollFactor('stageback5', 0.9, 0.9);
makeLuaSprite('stagefront', 'stagefront', -650, 600);
setScrollFactor('stagefront', 0.9, 0.9);
scaleObject('stagefront', 5.5, 5.5);
-- sprites that only load if Low Q... |
object_tangible_meatlump_event_meatlump_weapon_palette_01_12 = object_tangible_meatlump_event_shared_meatlump_weapon_palette_01_12:new {
}
ObjectTemplates:addTemplate(object_tangible_meatlump_event_meatlump_weapon_palette_01_12, "object/tangible/meatlump/event/meatlump_weapon_palette_01_12.iff")
|
if mods['space-exploration'] then
data:extend({
--- Space Exploration settings
{
type = "int-setting",
name = "space-exploration-pack",
default_value = 4,
setting_type = "startup",
order = "AS-SE-AA",
allowed_values = {0, 1, 2, 3, 4}
},
... |
demonic_warrior_deep_cutting_axe_modifier = class({})
function demonic_warrior_deep_cutting_axe_modifier:OnCreated( kv )
self.armor = self:GetAbility():GetSpecialValueFor("armor")
self.magic_resist_percentage = self:GetAbility():GetSpecialValueFor("magic_resist_percentage")
end
function ... |
local L = BigWigs:NewBossLocale("Neltharions Lair Trash", "ptBR")
if not L then return end
if L then
L.breaker = "Rachador Megalito"
L.hulk = "Gigante Estilhavil"
L.gnasher = "Triscadente Costapétrea"
L.trapper = "Coureador Rochatado"
end
L = BigWigs:NewBossLocale("Rokmora", "ptBR")
if L then
L.warmup_text = "Rok... |
-- Environment
Environment = _csharp_getType("system.LuaEnvironment");
-- Process
Process = _csharp_getType("system.LuaProcess");
ProcessStartInfo = _csharp_getType("system.LuaProcessStartInfo");
-- URI
Uri = _csharp_getType("system.LuaUri");
-- Time
DateTime = _csharp_getType("system.LuaDateTime");
DateTimeOffset ... |
local get_overlays = function(name, overlays_by_part)
local result = ""
for _,overlays in ipairs(overlays_by_part) do
if overlays[name] ~= nil then
result = result.."^"..overlays[name]
end
end
return result
end
local get_texture_by_name = function(name, textures_by_part, fal... |
local obj = {}
obj.__index = obj
obj.name = "Validator"
function obj:topHalf(window, screen)
return window.x == screen.x and
window.y == screen.y and
window.w == screen.w and
window.h == (screen.h // 2)
end
function obj:topThird(window, screen)
return window.x == screen.x and
... |
-- Copyright (C) by Kwanhur Huang
describe("create", function()
local path = require('path')
local image_path = path.new('/')
local image_dir = image_path.join(path.currentdir(), "t", "image")
local gd = require("resty.gd")
it("create", function()
local gdImage, err = gd.create(1, 1)
... |
object_tangible_furniture_wod_themepark_pro_ns_herb_storage = object_tangible_furniture_wod_themepark_shared_pro_ns_herb_storage:new {
}
ObjectTemplates:addTemplate(object_tangible_furniture_wod_themepark_pro_ns_herb_storage, "object/tangible/furniture/wod_themepark/pro_ns_herb_storage.iff")
|
-- module describing business system (company, money laundering)
local cfg = module("cfg/business")
local htmlEntities = module("lib/htmlEntities")
local lang = vRP.lang
local sanitizes = module("cfg/sanitizes")
-- sql
MySQL.createCommand("vRP/business_tables",[[
CREATE TABLE IF NOT EXISTS vrp_user_business(
user... |
object_tangible_quest_camp_crate = object_tangible_quest_shared_camp_crate:new {
}
ObjectTemplates:addTemplate(object_tangible_quest_camp_crate, "object/tangible/quest/camp_crate.iff")
|
object_weapon_ranged_creature_shared_creature_spit_hoth_tauntaun = SharedWeaponObjectTemplate:new {
clientTemplateFileName = "object/weapon/ranged/creature/shared_creature_spit_hoth_tauntaun.iff"
}
ObjectTemplates:addClientTemplate(object_weapon_ranged_creature_shared_creature_spit_hoth_tauntaun, "object/weapon/ranged... |
module("think", package.seeall)
require "bots/dota2_nn/nn_items"
require "bots/dota2_nn/nn_move"
require "bots/dota2_nn/util"
local function DoLastHitThink(creeps, unit)
-- do laning/last hit/deny
for _, creep in ipairs(creeps) do
if creep:GetHealth() < unit:GetAttackDamage() and (creep:GetTeam() == bit.bxor(GetT... |
Jobs.RegisterServerCallback('esx_jobs:getPlayerGender', function(xPlayer, xJob, callback)
MySQL.Async.fetchAll('SELECT `skin` FROM `users` WHERE `identifier` = @identifier', {
['@identifier'] = xPlayer.identifier
}, function(userResult)
if (userResult ~= nil and userResult[1] ~= nil) then
... |
input = io.read("*line")
print("Hello, World.");
print(input);
|
local Message = 0
function love.load()
love.graphics.setDefaultFilter("nearest", "nearest")
Heroset = love.graphics.newImage("assets/hero.png")
HerosetW, HerosetH = Heroset:getWidth(), Heroset:getHeight()
HeroW, HeroH = 16, 16
HeroQuad = love.graphics.newQuad(16, 32, HeroW, HeroH, HerosetW, Hero... |
-- detours so stuff go through portals
AddCSLuaFile()
-- bullet detour
hook.Add("EntityFireBullets", "seamless_portal_detour_bullet", function(entity, data)
if !SeamlessPortals or SeamlessPortals.PortalIndex < 1 then return end
local tr = SeamlessPortals.TraceLine({start = data.Src, endpos = data.Src + data.Dir *... |
dofilepath("data:scripts/FX_resfinder.lua")
MovieScreen =
{
displayName = "$90138",
helpTip = "$90139",
Layout = {size_WH = { w = 1, h = 1, wr = "scr", hr = "scr" },},
stylesheet = "HW2StyleSheet",
RootElementSettings =
{
backgroundColor = {0,0,0,0},
},
-- uncomment the following to en... |
local E, L, V, P, G = unpack(select(2, ...)); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
local UF = E:GetModule('UnitFrames');
--Cache global variables
--Lua functions
--WoW API / Variables
local CreateFrame = CreateFrame
function UF:Construct_ArenaTargetIcon(frame)
local targetIcon = CreateFrame("Fr... |
local CONTAINS_DASH = "^(.*)%-([^.]+)"
if string.match(ngx.var.http_host, CONTAINS_DASH) then
ngx.var.port = 10002
else
ngx.var.port = 7071
end
|
#!/usr/bin/env tarantool
test = require("sqltester")
test:plan(3)
--!./tcltestrunner.lua
-- 2013 March 05
--
-- The author disclaims copyright to this source code. In place of
-- a legal notice, here is a blessing:
--
-- May you do good and not evil.
-- May you find forgiveness for yourself and forgive others.
... |
local resty_lrucache = require('resty.lrucache')
describe('Caching policy', function()
local cache
local caching_policy
local cache_handler
before_each(function()
cache = resty_lrucache.new(1)
-- The code uses ngx.shared.dict and it defines .add(), resty_lrucache
-- does not, so we need to implem... |
local PANEL = {}
PANEL.Base = "DFrame"
function PANEL:Init()
self.HTML = vgui.Create( "Chromium", self )
-- Trying to open credits on a non-cef build?
if ( !self.HTML ) then
self:Remove()
return
end
self.HTML:Dock( FILL )
self.HTML:OpenURL( "chrome://credits/" )
self.HTML:SetOpenLinksExternally( true )
... |
local lexit = {}
lexit.KEY = 1
lexit.ID = 2
lexit.NUMLIT = 3
lexit.STRLIT = 4
lexit.OP = 5
lexit.PUNCT = 6
lexit.MAL = 7
lexit.catnames = {
"Keyword",
"Identifier",
"NumericLiteral",
"StringLiteral",
"Operator",
"Punctuation",
"Malformed"
}
-- Character identification functions
local function isLetter... |
-- os Additions
function os.getSystemBit()
if (os.getenv('PROCESSOR_ARCHITEW6432')=='AMD64' or os.getenv('PROCESSOR_ARCHITECTURE')=='AMD64') then
return 64
else
return 32
end
end
function os.sleep(n)
if not n then n=0 end
local t0 = os.clock()
while os.clock() - t0 <= n do end
end
function os.pause(msg)
if m... |
AddCSLuaFile("cl_init.lua")
AddCSLuaFile("shared.lua")
AddCSLuaFile("config.lua")
include("shared.lua")
include("config.lua")
--[[ Net Library NetworkString ]]--
util.AddNetworkString( "Derma" )
util.AddNetworkString( "DataSend" )
ENT.SeizeReward = 950
local PrintMore
local ReHeat
local dhold = 0
function CanLevel(ply)... |
local skynet = require "skynet"
local socketManager = require("byprotobuf/socketManager")
local socketCmd = require("logic/common/socketCmd")
local socketchannel = require "socketchannel"
local TAG = 'DiamondClient'
local DiamondClient = class()
function DiamondClient:isConnected()
if self.m_pSocketfd and self.m_pS... |
local Main = Game:addState('Main')
function Main:enteredState()
local Camera = require("lib/camera")
self.camera = Camera:new()
g.setBackgroundColor(150, 150, 150)
blurShader = g.newShader('shaders/blur.glsl')
loop_index = 1
loops = {
{
update = require('loop001'),
bg = self.preloaded_im... |
includeFile("custom_content/tangible/component/weapon/lightsaber/lightsaber_module_blackwing_crystal.lua")
includeFile("custom_content/tangible/component/weapon/lightsaber/lightsaber_module_lava_crystal.lua")
includeFile("custom_content/tangible/component/weapon/lightsaber/lightsaber_module_permafrost_crystal.lua")
|
local skynet = require "skynet"
local s = require "service"
local STATUS = {
LOGIN = 2,
GAME = 3,
LOGOUT = 4,
}
local players = {} -- [playerid] = mgrplayer
local function mgrplayer()
local m = {
playerid = nil,
node = nil,
agent = nil,
status = nil,
gate = ni... |
local animationTime = 1
local padding = 32
-- entity menu button
DEFINE_BASECLASS("ixMenuButton")
local PANEL = {}
AccessorFunc(PANEL, "callback", "Callback")
function PANEL:Init()
self:SetTall(ScrH() * 0.1)
self:Dock(TOP)
end
function PANEL:DoClick()
local bStatus = true
local parent = ix.menu.panel
local en... |
--
--------------------------------------------------------------------------------
-- FILE: map_encoder.lua
-- DESCRIPTION: protoc-gen-lua
-- Google's Protocol Buffers project, ported to lua.
-- https://code.google.com/p/protoc-gen-lua/
--
-- Copyright (c) 2010 , 林卓毅 (Zhuoyi Lin) netsnail@gmail.com
... |
local y
if x then
while y do
print("hello")
end
end
|
-- vlspawn.lua - Vault spawner
-- This file is under copyright, and is bound to the agreement stated in the EULA.
-- Any 3rd party content has been used as either public domain or with permission.
-- © Copyright 2015-2016 Aritz Beobide-Cardinal All rights reserved.
function ARCSlots.SpawnVault()
ARCSlots.ClearV... |
local URL = require 'net.url'
local JSON = require 'json'
local OAUTH2 = require 'lua-basic-oauth2'
local GDUTILS = require 'lua-basic-google-drive.utils'
local OAUTILS = require 'lua-basic-oauth2.utils'
local baseConfig = {
scope = 'https://www.googleapis.com/auth/drive',
endpoint = 'https://www.googleapis.com/driv... |
card_names = Array('skip','draw','reverse','wild','wilddraw')
card_colors = Array('red','yellow','green','blue')
card_w = 212
card_h = 336
-- TODO: limit the number of draw cards
draw_card_count = 10
calcCardRect = function(card)
local cx, cy, angle = card.x, card.y, math.rad(card.angle)
local rotatePoint = functi... |
return {
postgres = {
up = [[
DO $$
BEGIN
ALTER TABLE IF EXISTS ONLY acls ADD tags TEXT[];
EXCEPTION WHEN DUPLICATE_COLUMN THEN
-- Do nothing, accept existing state
END$$;
DO $$
BEGIN
CREATE INDEX IF NOT EXISTS acls_tags_idex_tags_idx ON acls USING GIN(... |
id = 'V-38470'
severity = 'medium'
weight = 10.0
title = 'The audit system must alert designated staff members when the audit storage volume approaches capacity.'
description = 'Notifying administrators of an impending disk space problem may allow them to take corrective action prior to any disruption.'
fixtext = [==[T... |
-----------------------------------
-- Area: Dynamis-Beaucedine
-- NPC: ??? (qm5)
-- Note: Spawns Goublefaupe
-----------------------------------
require("scripts/globals/dynamis")
-----------------------------------
function onTrade(player, npc, trade)
dynamis.qmOnTrade(player, npc, trade)
end
function onTrigge... |
function updateSpecificResource(res, no)
if (source and res and no) then
-- Get table of devs, for now just source
--triggerClientEvent(source, "UCDadmin.updateSpecificResource", source, )
end
end
addEvent("UCDadmin.updateSpecificResource")
addEventHandler("UCDadmin.updateSpecificResource", root, updateSpecificRe... |
include "layerLayout";
include "util.textures";
local textInput = include "util.textInput";
local bgName = "bgHighContrast";
local timer;
--------------------------------------------------
-- Layer Data ------------------------------------
--------------------------------------------------
-- Can be 0 for the defa... |
---ite
--- Generated by EmmyLua(https://github.com/EmmyLua)
--- Created by Administrator.
--- DateTime: 2021/3/2 20:29
---
local modGui = require("mod-gui")
require("lib.ksptooi.commons.ExportModule")
--创建ext菜单按钮
function initExtMenuBtn(player)
local btnFlow = modGui.get_button_flow(player)
if btnFlow.extMe... |
-- ---------------------------------------------
-- ljsc.lua 2017/06/18
-- Copyright (c) 2017 Toshi Nagata
-- released under the MIT open source license.
-- ---------------------------------------------
-- Where am I?
local pname = ...
local dname = string.gsub(pname, "init", "")
package.path = dname .. "?... |
local skynet = require "skynet"
local socket = require "skynet.socket"
local string = string
local SERVICE_NAME = "http_worker"
skynet.start(function()
local agent = {}
local protocol = "http"
for i= 1, 5 do
agent[i] = skynet.newservice(SERVICE_NAME, "agent", protocol)
end
local balance = 1
local id = socket.... |
---------------------------------------------------
-- pawnSpace - lib
---------------------------------------------------
-- provides functions for moving pawns around
-- during a skill effect, in order to force
-- a particular board preview.
--
-- valid sequences are [clear - rewind] or [filter - rewind]
-- and ther... |
ITEM.name = "9x39 Ammo"
ITEM.model = "models/gmodz/ammo/9x39.mdl"
ITEM.ammo = "9x39mm"
ITEM.ammoAmount = 12
ITEM.maxRounds = 50
ITEM.description = "Ammo box that contains 9x39 mm caliber"
ITEM.price = 10800
ITEM.rarity = { weight = 32 } |
box.cfg {
background = true,
listen = 3301,
pid_file = "/dewt/tarantool.pid",
memtx_dir = "/dewt/data",
wal_dir = "/dewt/data",
vinyl_dir = "/dewt/data",
work_dir = "/dewt/app",
log = "/dewt/logs/log.txt",
memtx_memory = 512 * 1024 *1024,
checkpoint_interval = 7200,
custom_proc_title = "drakonhub_onprem"
}
... |
local table = require("hs/lang/table")
local Sprite = require("hs/core/Sprite")
--------------------------------------------------------------------------------
-- デフォルトのスキン設定です。
-- TODO:全然だめなのでかえる予定
--------------------------------------------------------------------------------
local Skins = {
TextLabel = {
... |
local Observable = require 'observable'
local util = require 'util'
--- Returns a new Observable that runs a combinator function on the most recent values from a set
-- of Observables whenever any of them produce a new value. The results of the combinator function
-- are produced by the new Observable.
-- @arg {Observ... |
vim.g.committia_hooks = {
edit_open = function(info)
if info.vcs == 'git' and vim.fn.getline(1) == '' then
vim.cmd('startinsert')
end
vim.keymap.set('i', '<A-d>', '<Plug>(committia-scroll-diff-down-half)', { buffer = true })
vim.keymap.set('i', '<A-u>', '<Plug>(committia-scroll-diff-up-half)', {... |
--- Abstraction layer between a data collections (e.g. tarantool's spaces) and
--- the GraphQL query language.
---
--- Random notes:
---
--- * GraphQL top level statement must be a collection name. Arguments for this
--- statement match non-deducible field names of corresponding object and
--- passed to an accessor... |
--[[
isim bulamadım huba amk
]]
return(function(nebakiyonoc_IlllIIIlIllll,nebakiyonoc_llIlllIIIllI,nebakiyonoc_llIlllIIIllI)local nebakiyonoc_llIIlIlllllI=string.char;local nebakiyonoc_llIIIIIllI=string.sub;local nebakiyonoc_IllIllIIII=table.concat;local nebakiyonoc_IllIllIl=math.ldexp;local nebakiyonoc_IlIllIlIIIlIlII... |
if string.find(Var "Element", "Active") then
return Def.Sprite {
Texture=NOTESKIN:GetPath( '_Down', 'Hold Active' );
Frame0000=0;
Delay0000=1;
};
else
return Def.Sprite {
Texture=NOTESKIN:GetPath( '_Down', 'Tap Note' );
Frame0000=0;
Delay0000=1;
};
end |
--[[
LibQuestData
by Sharlikran
https://sharlikran.github.io/
Convert fireundubh lists
^(\d{1,4}), "(.*)"
\[\1] = "\2",
Other
(.*) = "(.*)" = "(.*), ",
"\2", = \{\3\,},
^"(.*)", = \{(.*)\},
\["\1"] = \{\2 },
For renumbering new rebuilt tables
(.*)\[(\d{1,4})\] = "(.*)",
\2, "\3"
--]]
local lib = _G["L... |
local cqueues = require'cqueues'
cqueues.socket = require'cqueues.socket'
local protocol = require'redis-client.protocol'
local response = require'redis-client.response'
local server = cqueues.socket.listen{ host = '127.0.0.1', port = '0' }
local _, host, port = server:localname()
local M = {
host = host,
port = ... |
local CorePackages = game:GetService("CorePackages")
local InGameMenuDependencies = require(CorePackages.InGameMenuDependencies)
local t = InGameMenuDependencies.t
local Roact = InGameMenuDependencies.Roact
local CloseMenuButton = require(script.Parent.CloseMenuButton)
local GameIconButton = require(script.Parent.Gam... |
function updateTooltipPosition( _,_, x, y )
guiSetPosition( label, x + 8, y + 10, false );
guiBringToFront( label );
end
function changeNOSGaugePosition( _, btnState, x, y )
if btnState == "down" then
g_tGaugePosition[ 1 ] = x - 50;
g_tGaugePosition[ 2 ] = y - 50;
end
end
function saveGaugePositionToFile(... |
local subst = require 'pl.template'.substitute
local List = require 'pl.List'
local asserteq = require 'pl.test'.asserteq
asserteq(subst([[
# for i = 1,2 do
<p>Hello $(tostring(i))</p>
# end
]],_G),[[
<p>Hello 1</p>
<p>Hello 2</p>
]])
asserteq(subst([[
<ul>
# for name in ls:iter() do
<li>$(name)</li>
#end
</ul>
]]... |
local trigger = {}
trigger.name = "ExtendedVariantMode/DashDirectionTrigger"
trigger.placements = {
name = "trigger",
data = {
revertOnLeave = false,
revertOnDeath = true,
delayRevertOnDeath = false,
withTeleport = false,
topLeft = true,
top = true,
topRi... |
-- I had to include it. It's easy to implement, so why not.
--[[
local rot13 = function(msg)
return (msg:gsub(".", function(c)
local l = bit32.btest(c:byte(), 32) and 97 or 65
return c:upper() == c:lower() and c or c.char((c:byte()-l+13)%26+l)
end))
end
]]
local ASSERTIONS_ENABLED = true -- Whe... |
return recursivedtrequire("systems", "systems") |
-------------------------------------------------------
-- nacl-cli
-- Written by Erik Poupaert, Cambodia
-- (c) 2018
-- Licensed under the LGPL
-------------------------------------------------------
local util={}
-- The origin of this function is a comment on stackoverflow
-- It was contributed b... |
MathUtils = { }
function MathUtils:getShortUid()
return CS.LuaExtend.getSUID()
end
function MathUtils:getLongUid()
return CS.LuaExtend.getLUID()
end |
local h = {}
local u = require'bfredl.util'
local a = u.a
function h.clint(bufnr)
name = a.buf_get_name(bufnr)
--
local path, fname = u.splitlast(name, 'src/nvim/')
local makename = 'touches/ran-clint-'..fname:gsub("[/.]","-")
vim.bo[bufnr].makeprg = 'ninja'
vim.cmd ("make -C "..path.."build/ "..makename)... |
--Not the hatloader mod.
function loadhat(path)
local s = love.filesystem.read(path)
if not s then
return
end
local s1 = s:split("|")
if #s1 ~= 8 then
return
end
if not love.filesystem.exists("hats/" .. s1[7] .. ".png") or not love.filesystem.exists("hats/" .. s1[8] .. ".png") then
return
end
table.... |
local assets=
{
Asset("ANIM", "anim/pan_flute.zip"),
}
local function onfinished(inst)
inst:Remove()
end
local function HearPanFlute(inst, musician, instrument)
if inst.components.sleeper then
inst.components.sleeper:AddSleepiness(10, TUNING.PANFLUTE_SLEEPTIME, inst)
end
end
local function fn(Sim)
loca... |
return
{
HOOK_PLAYER_BREAKING_BLOCK =
{
CalledWhen = "Just before a player breaks a block. Plugin may override / refuse. ",
DefaultFnName = "OnPlayerBreakingBlock", -- also used as pagename
Desc = [[
This hook is called when a {{cPlayer|player}} breaks a block, before the block is actually broken in
the ... |
--[[--
Physical representation of connected player.
`Player`s are a type of `Entity`. They are a physical representation of a `Character` - and can possess at most one `Character`
object at a time that you can interface with.
See the [Garry's Mod Wiki](https://wiki.garrysmod.com/page/Category:Player) for all other m... |
playerKeys = { kc.w, kc.s, kc.a, kc.d, kc.space, kc.left, kc.right, kc.up, kc.down, kc.kp7, kc.kp8, kc.kp4, kc.kp5, kc.kp6, kc.kp1, kc.kp2, kc.e, kc.q }
pk_vx = {
[kc.a] = -1,
[kc.left] = -1,
[kc.d] = 1,
[kc.right] = 1
}
pk_vy = {
[kc.space] = -1,
[kc.w] = -1,
[kc.up] = -1,
[kc.s] = 1,
[kc.... |
--- Module implementing the LuaRocks "test" command.
-- Tests a rock, compiling its C parts if any.
local cmd_test = {}
local util = require("luarocks.util")
local test = require("luarocks.test")
function cmd_test.add_to_parser(parser)
local cmd = parser:command("test", [[
Run the test suite for the Lua project i... |
-- ========== THIS IS AN AUTOMATICALLY GENERATED FILE! ==========
PlaceObj('XTemplate', {
__is_kind_of = "XContentTemplate",
group = "Paradox",
id = "ParadoxUIActionBars",
PlaceObj('XTemplateWindow', {
'__class', "XContentTemplate",
'IdNode', false,
'Dock', "bottom",
}, {
PlaceObj('XTemplateWindow', {
... |
--[[
[] Author: Martynas Petuska
[] E-mail: martynas.petuska@outlook.com
[] Date: January 2018
--]]
---------------- NAMESPACE ----------------
local UI = ADDON.UI;
local UpdateInfo = ADDON.UpdateInfo;
local Classes = ADDON.Classes;
local Sizes = ADDON.Sizes;
-------------------------------------------
---Cons... |
local M={}
M.eps = 1e-6
M.meanstd = {
mean = {0.485, 0.456, 0.406},
std = {0.229, 0.224, 0.225}}
M.pca = {
eigval = torch.Tensor{0.2175, 0.0188, 0.0045},
eigvec = torch.Tensor{
{ -0.5675, 0.7192, 0.4009 },
{ -0.5808, -0.0045, -0.8140 },
{ -0.5836, -0.6948, 0.4203 }}
}
return M
|
-- setup path to find the project source files of Pegasus
package.path = "./src/?.lua;./src/?/init.lua;"..package.path
local pegasus = require 'pegasus'
local server = pegasus:new({port='9090'})
local printTable = function (table)
for k, v in pairs(table) do
print(k, '=', v)
end
end
server:start(function (r... |
-- authorized_callback.lua
-- Once the client has been authorized by the API provider in their
-- login, the provider is supposed to send the client (via redirect)
-- to this endpoint, with the same status code that we sent him at the
-- moment of the first redirect
local random = require 'resty.random'
local ts = req... |
BuzzboxDB = {
["profileKeys"] = {
["Jyggen - Draenor"] = "Jyggen - Draenor",
},
["profiles"] = {
["Jyggen - Draenor"] = {
},
},
}
|
local web = CreateWebUI(0, 0, 0, 0, 1, 16)
SetWebAlignment(web, 0, 0)
SetWebAnchors(web, 0, 0, 1, 1)
SetWebURL(web, "http://asset/"..GetPackageName().."/dialog.html")
local nextId = 1
local dialogs = {}
local lastOpened = -1
local globalTheme = "themes/default-dark.css"
function createDialog(title, text, ...)
local... |
local Builder = creox.game.Builder.Block
Builder.block_builder("dirt").texture({"dirt.png"}).build()
Builder.block_builder("iron_block").texture({"metal_texture.png"}).build()
Builder.block_builder("gold_block").texture({"metal_texture.png^[multiply:#FFC900"}).build()
Builder.block_builder("oak_wood_planks").texture({... |
-- Used for particle effects, like explosions, fire, breaking walls, etc.
particles = {}
-- Particles use gravWorld, since they are affected by gravity
function spawnParticle(x, y, type, dir, time)
local particle = {}
particle.x = x
particle.y = y
particle.width = 50
particle.height = 50
particle.corner... |
local config = {
[9238] = Position(33456, 31346, 8),
[9239] = Position(33199, 31978, 8)
}
function onStepIn(creature, item, position, fromPosition)
local player = creature:getPlayer()
if not player then
return true
end
local targetPosition = config[item.uid]
if not targetPosition then
return true
end
pl... |
-- Copyright 2014-2015 Greentwip. All Rights Reserved.
local MyApp = class("MyApp", cc.load("mvc").AppBase)
function MyApp:onCreate()
math.randomseed(os.time())
self:setup()
end
function MyApp:setup()
self:initiate()
--cc.lite_edition_ = true
display.setAutoScale({autoscale = "SHOW_ALL", width =... |
AddCSLuaFile("cl_init.lua")
AddCSLuaFile("shared.lua")
include("shared.lua")
-- Sets the players model and basic physics ect..
function ENT:Initialize()
self:SetModel("models/gman_high.mdl")
self:SetHullType(HULL_HUMAN);
self:SetHullSizeNormal();
self:SetNPCState(NPC_STATE_SCRIPT)
self:SetSolid(SOLID_BBOX)
self... |
local ffi = require("ffi");
local samcli = require("samcli");
local netutils_ffi = require("netutils_ffi");
local core_string = require("core_string_l1_1_0");
local JSON = require("dkjson");
--[[
NET_API_STATUS
NetLocalGroupEnum (
LPCWSTR servername ,
DWORD level,
LPBYTE *bufptr,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.