code stringlengths 2 1.05M | repo_name stringlengths 5 101 | path stringlengths 4 991 | language stringclasses 3
values | license stringclasses 5
values | size int64 2 1.05M |
|---|---|---|---|---|---|
local running = true
local op = gpu.getPalette()
local pal = {{0, 0, 0}}
for i = 2, 15 do
local v = i / 15
pal[i] = {0 * v, 246 * v, 255 * v}
end
pal[16] = {255, 255, 255}
gpu.blitPalette(pal)
local size = 64
local sw, sh = gpu.width, gpu.height
local Vector = dofile("../lib/vector.lua")
local class = require(... | incinirate/Riko4 | scripts/home/sim/solo/line.lua | Lua | mit | 3,268 |
-- Copyright (C) Dejiang Zhu (doujiang24)
local corehelper = require "system.helper.core"
local filehelper = require "system.helper.file"
local ltp = require "system.library.ltp.template"
local setmetatable = setmetatable
local pcall = pcall
local assert = assert
local loadfile = ... | doujiang24/durap-system | core/loader.lua | Lua | mit | 3,061 |
-- Experimento 3: Luz de emergencia
-- configurando o pino D1 para saída de dados.
pin = 1
gpio.mode(pin, gpio.OUTPUT)
-- função para acender o LED.
function acende()
gpio.write(pin, gpio.HIGH)
end
-- função para apagar o LED.
function apaga()
gpio.write(pin, gpio.LOW)
end
function ativa_sensor()
loc... | amora-labs/workshop-techinterior2017-nodemcu | experimento3.lua | Lua | mit | 601 |
--[[
frame.lua
A specialized version of the bagnon frame for void storage
--]]
local Frame = Bagnon:NewClass('VaultFrame', 'Frame', Bagnon.Frame)
Frame.Title = LibStub('AceLocale-3.0'):GetLocale('Bagnon-VoidStorage').Title
Frame.ItemFrame = Bagnon.VaultItemFrame
Frame.MoneyFrame = Bagnon.TransferButton
Frame.Bags =... | liruqi/bigfoot | Interface/AddOns/Bagnon_VoidStorage/components/frame.lua | Lua | mit | 1,543 |
local function serialize (o, fp)
fp = fp or io
if type(o) == "number" then
fp:write(o)
elseif type(o) == "string" then
fp:write(string.format("%q", o))
elseif type(o) == "table" then
fp:write("{\n")
for k,v in pairs(o) do
fp:write(" ", k, " = ")
serialize(v, fp)
fp:write(",\n... | NerdWalletOSS/Q | RUNTIME/lua/serialize.lua | Lua | mit | 444 |
local _PATH = (...)
require(_PATH..".AudioManager")
require(_PATH..".interface")
| kyuu/dynrpg-rpgss | assets/Scripts/extensions/audiomanager/init.lua | Lua | mit | 82 |
---------------------------------<
-- Application Connecter
-- s_connect.lua
---------------------------------<
g_ResourceRoot = getResourceRootElement(getThisResource())
addEvent("onRequestChecksumOfFile", true)
addEventHandler("onRequestChecksumOfFile", g_ResourceRoot,
function(player, filename)
local file = fil... | MegadreamsBE/BlueBird | [Apps]/App_Calculator/s_connect.lua | Lua | mit | 1,334 |
push([[
-----------------------------------------------------------
--- /client/gui/GUICollection.lua ---
--- Part of openFrame project ---
--- Written by 50p. Additional changes by Orange. ---
--- Lately edited in revision number 13 by Orange ---
--- Li... | qaisjp/openframe | client/gui/GUICollection.lua | Lua | mit | 2,466 |
local I=1
local D=51
local grazynka=createPed(55,2810.90,-1085.22,1593.80,270,false)
setElementDimension(grazynka,D)
setElementInterior(grazynka,I)
setElementFrozen(grazynka,true)
setElementData(grazynka,'npc',true)
setElementRotation(grazynka,0,0,270)
setElementData(grazynka,'name',"Pani Grażynka")
local renia = cre... | XJMLN/MTA-PSZ | resources/[PSZMTA]/[obiekty]/jack-poczta/pedy.lua | Lua | mit | 802 |
--[[ @cond ___LICENSE___
-- Copyright (c) 2017 Zefiros Software.
--
-- 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, ... | Zefiros-Software/ZPM | src/common/options.lua | Lua | mit | 1,403 |
local resty_mlcache = require "resty.mlcache"
local type = type
local max = math.max
local ngx_log = ngx.log
local ngx_now = ngx.now
local ERR = ngx.ERR
local NOTICE = ngx.NOTICE
local DEBUG = ngx.DEBUG
--[[
Hypothesis
----------
Item size: 1024 bytes
Max memory limit: 500 MiBs
LRU size must ... | Mashape/kong | kong/cache.lua | Lua | apache-2.0 | 8,245 |
if SERVER then
include("zs_deathstreak/init.lua")
end | Honsal/hszs_deathstreak | lua/autorun/zs_deathstreak.lua | Lua | apache-2.0 | 54 |
require("firecast.lua");
local __o_rrpgObjs = require("rrpgObjs.lua");
require("rrpgGUI.lua");
require("rrpgDialogs.lua");
require("rrpgLFM.lua");
require("ndb.lua");
require("locale.lua");
local __o_Utils = require("utils.lua");
local function constructNew_frmSpells()
local obj = GUI.fromHandle(_obj_newObject("fo... | rrpgfirecast/firecast | Plugins/Sheets/Ficha Shadowrun 5E/output/rdkObjs/Shadowrun5E/06.Powers.Spells.lfm.lua | Lua | apache-2.0 | 6,324 |
-- init.lua
-- Contains the initialization function, and the disabling function.
g_Plugin = nil;
g_Config = nil;
g_CollectionClass = nil;
function Initialize(a_Plugin)
a_Plugin:SetName("TreeAssist")
a_Plugin:SetVersion(2)
g_Plugin = a_Plugin
-- Load the config file
LoadSettings()
-... | NiLSPACE/TreeAssist | init.lua | Lua | apache-2.0 | 576 |
local param = require "param"
local exit = require "exit"
local util = require "util"
local editor = require "Editor"
ngx.header.content_type = 'application/octet-stream'
local function process ()
local fileName = param.f
local paths = util.split(fileName, "/")
local name = paths[#paths]
ngx.header["Content-... | cyberz-eu/octopus | extensions/editor/src/controller/EditorDownloadFileController.lua | Lua | bsd-2-clause | 519 |
return function (db)
if type(db) == "table" then
local function checkPerm(uid, comando)
local data = db[uid]
if type(data) == "boolean" then -- Si es booleano devuelvo el valor
return data
elseif type(data) == "string" then -- Si es cadena devuelvo la indi... | iglosiggio/lpermlib | permlib.lua | Lua | bsd-2-clause | 1,465 |
-- To run: `lua bfs_test.lua`
local bfs = require("bfs")
local nodes = {
[1] = {2, 3, 4},
[2] = {1, 5, 6},
[3] = {1},
[4] = {1, 7, 8},
[5] = {2, 9, 10},
[6] = {2},
[7] = {4, 11, 12},
[8] = {4},
[9] = {5},
[10] = {5},
[11] = {7},
[12] = {7}
}
local visited = {};
... | tcfuji/search-algorithms | lua/bfs_test.lua | Lua | mit | 417 |
-- Use noise on a grid triangles
VERTEX_SHADER = [[
#version 400
layout (location = 0) in vec3 vp;
layout (location = 1) in vec3 vn;
out vec3 color;
uniform mat4 uViewMatrix, uProjectionMatrix;
uniform float uTime;
void main() {
float roughness = 2.0;
float innertexture = 50;
float yflow = 1.50;
vec3 pt = vec3((vp... | silky/frequensea | lua/noise-grid-wave.lua | Lua | mit | 1,354 |
--[[
Copyright 2016 Marek Vavrusa <mvavrusa@cloudflare.com>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed t... | mkacik/bcc | src/lua/bpf/proto.lua | Lua | apache-2.0 | 15,734 |
local t = LoadFallbackB();
t[#t+1] = StandardDecorationFromFile("Explanation","Explanation")
t[#t+1] = StandardDecorationFromFile("BPMDisplay","BPMDisplay")
t[#t+1] = StandardDecorationFromFile("GrooveRadar","GrooveRadar")
t[#t+1] = StandardDecorationFromFileOptional("SortDisplay","SortDisplay")
-- song options text (... | MidflightDigital/ddrsn3-theme | DDR SN3/BGAnimations/ScreenNetSelectMusic decorations.lua | Lua | mit | 6,410 |
#!/usr/bin/env lua
local pretty = require "pl.pretty"
local utils = require "pl.utils"
local file = require "pl.file"
package.path = "../src/?.lua;" .. package.path
local resources = require "luatwit.resources"
-- read source code
local res_lines = assert(utils.readlines "../src/luatwit/resources.lua")
-- red doc str... | darkstalker/LuaTwit | tools/doc_resources.lua | Lua | mit | 1,881 |
-- Parts of this file are adapted from the ljsyscall project
-- The ljsyscall project is licensed under the MIT License,
-- and copyrighted as:
-- Copyright (C) 2011-2016 Justin Cormack. All rights reserved.
local ffi = require "ffi"
local log = require "kong.cmd.utils.log"
ffi.cdef [[
extern char **environ;
]]
... | Mashape/kong | kong/cmd/utils/env.lua | Lua | apache-2.0 | 863 |
local logger = require "kong.cli.utils.logger"
local utils = require "kong.tools.utils"
local IO = require "kong.tools.io"
local _M = {}
function _M.get_ssl_cert_and_key(kong_config)
local ssl_cert_path, ssl_key_path
if (kong_config.ssl_cert_path and not kong_config.ssl_key_path) or
(kong_config.ssl_key_path... | xvaara/kong | kong/cli/utils/ssl.lua | Lua | apache-2.0 | 2,662 |
print(require "ansicolors")
local LOG = require"log".new('trace',
require "log.writer.console.color".new()
)
LOG.emerg("can not allocate memory")
LOG.alert("can not allocate memory")
LOG.fatal("can not allocate memory")
LOG.error("file not found")
LOG.warning("cache server is not started")
LOG.notice("mess... | ld-test/lua-log | examples/simple.lua | Lua | mit | 488 |
--- === hs.window.switcher ===
---
--- Window-based cmd-tab replacement
---
--- Usage:
--- ```
--- -- set up your windowfilter
--- switcher = hs.window.switcher.new() -- default windowfilter: only visible windows, all Spaces
--- switcher_space = hs.window.switcher.new(hs.window.filter.new():setCurrentSpace(true):setDef... | latenitefilms/hammerspoon | extensions/window/window_switcher.lua | Lua | mit | 18,475 |
local SelectTable, parent = torch.class('nn.SelectTable', 'nn.Module')
function SelectTable:__init(index)
parent.__init(self)
self.index = index
self.gradInput = {}
end
function SelectTable:updateOutput(input)
assert(math.abs(self.index) <= #input, "arg 1 table idx out of range")
if self.index < 0 then... | davidBelanger/nn | SelectTable.lua | Lua | bsd-3-clause | 1,367 |
local verse = require "verse";
local xmlns_ping = "urn:xmpp:ping";
function verse.plugins.ping(stream)
function stream:ping(jid, callback)
local t = socket.gettime();
stream:send_iq(verse.iq{ to = jid, type = "get" }:tag("ping", { xmlns = xmlns_ping }),
function (reply)
if reply.attr.type == "error" then... | msva/verse | plugins/ping.lua | Lua | mit | 647 |
local timeconvert = {}
local php
function timeconvert.setupInterface(options)
-- Remove setup function.
timeconvert.setupInterface = nil
-- Copy the PHP callbacks to a local variable, and remove the global one.
php = mw_interface
mw_interface = nil
-- Do any other setup here.
timeconvert.timecon... | dlh/MediaWiki-TimeConvert | TimeConvert.lua | Lua | mit | 569 |
--GLOBAL NAMESPACE
local _G = _G;
--LUA
local unpack = _G.unpack;
local select = _G.select;
local assert = _G.assert;
--MATH
local math = _G.math;
local floor = math.floor
--BLIZZARD API
local UnitPower = _G.UnitPower;
local UnitPowerMax = _G.UnitPowerMax;
local UnitHasVehic... | FailcoderAddons/SVUI | SVUI_UnitFrames/libs/Plugins/oUF_WarlockShards/oUF_WarlockShards.lua | Lua | mit | 5,091 |
--------------------------------------------------------------------------------
-- Quanty input file generated using Crispy. If you use this file please cite
-- the following reference: http://dx.doi.org/10.5281/zenodo.1008184.
--
-- elements: 5d
-- symmetry: Oh
-- experiment: XAS
-- edge: M2,3 (3p)
------------------... | mretegan/crispy | crispy/quanty/templates/5d_Oh_XAS_3p.lua | Lua | mit | 33,334 |
PLUGIN.name = "Zombie Spawner"
PLUGIN.author = "Pablo J. Martínez"
PLUGIN.desc = "Spawns zombies around the map randomly."
if(SERVER) then
ZombieSpawns = {}
SpawnsRecentlyUsed = {}
TotalNumberOfZombies = 0
end
hook.Add( "InitPostEntity", "InitializeZombieSpawner", function()
if(SERVER) then
... | pablojmartinez/theatreofpain | theatreofpain/plugins/sh_zombiespawner.lua | Lua | mit | 5,776 |
--[[
s:UI Unit Frame Element: Shield Bar
Martin Karer / Sezz, 2014
http://www.sezz.at
--]]
local MAJOR, MINOR = "Sezz:UnitFrameElement:ShieldBar-0.1", 1;
local APkg = Apollo.GetPackage(MAJOR);
if (APkg and (APkg.nVersion or 0) >= MINOR) then return; end
local NAME = string.match(MAJOR, ":(%a+)\-");
local Elemen... | mkarer/SezzUnitFrames | Elements/ShieldBar.lua | Lua | mit | 2,906 |
return Def.Sprite {
Texture=NOTESKIN:GetPath('UpRightFoot','Hold Head Active');
InitCommand=cmd(basezoomx,-1;diffuse,color("0.5,0.5,0.5,1"));
}; | Brenin/PJ-3100 | Working Launchers/Games/Stepmania/StepMania 5/NoteSkins/kickbox/default/UpLeftFoot Hold Head Inactive.lua | Lua | mit | 146 |
local t = Def.ActorFrame{}
t[#t+1] = LoadActor("Center_blend")..{
InitCommand=cmd(diffuseshift;effectcolor1,color("#9b873766");effectcolor2,color("#9b873766"));
}
t[#t+1] = LoadActor("Center_blend")..{
InitCommand=cmd(blend,Blend.Add;diffuseshift;effectcolor1,color("#ccb752FF");effectcolor2,color("#ccb75266");effe... | Brenin/PJ-3100 | Working Launchers/Games/Stepmania/StepMania 5/NoteSkins/pump/delta/Center Tap Note.lua | Lua | mit | 804 |
AddCSLuaFile()
SWEP.PrintName = "Crowbar"
if CLIENT then
SWEP.ViewModelFlip = false
end
SWEP.Base = "weapon_base"
SWEP.Slot = 0
SWEP.SlotPos = 1
SWEP.UseHands = true
SWEP.ViewModel = "models/weapons/v_crowbar.mdl"
SWEP.WorldModel = "models/weapons/w_crowbar.mdl"
SWEP.Primary.ClipSize = -1
SWEP.Primary.DefaultC... | lolleko/guesswho | gamemodes/guesswho/entities/weapons/weapon_gw_seeker_crowbar.lua | Lua | mit | 5,222 |
local skynet = require "skynet"
local datacenter = require "datacenter"
local function f1()
print("====1==== wait hello")
print("\t1>",datacenter.wait ("hello")) -- 获得 world, 因为已经插入了 hello
print("====1==== wait key.foobar")
print("\t1>", pcall(datacenter.wait,"key")) -- will failed, because "key" is a branch, 将失败,... | KAndQ/skynet | test/testdatacenter.lua | Lua | mit | 824 |
require('LimitedAttack')
function Server_StartGame(game, standing)
LimitedAttack(game, standing);
end
| RealMelwei/WarlightMods | Limited Multiattack/Server_StartGame.lua | Lua | mit | 105 |
return function(namespace)
return function(ctx, path, op, ...)
end
end | CoderPuppy/cc-peaking-development | .pile/peak-procfs/index.lua | Lua | mit | 75 |
--[[
2. 优点:
3. 1、有时一些发起人对象的内部信息必须保存在发起人对象以外的地方,但是必须要由发起
人对象自己读取,这时,使用备忘录模式可以把复杂的发起人内部信息对其他的对象屏蔽起来,从而可以
恰当地保持封装的边界。
4. 2、本模式简化了发起人类。发起人不再需要管理和保存其内部状态的一个个版本,客户端
可以自行管理他们所需要的这些状态的版本。
5. 3、当发起人角色的状态改变的时候,有可能这个状态无效,这时候就可以使用暂时存储起
来的备忘录将状态复原。
6.
7. 缺点:
8. 1、如果发起人角色的状态需要完整地存储到备忘录对象中,那么在资源消耗上面备忘录对
象会很昂贵。
9. 2、当负责人角色将一个备忘录 存储起来的... | woshihuo12/LuaDesignPattern | memento.lua | Lua | mit | 2,804 |
local PANEL = {}
function PANEL:Init()
if (IsValid(nut.gui.stash)) then
nut.gui.stash:Remove()
end
nut.gui.stash = self
self:SetSize(ScrW() * 0.5, 680)
self:MakePopup()
self:Center()
self.stash = self:Add("nutStashItemList")
self.stash:Dock(LEFT)
self.stash:SetWide(self:GetWide() * 0.5 - 7)
s... | xAleXXX007x/Witcher-RolePlay | witcherrp/plugins/stash/derma/cl_stash.lua | Lua | mit | 4,942 |
-- Kong core
--
-- This consists of events that need to
-- be ran at the very beginning and very end of the lua-nginx-module contexts.
-- It mainly carries information related to a request from one context to the next one,
-- through the `ngx.ctx` table.
--
-- In the `access_by_lua` phase, it is responsible for retriev... | smanolache/kong | kong/core/handler.lua | Lua | apache-2.0 | 3,609 |
--!A cross-platform build utility based on Lua
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law... | waruqi/xmake | xmake/rules/xmake_cli/xmake.lua | Lua | apache-2.0 | 3,344 |
local Player = {}
Player.__index = Player
setmetatable(Player, {
__call = function (cls, ...)
return cls.init(...)
end,
})
function Player.init(id, posx, posy)
-- Create player
local player = {
id = id,
position = {x = posx, y = posy},
direction = {x = 1, y = 0},
movement = {x = 0, y = 0},
radius = 16... | manneorama/spray | game/player.lua | Lua | apache-2.0 | 4,029 |
-- test_matrix_alg.lua
local matrix = require('test_matrix')
local E1 = matrix:new(4,"I",16)
matrix:dump(E1)
local E2 = matrix:new(4,4,2)
matrix:dump(E2)
local ee = matrix.mul(E1,E2)
matrix:dump(ee) | liangtaohy/lua-demo | test_matrix_alg.lua | Lua | apache-2.0 | 199 |
function f()
a = 15
b = 5
c = 3
-- w should be 20
w = a + b
print(w)
-- x should be 25
x = a / c * b
print(x)
-- y should be 11
y = b - a * c / b + a
print(y)
-- z should be 8
z = 2 * a - 30 / c + b - 17
print(z)
end
| mtfuller/lilua-interpreter | example-lua-scripts/simple-op.lua | Lua | bsd-2-clause | 281 |
--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--
-- Multiplayer lobby
gVoiceIconSpeaker = gXLFriendsEnum2UVs[7]
gVoiceIconTalking = gXLFriendsEnum2UVs[10]
gVoiceIconMuted = gXLFriendsEnum2UVs[8]
gVoiceIconTV = gXLFriendsEnum2UVs[9]
--
-- voice status icons
gVoiceStatus =
{... | marth8880/MEUScripts | ifs_mp_lobby.lua | Lua | bsd-3-clause | 41,375 |
---------------------------------------------------------------------------------------------------
-- In case:
-- 1. Mobile app is in LIMITED HMILevel
-- 2. App has some persistent data that can be resumed
-- 3. Mobile app is disconnected during the time frame of 30 sec (inclusive) before "SDL_LOW_VOLTAGE" unix signal... | smartdevicelink/sdl_atf_test_scripts | test_scripts/SDL5_0/LowVoltage/014_Low_Voltage_and_Wake_Up_absence_resumption_LIMITED_hmi_level_in_case_more_30_sec_after.lua | Lua | bsd-3-clause | 2,875 |
-- $Id: lists.lua,v 1.1 2004-05-19 18:10:23 bfulgham Exp $
-- http://www.bagley.org/~doug/shootout/
-- implemented by: Roberto Ierusalimschy
--------------------------------------------------------------
-- List module
-- defines a prototipe for lists
--------------------------------------------------------------
Lis... | kragen/shootout | bench/lists/lists.lua | Lua | bsd-3-clause | 2,529 |
---------------------------------------------------------------------------------------------------
-- Description:
-- Check absence of HMI level resumption in case if:
-- - app has NONE level before unexpected disconnect
-- - another app of different HMI type is registered and switched to FULL just after unexpected ... | smartdevicelink/sdl_atf_test_scripts | test_scripts/Resumption/HMI_Level/03_two_apps_NONE_BACKGROUND/003_02_NONE_FULL_different_types_no_resumption.lua | Lua | bsd-3-clause | 1,884 |
---------------------------------------------------------------------------------------------------
-- Description:
-- Check absence of HMI level resumption in case if:
-- - app has FULL level before unexpected disconnect
-- - another app of the same HMI type is registered and switched to LIMITED just after unexpecte... | smartdevicelink/sdl_atf_test_scripts | test_scripts/Resumption/HMI_Level/04_two_apps_LIMITED_FULL/004_11_FULL_LIMITED_same_types_no_resumption.lua | Lua | bsd-3-clause | 1,902 |
-- MP3 duration estimator. Allows estimating duration of mp3 files. Suffers from same problems as id3parser, but
-- if one is used the other is basically free.
--
-- It goes through the whole mp3 file, so performance/stability is not guaranteed. Use with your own risk.
--
-- Code partially based on id3parser and http:/... | Noiwex/gmod-medialib | ext/mp3duration.lua | Lua | mit | 6,322 |
--[[lit-meta
name = "creationix/uv"
description = "Shim to use 'luv' as 'uv' for non-luvi based apps using luvit libs"
version = "1.8.0"
]]
return require 'luv'
| NerdWalletOSS/Q | QLI_LUA/DEPRECATED/Q_TOOL/deps/uv.lua | Lua | mit | 167 |
local Animation = require 'utility/Animation'
return function(config)
local animation = Animation({
sprites = 'res/extra_life.png',
frame_time = 0.25
})
local pickup = Animation({
sprites = 'res/picked_up.png',
frame_time = 0.05,
once = true
})
return {
position = {
x = config... | ryanplusplus/love-for-lua-game-programming | entity/ExtraLife.lua | Lua | mit | 572 |
--ensure environment is set up
assert(type(file) == 'nil')
assert(type(describe) == 'function')
assert(type(context) == 'function')
assert(type(it) == 'function')
assert(type(spec) == 'function')
assert(type(test) == 'function')
assert(type(before_each) == 'function')
assert(type(after_each) == 'function')
assert(type(... | istr/busted | spec/core_spec.lua | Lua | mit | 13,900 |
local _M = globalclass(...);
require("Delegate")
function _M:ctor()
self.handlers = { }
self.disableCollectOnFire = nil;
local metatable = getmetatable(self);
metatable.__call = self.Invoke;
end
function _M:IsEmpty()
return #self.handlers == 0;
end
function _M:Add(func, ...)
local del = Delegate.new(func, ..... | fjz13/Medusa | Test/Test/Dev/Resource/Script/Medusa/Core/Event.lua | Lua | mit | 1,112 |
--- === hs.audiodevice ===
---
--- Manipulate the system's audio devices
---
--- This module is based primarily on code from the previous incarnation of Mjolnir by [Steven Degutis](https://github.com/sdegutis/).
local module = require("hs.audiodevice.internal")
module.watcher = require("hs.audiodevice.watcher")
local ... | cmsj/hammerspoon | extensions/audiodevice/init.lua | Lua | mit | 5,113 |
--These contain tables for relevant, spawnable NPCs
include_lua('./Spawndefs/Contaminated_Outbreak.spawndef.lua')
include_lua('./Spawndefs/Police_Robots_Outbreak.spawndef.lua')
include_lua('./Spawndefs/Shady_Deal_Cop_Outbreak.spawndef.lua')
--[[
NOTE: Neither the city cops or Robots (with no #) are used for some re... | broxen/Segs | Projects/CoX/Data/scripts/City_00_01/ES_Library_Objects.lua | Lua | bsd-3-clause | 1,888 |
local a = redis.call('get', KEYS[1])
local b = redis.call('get', KEYS[2])
return a + b
| dixiS/em-hiredis | examples/lua/sum.lua | Lua | mit | 88 |
local env = environment()
local l = mk_param_univ("l")
check_error(function() env = add_decl(env, mk_constant_assumption("A", {l, l}, mk_sort(l))) end)
| c-cube/lean | tests/lua/tc6.lua | Lua | apache-2.0 | 152 |
--
-- lovebird
--
-- Copyright (c) 2014, rxi
--
-- This library is free software; you can redistribute it and/or modify it
-- under the terms of the MIT license. See LICENSE for details.
--
local socket = require "socket"
local lovebird = { _version = "0.3.0" }
lovebird.loadstring = loadstring or load
lovebird.inite... | rdlaitila/LURE | src/__legacy__/lib/lovebird.lua | Lua | mit | 17,982 |
--[[
Copyright 2014-2015 The Luvit Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law o... | kaustavha/lit | deps/pretty-print.lua | Lua | apache-2.0 | 9,471 |
--
-- Implementation of queueing API.
--
-- Faster and simplified version of queue.
-- No delayed tasks
-- No ttl
-- No ttr
--
--
-- A task in a queue can be in one of the following states:
-- READY initial state, the task is ready for execution
-- TAKEN the task is being worked on
-- BURIED (TODO) t... | derElektrobesen/tntlua | fqueue.lua | Lua | bsd-2-clause | 9,628 |
local usermanager = require "core.usermanager"
local httpserver = require "net.httpserver"
local jidutil = require "util.jid"
local hmac = require "hmac"
local base64 = require "util.encodings".base64
local humane = require "util.serialization".serialize
-- Configuration
local base = "openid"
local openidns = "http:... | mmusial/prosody-modules | mod_openid/mod_openid.lua | Lua | mit | 15,176 |
------------------------------------------------------------------------------
-- DHT11/22 query module
--
-- LICENCE: http://opensource.org/licenses/MIT
-- Vladimir Dronnikov <dronnikov@gmail.com>
--
-- Example:
-- print("DHT11", dofile("dht22.lua").read(4))
-- print("DHT22", dofile("dht22.lua").read(4, true))
-- NB: ... | gentooliano/nodemcu-firmware | nodemcu_0.9.6-dev/nodemcu-firmware-0.9.6-dev_20150704/lua_examples/yet-another-dht22.lua | Lua | mit | 2,195 |
solution "enet"
configurations { "Debug", "Release" }
platforms { "x32", "x64" }
project "enet_static"
kind "StaticLib"
language "C"
files { "*.c" }
includedirs { "include/" }
configuration "Debug"
targetsuffix "d"
defines({ "DEBUG" })
flags { "Symbols" }
configuration "Release... | tobspr/P3D-ECS | thirdparty/libenet/enet-master/premake4.lua | Lua | mit | 933 |
local PANEL = {}
function PANEL:Paint(w, h)
local desired = 100
if self.mouseInside then
desired = 255
end
self.alpha = math.Approach(self.alpha or desired, desired, FrameTime()*1200)
self:SetAlpha(self.alpha)
draw.RoundedBox(8, 0, 0, w, h, Color(0, 0, 0, 210))
end
function PANEL:Think()... | noelbenz/gmod-menuplus | gui/fade_panel.lua | Lua | mit | 481 |
local lpeg = require "lpeg"
local table = require "table"
local bit = require "bit"
local P = lpeg.P
local S = lpeg.S
local R = lpeg.R
local C = lpeg.C
local Ct = lpeg.Ct
local Cg = lpeg.Cg
local Cc = lpeg.Cc
local V = lpeg.V
local function count_lines(_,pos, parser_state)
if parser_state.pos < pos then
parser_sta... | zzh442856860/mproto | benchmark/sprotoparser.lua | Lua | mit | 9,298 |
return {
PackageFileName = ".gsmake.lua";
ConfigFileName = ".gsmakeconfig.lua";
TempDirName = ".gsmake";
DefaultVersion = "snapshot";
SkipDirs = { ".gsmake",".git", ".svn" };
TargetHost = require "lemoon.sys" .host();
... | gsmake/gsmake | lib/gsmake/config.lua | Lua | mit | 505 |
-- check for all LiquidFeedback Members with LDAP authentication
-- if the corresponding LDAP entry is still existent and updates
-- changed attributes
-- --------------------------------------------------------------------------
-- prints debug output to stdout
--
-- returns
-- success: true if no error occured duri... | ddouglascarr/rooset | lffrontend/env/ldap/update_all_members.lua | Lua | mit | 1,736 |
require "block"
LifeMan = {}
function LifeMan:new()
o =
{
blocks = {},
width = 100,
height = 76,
generation = 0
}
setmetatable(o, self)
self.__index = self
return o
end
function LifeMan:init()
for coll = 1, self.width do
self.blocks[coll] = {}
for row = 1, self.heig... | samueljackson92/scripts | love/MPGOL/lifemanager.lua | Lua | mit | 3,621 |
dofile 'neededtranslations'
-- private variables
local defaultLocaleName = 'en'
local installedLocales
local currentLocale
local GAMELANGUAGE_EN = 1
local GAMELANGUAGE_PT = 2
local GAMELANGUAGE_ES = 3
local GAMELANGUAGE_DE = 4
local GAMELANGUAGE_PL = 5
local GAMELANGUAGE_SV = 6
local GAME... | Riverlance/kingdom-age-game-linux | modules/client_locales/locales.lua | Lua | mit | 6,142 |
local crypto = require "crypto"
local M = {}
function M:new(radialDistance, inclination, azimuth)
local c = {}
c.radialDistance = radialDistance
c.inclination = inclination
c.azimuth = azimuth
c.title = ""
c.subtitle = ""
function c:isEqualToCoordinate(other)
if other == self t... | jyrkih/arkit-corona | arkit/arcoordinate.lua | Lua | mit | 1,440 |
function test_joystick_buttons()
result = joysticks[1]:isGamepadDown("a")
love.graphics.print(tostring(result), 200, 20)
result = joysticks[1]:isGamepadDown("b")
love.graphics.print(tostring(result), 200, 40)
result = joysticks[1]:isGamepadDown("x")
love.graphics.print(tostring(result), 200, 60)
result = joystic... | Senevri/loveRL | first/test.lua | Lua | mit | 1,469 |
os.loadAPI("ws/log.lua"); local log = _G["log.lua"]
os.loadAPI("ws/Constants.lua"); local Constants = _G["Constants.lua"]
os.loadAPI("ws/Peripherals.lua"); local Peripherals = _G["Peripherals.lua"]
os.loadAPI("ws/Utils.lua"); local Utils = _G["Utils.lua"]
os.loadAPI("ws/World.lua"); local World = _G["World.lua"]
local... | AlexBarnes86/ComputerCraft | src/Server.lua | Lua | mit | 2,447 |
wmcp = {}
function wmcp.include_cl(file)
if SERVER then AddCSLuaFile(file) end
if CLIENT then return include(file) end
end
function wmcp.include_sv(file)
if SERVER then return include(file) end
end
function wmcp.include_sh(file)
return wmcp.include_cl(file) or wmcp.include_sv(file)
end
-- Load libraries
wmcp.medi... | wyozi/wmc-plus | lua/autorun/wmcplus.lua | Lua | mit | 934 |
--[[
Licensed under GNU General Public License v2
* (c) 2013, Luke Bonham
--]]
local debug = require("debug")
local assert = assert
local capi = { timer = (type(timer) == 'table' ... | gajjanag/config_files | awesome/lain/helpers.lua | Lua | mit | 3,646 |
-- This script will check for directional lights and begin rotating them slowly if there are any
killProcesses() -- stops all running lua coroutine processes
backlog_post("---> START SCRIPT: rotate_sun.lua")
scene = GetScene()
runProcess(function()
while true do
local lights = scene.Component_GetLightArray()
... | turanszkij/WickedEngine | Content/scripts/rotate_sun.lua | Lua | mit | 712 |
local getChildren
getChildren = function (id, level, result)
level = level - 1
local value = redis.call('get', prefix .. id)
if not value then
return result
end
local list = cmsgpack.unpack(value)
for i, v in ipairs(list) do
local cid = v[1]
local hasChild = v[2]
local item = { cid, hasChi... | shimohq/ioredis-tree | lua/tchildren.lua | Lua | mit | 972 |
edit = {} -- A Gamestate
function edit:init()
love.physics.setMeter(32)
love.mouse.setVisible(false)
self.world = love.physics.newWorld()
self.camera = Camera()
self.player = Player()
ItemEntity.setWorld(self.world)
self.itemEntities = {}
self.shipEntities = {}
self.slot... | shuttler67/SpaceShip | edit.lua | Lua | mit | 7,239 |
local Ground = {}
Ground.rect = require "rectangle"
Ground.rect = Rect:new()
Ground.rect:set(0,565, 1000, 50)
function Ground:draw()
local x = self.rect.x
local y = self.rect.y
local w = self.rect.width
local h = self.rect.height
love.graphics.setColor(120,40,10,255)
love.graphics.rectangle("fill", x, y, w... | oddlydrawn/flapShmup | ground.lua | Lua | mit | 468 |
if not igg then igg = {} end
if not igg.items then igg.items = {} end
function try_init()
if #igg.items > 0 and igg.loaded then return end
local items = {}
for _,item in pairs(game.item_prototypes) do
table.insert(igg.items, item.name)
end
igg.loaded = true
end
script.on_event("igg-toggle", function(e... | coltonj96/ItemGiverGui | ItemGiverGui_0.0.7/control.lua | Lua | mit | 11,372 |
local initiative = Initiative:new_selector():add_where{ "id = ?", param.get_id()}:single_object_mode():exec()
-- TODO important m1 selectors returning result _SET_!
local issue = initiative:get_reference_selector("issue"):for_share():single_object_mode():exec()
if issue.closed then
slot.put_into("error", _"This iss... | ddouglascarr/rooset | lffrontend/app/main/initiative/_action/remove_support.lua | Lua | mit | 816 |
require 'torch'
require 'nn'
require 'cifar10-data-loader'
local EXCLUDE_CUDA_FLAG = false
local function cudaRequires()
require 'cutorch'
require 'cunn'
end
if pcall(cudaRequires) then
print('Imported cuda modules in first-cnn-arch')
else
print('Failed to import cuda modules in first-cnn-arch')
EX... | egaebel/cifar-neural-networks | old-code/first-cnn-arch.lua | Lua | mit | 5,079 |
--[[-------------------------------------------------------------------------
You are free to use, distribute and change this module, as long as you keep
this text here - and/or credit me:
Made by Fillipuster :D
---------------------------------------------------------------------------]]
CLASSICADVERT = CLASSICADVER... | OctoEnigma/shiny-octo-system | addons/darkrpmodification-master/lua/darkrp_modules/fp_classicadvert/sh_config.lua | Lua | mit | 1,673 |
local developer = {}
function developer.make_chunk_markers(name)
data:extend{
{
type = "simple-entity",
name = "debug-chunk-marker",
flags = {"placeable-off-grid"},
selectable_in_game = false,
collision_mask = {},
render_layer = "light-... | dustine/ChargeTransmission | stdlib/prototype/prototypes/developer.lua | Lua | mit | 2,097 |
-- Object representing a received reward.
local Reward = {}
Reward.__index = Reward
-- scoreDiffReward = reward from score changes between states
-- xDiffReward = reward from Mario moving to the right
-- levelBeatenReward = reward from finishing the level or Mario dying
-- expectedGammaReward = discounted Q-value rewa... | aleju/mario-ai | reward.lua | Lua | mit | 1,145 |
local BasePlugin = require "kong.plugins.base_plugin"
local responses = require "kong.tools.responses"
local rules = require "kong.plugins.bot-detection.rules"
local bot_cache = require "kong.plugins.bot-detection.cache"
local strip = require("kong.tools.utils").strip
local ipairs = ipairs
local get_headers = ngx.req.... | akh00/kong | kong/plugins/bot-detection/handler.lua | Lua | apache-2.0 | 2,105 |
local boss = {
["diseased dan"] = Storage.InServiceofYalahar.DiseasedDan,
["diseased bill"] = Storage.InServiceofYalahar.DiseasedBill,
["diseased fred"] = Storage.InServiceofYalahar.DiseasedFred,
}
function onKill(cid, target)
if(boss[string.lower(getCreatureName(target))]) then
local player = Player(cid)
if(p... | victorperin/tibia-server | data/creaturescripts/scripts/in service of yalahar quest/inServiceOfYalaharQuestsDiseased.lua | Lua | apache-2.0 | 584 |
local readmeURL = "https://github.com/openwrt/packages/tree/master/net/vpn-policy-routing/files/README.md"
local packageName = "vpn-policy-routing"
local uci = require "luci.model.uci".cursor()
local sys = require "luci.sys"
local util = require "luci.util"
local ip = require "luci.ip"
local fs = require "nixio.fs"
lo... | rogerpueyo/luci | applications/luci-app-vpn-policy-routing/luasrc/model/cbi/vpn-policy-routing.lua | Lua | apache-2.0 | 17,662 |
-- Generated By protoc-gen-lua Do not Edit
local protobuf = require "protobuf"
module('BceLottery_pb', package.seeall)
local BCELOTTERY = protobuf.Descriptor();
local BCELOTTERY_IDX_FIELD = protobuf.FieldDescriptor();
local BCELOTTERY_ID_FIELD = protobuf.FieldDescriptor();
local BCELOTTERY_ISPVE_FIELD = protobuf.Fiel... | wangqi/gameserver | server/src/gensrc/lua/BceLottery_pb.lua | Lua | apache-2.0 | 2,824 |
-- Automatically generated file: Monster Abilities
return {
[257] = {id=257,en="Foot Kick",ja="フットキック",element=6,icon_id=46,monster_level=1,prefix="/monsterskill",range=2,targets=32,tp_cost=1000},
[258] = {id=258,en="Dust Cloud",ja="土煙",element=3,icon_id=43,monster_level=10,prefix="/monsterskill",range=2,t... | KenshiDRK/Resources | resources_data/monster_abilities.lua | Lua | bsd-3-clause | 340,770 |
module('bamboo.errors', package.seeall)
local View = require 'bamboo.view'
-- Reports errors back to the browser so the user has something to work with.
function reportError(conn, request, err, state)
local trace = debug.traceback(state.controller, err)
local info
local source = nil
info = debug.get... | daogangtang/bamboo | src/errors.lua | Lua | bsd-3-clause | 2,035 |
local tnt = require 'torchnet'
local vision = require 'torchnet-vision'
require 'image'
require 'os'
require 'optim'
ffi = require 'ffi'
local logtext = require 'torchnet.log.view.text'
local logstatus = require 'torchnet.log.view.status'
local transformimage = require 'torchnet-vision.image.transformimage'
local upm... | Cadene/torchnet-vision | example/upmcfood101extract.lua | Lua | bsd-3-clause | 5,683 |
SILE.hyphenator.languages["fi"] = {}
SILE.hyphenator.languages["fi"].patterns =
{
"1ba",
"1be",
"1bi",
"1bo",
"1bu",
"1by",
"1da",
"1de",
"1di",
"1do",
"1du",
"1dy",
"1dä",
"1dö",
"1fa",
"1fe",
"1fi",
"1fo",
"1fu",
"1fy",
"1ga",
"1ge",
"1gi",
"1go",
"1gu",
"1gy",
"1gä",
"1gö",
"1ha",
"1he",
"1hi",
"1ho",
"1hu",
"1hy",
... | simoncozens/sile | languages/fi.lua | Lua | mit | 4,642 |
local Addon, Engine = ...
Engine:NewConfig("Minimap", {
useGameTime = false,
use24hrClock = true,
useSmallerMap = false
})
Engine:NewConfig("WorldMap", {
revealHidden = true
}) | cogwerkz/DiabolicUI | defaults/minimap.lua | Lua | mit | 183 |
minion = {
hp = 1000,
x = 10,
y = 25 }
for i, v in pairs(minion) do
print(i, "=>", v)
end
--https://pt.stackoverflow.com/q/78830/101
| maniero/SOpt | Lua/ListTable.lua | Lua | mit | 141 |
package.path = package.path .. ";./test/?.lua;./lua/?.lua"
require "Json"
function test1()
for i = 1, 10 do
print("In Test1: " .. tostring(i))
end
end
function test2(first, last)
for i = first, last do
print("In Test2: " .. tostring(i))
end
end
function sum2(a, b)
local result =... | sgzwiz/lunarprobe | test/test.lua | Lua | apache-2.0 | 1,478 |
--
-- Copyright (c) 2014, Facebook, Inc.
-- All rights reserved.
--
-- This source code is licensed under the BSD-style license found in the
-- LICENSE file in the root directory of this source tree. An additional grant
-- of patent rights can be found in the PATENTS file in the same directory.
--
--- Completion ... | facebook/fblualib | fblualib/editline/fb/editline/completer.lua | Lua | bsd-3-clause | 9,231 |
--[[/*
* (C) 2012-2013 Marmalade.
*
* 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,... | elapuestojoe/survive | resources/quicklua/QNodeGLProgram.lua | Lua | mit | 1,937 |
module(..., package.seeall)
local lib = require('core.lib')
local yang = require('lib.yang.yang')
function show_usage(code)
print(require('program.lwaftr.compile_configuration.README_inc'))
main.exit(code)
end
function parse_args(args)
local handlers = {}
function handlers.h() show_usage(0) end
args =... | snabbco/snabb | src/program/lwaftr/compile_configuration/compile_configuration.lua | Lua | apache-2.0 | 747 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.