repo_name
stringlengths
6
78
path
stringlengths
4
206
copies
stringclasses
281 values
size
stringlengths
4
7
content
stringlengths
625
1.05M
license
stringclasses
15 values
saeqe/botele
plugins/id.lua
355
2795
local function user_print_name(user) if user.print_name then return user.print_name end local text = '' if user.first_name then text = user.last_name..' ' end if user.lastname then text = text..user.last_name end return text end local function returnids(cb_extra, success, resu...
gpl-2.0
bigdogmat/wire
lua/wire/stools/hoverball.lua
1
1548
WireToolSetup.setCategory( "Physics/Force" ) WireToolSetup.open( "hoverball", "Hoverball", "gmod_wire_hoverball", nil, "Hoverballs" ) if CLIENT then language.Add( "tool.wire_hoverball.name", "Wired Hoverball Tool" ) language.Add( "tool.wire_hoverball.desc", "Spawns a hoverball for use with the wire system." ) langu...
apache-2.0
hleuwer/luayats
examples/test-5-display-attach.lua
1
4499
require "stdlib" require "src" require "muxdmx" require "misc" require "graphics" -- example test-1.lua: derived from yats example 'tst'. -- -- cbrsrc_1 --> |\ /|--> line_1 --> sink_1 -- cbrsrc_2 --> | | | |--> line_2 --> sink_2 -- cbrsrc_3 --> | | -->| |--> line_3 --> sink_3 -- cbrsrc_4 --> | | | |--> line...
gpl-2.0
cpascal/skynet
lualib/snax.lua
59
3683
local skynet = require "skynet" local snax_interface = require "snax.interface" local snax = {} local typeclass = {} local interface_g = skynet.getenv("snax_interface_g") local G = interface_g and require (interface_g) or { require = function() end } interface_g = nil skynet.register_protocol { name = "snax", id =...
mit
bizkut/BudakJahat
Libs/DiesalGUI-1.0/Objects/Accordian.lua
6
2763
local DiesalGUI = LibStub("DiesalGUI-1.0") -- ~~| Libraries |~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ local DiesalTools = LibStub("DiesalTools-1.0") local DiesalStyle = LibStub("DiesalStyle-1.0") -- | Lua Upvalues |~~~~...
gpl-3.0
NSAKEY/prosody-modules
mod_telnet_tlsinfo/mod_telnet_tlsinfo.lua
32
1220
-- mod_telnet_tlsinfo.lua module:set_global(); module:depends("admin_telnet"); local console_env = module:shared("/*/admin_telnet/env"); local c2s_sessions = module:shared("/*/c2s/sessions"); local s2s_sessions = module:shared("/*/s2s/sessions"); local function print_tlsinfo(print, session) if session.secure then ...
mit
rickvanbodegraven/nodemcu-firmware
lua_examples/u8glib/u8g_graphics_test.lua
43
4007
-- setup I2c and connect display function init_i2c_display() -- SDA and SCL can be assigned freely to available GPIOs local sda = 5 -- GPIO14 local scl = 6 -- GPIO12 local sla = 0x3c i2c.setup(0, sda, scl, i2c.SLOW) disp = u8g.ssd1306_128x64_i2c(sla) end -- setup SPI and connect display ...
mit
NSAKEY/prosody-modules
mod_auth_ldap/mod_auth_ldap.lua
31
3900
-- mod_auth_ldap local new_sasl = require "util.sasl".new; local lualdap = require "lualdap"; local function ldap_filter_escape(s) return (s:gsub("[*()\\%z]", function(c) return ("\\%02x"):format(c:byte()) end)); end -- Config options local ldap_server = module:get_option_string("ldap_server", "localhost"); local lda...
mit
mahdikord/mep
plugins/help.lua
25
4629
do function pairsByKeys(t, f) local a = {} for n in pairs(t) do table.insert(a, n) end table.sort(a, f) local i = 0 -- iterator variable local iter = function () -- iterator function i = i + 1 if a[i] == nil then return nil else return a[i], t[a[i]] end end return iter end...
gpl-2.0
pkulchenko/ZeroBraneEduPack
complex-samples/bezier.lua
1
2321
local turtle = require("turtle") local complex = require("complex") local common = require("common") local col = require("colormap") local crt = require("chartmap") local dX,dY = 1,1 local W , H = 800, 600 local minX, maxX = -4, 8 local minY, maxY = -2, 8 local greyLevel = 200 local intX = crt.New("interva...
mit
rickvanbodegraven/nodemcu-firmware
lua_examples/yet-another-dht22.lua
65
2195
------------------------------------------------------------------------------ -- 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: ...
mit
dmekersa/Gamecodeur
Atelier Redemption of Sam/Step17/mobmanager.lua
1
1458
local mobManager = {} local gameState = require("gamestate") local imgMouche = love.graphics.newImage("Images/mob1.png") mobManager.liste_mobs = {} mobManager.Reset = function() mobManager.liste_mobs = {} end mobManager.CreeMob = function(pType, pX, pY, pVx, pVy) local mob = {} mob.type = pType mob.x =...
cc0-1.0
alirezanile/Nilebot
bot/nod32bot.lua
1
11836
package.path = package.path .. ';.luarocks/share/lua/5.2/?.lua' ..';.luarocks/share/lua/5.2/?/init.lua' package.cpath = package.cpath .. ';.luarocks/lib/lua/5.2/?.so' require("./bot/utils") VERSION = '2' -- This function is called when tg receive a msg function on_msg_receive (msg) if not started then return...
gpl-2.0
Weol/WUMA
lua/wuma/client/vgui/vgui_textbox.lua
1
2411
local PANEL = {} AccessorFunc(PANEL, "max_numeric", "MaxNumeric", FORCE_NUMBER) AccessorFunc(PANEL, "min_numeric", "MinNumeric", FORCE_NUMBER) function PANEL:Init() self.default_color = Color(150, 150, 150) end function PANEL:SetDefault(default) self.default = default self:OnLoseFocus() end funct...
apache-2.0
rickvanbodegraven/nodemcu-firmware
lua_modules/dht_lib/dht_lib.lua
51
4895
-- *************************************************************************** -- DHTxx(11,21,22) module for ESP8266 with nodeMCU -- -- Written by Javier Yanez mod by Martin -- but based on a script of Pigs Fly from ESP8266.com forum -- -- MIT license, http://opensource.org/licenses/MIT -- *****************************...
mit
dicebox/minetest-france
mods/travelnet/elevator.lua
3
3991
-- This version of the travelnet box allows to move up or down only. -- The network name is determined automaticly from the position (x/z coordinates). -- >utor: Sokomine minetest.register_node("travelnet:elevator", { description = "Elevator", drawtype = "mesh", mesh = "travelnet_elevator.obj", sunlight_propagates...
gpl-3.0
NSAKEY/prosody-modules
mod_checkcerts/mod_checkcerts.lua
29
2809
local ssl = require"ssl"; local datetime_parse = require"util.datetime".parse; local load_cert = ssl.loadcertificate; local st = require"util.stanza" -- These are in days. local nag_time = module:get_option_number("checkcerts_notify", 7) * 86400; if not load_cert then module:log("error", "This version of LuaSec (%s)...
mit
facebook/fbcunn
fbcunn/OneBitQuantization.lua
9
1269
-- Copyright 2004-present Facebook. All Rights Reserved. require 'cutorch' require 'nn' --[[ CUDA implementation of the quantize/unquantize methods used by `nn.OneBitDataParallel`. ]] local OneBitQuantization = torch.class('nn.OneBitQuantization') function OneBitQuantization:__init() self.quantized = torch.CudaTe...
bsd-3-clause
pouria346/self_bot
plugins/plugins.lua
22
4662
do to_id = "" -- Returns the key (index) in the config.enabled_plugins table local function plugin_enabled( name ) for k,v in pairs(_config.enabled_plugins) do if name == v then return k end end -- If not found return false end -- Returns true if file exists in plugins folder local function plu...
gpl-2.0
grimreaper/ValyriaTear
dat/tilesets/desert_cave_water.lua
2
11608
local ns = {}; setmetatable(ns, {__index = _G}); desert_cave_water = ns; setfenv(1, ns); file_name = "dat/tilesets/desert_cave_water.lua" image = "img/tilesets/desert_cave_water.png" num_tile_cols = 16 num_tile_rows = 16 -- The general walkability of the tiles in the tileset. Zero indicates walkable. One tile has fou...
gpl-2.0
4w/xtend
xvessels/registering_function.lua
2
5709
-- +l liquid texture -- +m top material -- +f foots material local top = '+m.png^(+l^xvessels_mask_top.png^[makealpha:0,0,0)' local bottom = '+m.png^(+f.png^xvessels_mask_bottom.png^[makealpha:0,0,0)' local sides = '+m.png^(+f.png^xvessels_mask_foot.png^[makealpha:0,0,0)' local nodebox = { {-0.5, 0, -0.5, 0.5,...
gpl-3.0
bigdogmat/wire
lua/entities/gmod_wire_spu/init.lua
1
10318
-- Load shared/clientside stuff AddCSLuaFile("cl_init.lua") AddCSLuaFile("cl_spuvm.lua") AddCSLuaFile("shared.lua") include("shared.lua") ENT.WireDebugName = "ZSPU" -------------------------------------------------------------------------------- WireSPU_MaxChannels = 32 ----------------------------------------------...
apache-2.0
bizkut/BudakJahat
Rotations/Old/old_HolyKuukuu.lua
1
49008
local rotationName = "Kuukuu" -- Change to name of profile listed in options drop down --------------- --- Toggles --- --------------- local function createToggles() -- Define custom toggles -- Cooldown Button CooldownModes = { [1] = { mode = "Auto", value = 1 , overlay = "Cooldowns Automated", tip = "Auto...
gpl-3.0
ld-test/morse
src/morse.lua
3
4860
--- morse, a Lua module for translating text to Morse code. -- -- This module provides a text to Morse code function. The one -- interesting bit is that the implemetation is designed to allow you -- to easily override the way the symbols are generated so that you could, for example, -- have it beep, rather than print d...
mit
hleuwer/luayats
examples/rstp-test-play-speed.lua
1
3571
require "yats.rstp.play" linkToBreak = tonumber(os.getenv("TK_LINK")) or 7 --linkToBreak = 1 NumberOfBridges = 7 -- Setting test non nil provides additional output. --test = true test = nil -- Init the yats random generator. yats.log:info("Init random generator.") yats.sim:SetRand(10) yats.sim:setSlotLength(1e-3) -...
gpl-2.0
kracwarlock/dp
propagator/experiment.lua
1
9238
------------------------------------------------------------------------ --[[ Experiment ]]-- -- An experiment propagates DataSets through Models. The specifics -- such propagations are handled by Propagators. The propagation of -- a DataSet is called an epoch. At the end of each epoch, a monitoring -- step is perfor...
bsd-3-clause
dufferzafar/Project-Euler-Solutions
Problems 1-50/33.lua
1
1214
--[[ Problem No. 33 If the product of the four fractions is given in its lowest common terms, find the value of the denominator. Saturday, January 14, 2012 ]]-- --Global Declarations local sub = string.sub local rep = string.rep local int = tonumber local str = tostring --The Main Loop for n = 11, 98 ...
unlicense
tianxiawuzhei/cocos-quick-lua
quick/samples/anysdk/src/cocos/cocos2d/DrawPrimitives.lua
98
12024
local dp_initialized = false local dp_shader = nil local dp_colorLocation = -1 local dp_color = { 1.0, 1.0, 1.0, 1.0 } local dp_pointSizeLocation = -1 local dp_pointSize = 1.0 local SHADER_NAME_POSITION_U_COLOR = "ShaderPosition_uColor" local targetPlatform = cc.Application:getInstance():getTargetPlatform() lo...
mit
czlc/skynet
examples/watchdog.lua
1
1603
-- Ï൱ÓÚÊÇagentµÄmanager -- µ±´ò¿ªÒ»¸ögate£¬gateÊÕµ½µÄÏûÏ¢»áת·¢¸øµÄÄ¿±ê·þÎñͳ³Æwatchdog£¬±ÈÈçclusterd¾ÍÊÇÒ»Ö» local skynet = require "skynet" local CMD = {} local SOCKET = {} local gate local agent = {} -- [fd] = agent -- gate acceptÁ˿ͻ§¶ËÁ¬½Ó£¬ÓÉwatchdog´´½¨agent£¬Í¬ÓÚÒ»¶ÔÒ»µÄͨÐÅ function SOCKET.open(fd, addr) ...
mit
dicebox/minetest-france
mods/locked_travelnet/locked_travelnet.lua
1
4845
-- contains the node definition for a general travelnet that can be used by anyone -- further travelnets can only be installed by the owner or by people with the travelnet_attach priv -- digging of such a travelnet is limited to the owner and to people with the travelnet_remove priv (useful for admins to clean up) ...
gpl-3.0
spike-spb/local-mexes
lopatin.lua
1
1795
-- based on Andrew Lopatin's C++ implementation of "hungarian" algorithm -- for the assignment problem: http://e-maxx.ru/algo/assignment_hungary -- additional info: http://acm.mipt.ru/twiki/bin/view/Algorithms/HungarianAlgorithmCPP -- and implementation in C++: https://github.com/catbaxter/algorithms local function lo...
gpl-2.0
GarfieldJiang/UGFWithToLua
Assets/ToLua/ToLua/Lua/UnityEngine/Quaternion.lua
7
13664
-------------------------------------------------------------------------------- -- Copyright (c) 2015 , 蒙占志(topameng) topameng@gmail.com -- All rights reserved. -- Use, modification and distribution are subject to the "MIT License" ------------------------------------------------------------------------...
mit
robert00s/koreader
plugins/autosuspend.koplugin/main.lua
4
3451
local Device = require("device") if not Device:isKobo() and not Device:isSDL() then return { disabled = true, } end local DataStorage = require("datastorage") local LuaSettings = require("luasettings") local PluginShare = require("pluginshare") local UIManager = require("ui/uimanager") local WidgetContainer = require...
agpl-3.0
dicebox/minetest-france
games/minetest_game/mods/tnt/init.lua
6
16530
tnt = {} -- Default to enabled when in singleplayer local enable_tnt = minetest.setting_getbool("enable_tnt") if enable_tnt == nil then enable_tnt = minetest.is_singleplayer() end -- loss probabilities array (one in X will be lost) local loss_prob = {} loss_prob["default:cobble"] = 3 loss_prob["default:dirt"] = 4 ...
gpl-3.0
silverhammermba/awesome
lib/wibox/widget/textclock.lua
3
1814
--------------------------------------------------------------------------- --- Text clock widget. -- -- @author Julien Danjou &lt;julien@danjou.info&gt; -- @copyright 2009 Julien Danjou -- @release @AWESOME_VERSION@ -- @classmod wibox.widget.textclock -------------------------------------------------------------------...
gpl-2.0
abbasgh12345/abbas
plugins/anti-flood2.lua
281
2422
local NUM_MSG_MAX = 5 -- Max number of messages per TIME_CHECK seconds local TIME_CHECK = 5 local function kick_user(user_id, chat_id) local chat = 'chat#id'..chat_id local user = 'user#id'..user_id chat_del_user(chat, user, function (data, success, result) if success ~= 1 then local text = 'I can\'t k...
gpl-2.0
facebook/fbcunn
test/test_DataParallel.lua
1
4350
local fboptim = require('fboptim') -- Copyright 2004-present Facebook. All Rights Reserved. require 'fb.luaunit' require 'optim' require 'fbcunn' require 'cunn' -- Hyper-params. We're targeting a toy problem that computes -- some function of its inputs. local inputWidth = 32 local hiddenWidth = 512 local nHidden = 2 ...
bsd-3-clause
AntiSpammer1313/mranti3
plugins/danbooru.lua
616
1750
do local URL = "http://danbooru.donmai.us" local URL_NEW = "/posts.json" local URL_POP = "/explore/posts/popular.json" local scale_day = "?scale=day" local scale_week = "?scale=week" local scale_month = "?scale=month" local function get_post(url) local b, c, h = http.request(url) if c ~= 200 then return nil end ...
gpl-2.0
ioiasff/qrt
plugins/danbooru.lua
616
1750
do local URL = "http://danbooru.donmai.us" local URL_NEW = "/posts.json" local URL_POP = "/explore/posts/popular.json" local scale_day = "?scale=day" local scale_week = "?scale=week" local scale_month = "?scale=month" local function get_post(url) local b, c, h = http.request(url) if c ~= 200 then return nil end ...
gpl-2.0
h-lame/computationclub-mandelbrot
7ml7w/lua/day_3/notation.lua
1
2504
local function note(letter, octave) local notes = { C = 0, Cs = 1, D = 2, Ds = 3, E = 4, F = 5, Fs = 6, G = 7, Gs = 8, A = 9, As = 10, B = 11 } local notes_per_octave = 12 return (octave + 1) * notes_per_octave + notes[letter] end local tempo = 100 local function duration(value) local quarter ...
cc0-1.0
dicebox/minetest-france
mods/trading/init.lua
2
12149
--[[ Trading mod for Minetest by GunshipPenguin To the extent possible under law, the author(s) have dedicated all copyright and related and neighboring rights to this software to the public domain worldwide. This software is distributed without any warranty. --]] dofile(minetest.get_modpath("trading") .. "/settings.l...
gpl-3.0
arventwei/WioEngine
Tools/jamplus/src/luaplus/Src/Modules/lua-cjson/tests/bench.lua
145
3247
#!/usr/bin/env lua -- This benchmark script measures wall clock time and should be -- run on an unloaded system. -- -- Your Mileage May Vary. -- -- Mark Pulford <mark@kyne.com.au> local json_module = os.getenv("JSON_MODULE") or "cjson" require "socket" local json = require(json_module) local util = require "cjson.ut...
mit
tianxiawuzhei/cocos-quick-lua
quick/framework/json.lua
11
3469
--[[ Copyright (c) 2011-2014 chukong-inc.com 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, dis...
mit
bigdogmat/wire
lua/entities/gmod_wire_egp/lib/objects/poly.lua
1
1823
-- Author: Divran local Obj = EGP:NewObject( "Poly" ) Obj.w = nil Obj.h = nil Obj.x = nil Obj.y = nil Obj.vertices = {} Obj.verticesindex = "vertices" Obj.HasUV = true -- Returns whether c is to the left of the line from a to b. local function counterclockwise( a, b, c ) local area = (a.x - c.x) * (b.y - c.y) - (b.x ...
apache-2.0
tianxiawuzhei/cocos-quick-lua
quick/samples/anysdk/src/cocos/extension/DeprecatedExtensionEnum.lua
40
1369
_G.kCCControlStepperPartMinus = cc.CONTROL_STEPPER_PART_MINUS _G.kCCControlStepperPartPlus = cc.CONTROL_STEPPER_PART_PLUS _G.kCCControlStepperPartNone = cc.CONTROL_STEPPER_PART_NONE _G.CCControlEventTouchDown = cc.CONTROL_EVENTTYPE_TOUCH_DOWN _G.CCControlEventTouchDragInside = cc.CONTROL_...
mit
tianxiawuzhei/cocos-quick-lua
quick/cocos/extension/DeprecatedExtensionEnum.lua
40
1369
_G.kCCControlStepperPartMinus = cc.CONTROL_STEPPER_PART_MINUS _G.kCCControlStepperPartPlus = cc.CONTROL_STEPPER_PART_PLUS _G.kCCControlStepperPartNone = cc.CONTROL_STEPPER_PART_NONE _G.CCControlEventTouchDown = cc.CONTROL_EVENTTYPE_TOUCH_DOWN _G.CCControlEventTouchDragInside = cc.CONTROL_...
mit
aboskroop/smilebot
plugins/addreply.lua
2
3635
--[[ _ _ _ _ ___ ___ _ __ _| |__ ___ ___| | ___ __ ___ _ __ (_) __ _ / |/ _ \ / _ \| | __ / _` | '_ \ / _ \/ __| |/ / '__/ _ \| '_ \ | |/ _` | | | | | | | | | |/ / | (_| | |_) | (_) \__ \ <| | | (_) | |_) | | | (_| | | | |_| | |_| | < ...
gpl-2.0
yoggy/mqtt_tiny_clock_pub
nodemcu_mqtt_sub.lua
1
1650
-- -- nodemcu_mqtt_sub.lua - MQTT subscribe script for NodeMCU -- -- github: -- https://github.com/yoggy/mqtt_tiny_clock_pub -- -- license: -- Copyright (c) 2015 yoggy <yoggy0@gmail.com> -- Released under the MIT license -- http://opensource.org/licenses/mit-license.php -- -- load configuration require...
mit
robert00s/koreader
frontend/version.lua
4
1613
--[[-- This module helps with retrieving version information. ]] local Version = {} --- Returns current KOReader git-rev. -- @treturn string full KOReader git-rev such `v2015.11-982-g704d4238` function Version:getCurrentRevision() if not self.rev then local rev_file = io.open("git-rev", "r") if re...
agpl-3.0
bigdogmat/wire
lua/weapons/remotecontroller.lua
1
2455
AddCSLuaFile() SWEP.Author = "Divran" -- Originally by ShaRose, rewritten by Divran at 2011-04-03 SWEP.Contact = "" SWEP.Purpose = "Remote control for Pod Controllers in wire." SWEP.Instructions = "Left Click on Pod Controller to link up, and use to start controlling." SWEP.Category = "Wiremod" SWEP.PrintName = "Remo...
apache-2.0
tianxiawuzhei/cocos-quick-lua
quick/samples/physics/src/scenes/MainScene.lua
8
2918
local MainScene = class("MainScene", function() return display.newPhysicsScene("MainScene") -- return display.newScene("MainScene") end) local GRAVITY = -200 local COIN_MASS = 100 local COIN_RADIUS = 46 local COIN_FRICTION = 0.8 local COIN_ELASTICITY = 0.8 local WALL_THICKNESS = 64 local ...
mit
jeffh/google-diff-match-patch
lua/diff_match_patch.lua
265
73869
--[[ * Diff Match and Patch * * Copyright 2006 Google Inc. * http://code.google.com/p/google-diff-match-patch/ * * Based on the JavaScript implementation by Neil Fraser. * Ported to Lua by Duncan Cross. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance ...
apache-2.0
dicebox/minetest-france
mods/unified_inventory/internal.lua
8
12455
local S = unified_inventory.gettext local F = unified_inventory.fgettext -- This pair of encoding functions is used where variable text must go in -- button names, where the text might contain formspec metacharacters. -- We can escape button names for the formspec, to avoid screwing up -- form structure overall, but t...
gpl-3.0
interfaceware/iguana-web-apps
shared/testrunner/app.lua
1
6995
require 'file' require 'stringutil' require 'node' require 'iguanaServer' testrunner = {} testrunner.app = {} testrunner.db = require 'testrunner.db' testrunner.config = require 'testrunner.config' testrunner.git = require 'testrunner.git' local Spin = require 'spin' function testrunner.app.start(R) if not testru...
mit
ufo2000/ufo2000
extensions/terrain-airfield/air.lua
2
3897
AddXcomTerrain { Name = "Airfield", Tiles = { "$(xcom)/terrain/blanks.*", "$(tftd)/terrain/port01.*", "$(tftd)/terrain/port02.*", "$(xcom)/terrain/plane.*", "$(xcom)/terrain/xbase2.*" }, Maps = { "$(extension)/air00.map", "$(extension)/air01.map", "$(extension)/air02.map", "$(extension)/air03.map"...
gpl-2.0
cshore/luci
modules/luci-mod-rpc/luasrc/controller/rpc.lua
37
4466
-- Copyright 2008 Steven Barth <steven@midlink.org> -- Copyright 2008 Jo-Philipp Wich <jow@openwrt.org> -- Licensed to the public under the Apache License 2.0. local require = require local pairs = pairs local print = print local pcall = pcall local table = table module "luci.controller.rpc" function index() local ...
apache-2.0
Spredzy/dotfiles
config/awesome/battery.lua
1
1708
-- This function returns a formatted string with the current battery status. It -- can be used to populate a text widget in the awesome window manager. Based -- on the "Gigamo Battery Widget" found in the wiki at awesome.naquadah.org local naughty = require("naughty") local beautiful = require("beautiful") function r...
apache-2.0
robert00s/koreader
frontend/ui/data/koptoptions.lua
2
10075
local Screen = require("device").screen local S = require("ui/data/strings") local _ = require("gettext") local function enable_if_equals(configurable, option, value) return configurable[option] == value end local KoptOptions = { prefix = 'kopt', { icon = "resources/icons/appbar.transform.rotate.r...
agpl-3.0
jeremiahmarks/sl4a
lua/luasocket/samples/cddb.lua
56
1415
local socket = require("socket") local http = require("socket.http") if not arg or not arg[1] or not arg[2] then print("luasocket cddb.lua <category> <disc-id> [<server>]") os.exit(1) end local server = arg[3] or "http://freedb.freedb.org/~cddb/cddb.cgi" function parse(body) local lines = string.gfind(bo...
apache-2.0
wrxck/mattata
plugins/exec.lua
2
7576
--[[ Copyright 2020 Matthew Hesketh <matthew@matthewhesketh.com> This code is licensed under the MIT. See LICENSE for details. ]] local exec = {} local mattata = require('mattata') local https = require('ssl.https') local ltn12 = require('ltn12') local multipart = require('multipart-post') local json = require...
mit
interfaceware/iguana-web-apps
shared/stringutil.lua
1
1270
-- The stringutil module -- Copyright (c) 2011-2012 iNTERFACEWARE Inc. ALL RIGHTS RESERVED -- iNTERFACEWARE permits you to use, modify, and distribute this file in accordance -- with the terms of the iNTERFACEWARE license agreement accompanying the software -- in which it is used. -- See http://help.interfaceware.com/c...
mit
tisj/packages
utils/luci-app-lxc/files/controller/lxc.lua
77
2909
--[[ LuCI LXC module Copyright (C) 2014, Cisco Systems, Inc. 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 Author: Petar Koretic <petar.koretic@sart...
gpl-2.0
FireFor/RPG_Other_Dream
tests/libs/quickie/slider.lua
2
3054
--[[ Copyright (c) 2012 Matthias Richter 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, distribu...
unlicense
Source-Saraya/S.R.A
plugins/S.R.A7.lua
1
1117
do local function mohammed(msg, matches) local reply_id = msg['id'] if is_sudo(msg) and matches[1]== "م المطور" then local S = [[ 🔰اوامر المطور🔰 ⚜ترقيه سوبر⚜ترقيه الكروب سوبر⚜ 🔰تفعيل المجموعه🔰لتفعيل المجموعه🔰 🔱تعطيل المجموعه🔱لتعطيل المجموعه🔱 🔰اذاعه🔰للنشر داخل مجموعات البوت🔰 ⚜اضف مطور⚜لاضافة م...
gpl-3.0
dicebox/minetest-france
mods/mobs_redo/mount.lua
1
7373
-- lib_mount by Blert2112 (edited by TenPlus1) local enable_crash = true local crash_threshold = 6.5 -- ignored if enable_crash=false ------------------------------------------------------------------------------ -- -- Helper functions -- local function node_is(pos) local node = minetest.get_node(pos) if node....
gpl-3.0
daned33/nodemcu-firmware
app/cjson/lua/cjson/util.lua
170
6837
local json = require "cjson" -- Various common routines used by the Lua CJSON package -- -- Mark Pulford <mark@kyne.com.au> -- Determine with a Lua table can be treated as an array. -- Explicitly returns "not an array" for very sparse arrays. -- Returns: -- -1 Not an array -- 0 Empty table -- >0 Highest index ...
mit
dwnld/thrift
test/lua/test_basic_client.lua
57
7626
-- Licensed to the Apache Software Foundation (ASF) under one -- or more contributor license agreements. See the NOTICE file ...
apache-2.0
joseluis8906/unixjs
sbin/accountingnotes.lua
1
4731
--[[ Lua 5.1 Copyright (C) 1994-2006 Lua.org, PUC-Rio ]] local Http = require ("contrib/http"); local Sql = require ("contrib/sql"); local Session = require ("contrib/session"); local pgmoon = require("pgmoon"); local db = pgmoon.new(Sql.Conf); assert(db:connect()); local Pass = Session.LoginRequired (); if not ...
mit
bigdogmat/wire
lua/entities/gmod_wire_expression2/core/player.lua
1
16001
/******************************************************************************\ Player-Entity support \******************************************************************************/ local IsValid = IsValid local isOwner = E2Lib.isOwner local spawnAlert = {} local runBySpawn = 0 local lastJoined = NULL local lea...
apache-2.0
pkulchenko/ZeroBraneEduPack
corona-samples/live-coding-simple/main.lua
2
1919
-- Sample code is MIT licensed, see http://www.coronalabs.com/links/code/license -- Copyright (C) 2010 Corona Labs Inc. All Rights Reserved. -- Based on Corona sample modified to work with live coding (Paul Kulchenko). done = nil function onUpdate(event) -- let the first call to onUpdate to return quickly; -- star...
mit
facebook/fbcunn
test/test_LocallyConnected.lua
9
69139
-- Copyright 2004-present Facebook. All Rights Reserved. require('fb.luaunit') require('fbtorch') require('nn') require('cutorch') require('fbcunn') require('fbnn') require('ccn2') local jac = nn.Jacobian local function assertTensorEq(a, b, msg, precision) precision = precision or 1e-5 local diff = torch.dist(...
bsd-3-clause
hleuwer/luayats
examples/results/test-4-result.lua
1
1670
return { [1] = 11, [2] = 11, [3] = 333520, [4] = 333520, [5] = 333581, [6] = 333581, [7] = 333104, [8] = 333104, [9] = 332885, [10] = 332885, [11] = 333372, [12] = 333372, [13] = 333529, [14] = 333529, [15] = 500000, [16] = 500000, [17] = 500000, [18] = 500000, [19] = 500000, [20...
gpl-2.0
Movimento5StelleLazio/WebMCP
framework/env/request/redirect.lua
1
1668
--[[-- request.redirect{ module = module, -- module name view = view, -- view name id = id, -- optional id for view params = params -- optional view parameters } Calling this function causes the WebMCP to do a 303 HTTP redirect after the current view or action and all filters have finished exe...
mit
anonymou3Team/hackedanonymous
plugins/sudoers.lua
12
6303
local function set_bot_photo(msg, success, result) local receiver = get_receiver(msg) if success then local file = 'data/photos/bot.jpg' print('File downloaded to:', result) os.rename(result, file) print('File moved to:', file) set_profile_photo(file, ok_cb, false) send_large_msg(receiver, '...
gpl-2.0
nyov/luakit
lib/cookies.lua
4
4498
------------------------------------------------------------ -- Cross-instance luakit cookie management (with sqlite3) -- -- © 2011 Mason Larobina <mason.larobina@gmail.com> -- ------------------------------------------------------------ local math = require "math" local string = string local ipairs = ipairs loc...
gpl-3.0
matija-hustic/OpenRA
mods/ra/maps/soviet-01/soviet01.lua
28
2150
Yaks = { "yak", "yak", "yak" } Airfields = { Airfield1, Airfield2, Airfield3 } InsertYaks = function() local i = 1 Utils.Do(Yaks, function(yakType) local start = YakEntry.CenterPosition + WVec.New(0, (i - 1) * 1536, Actor.CruiseAltitude(yakType)) local dest = StartJeep.Location + CVec.New(0, 2 * i) local yak =...
gpl-3.0
stanfordhpccenter/soleil-x
testcases/legacy/couette/couette.lua
1
7810
-- This is a Lua config file for the Soleil-X code. The options (and comments) -- here are intended to be a template configuration file that can be reused -- for new cases by changing the desired options. This 'master' config will -- always be kept up to date with the latest version of the code. return { ---------...
gpl-2.0
guard163/tarantool
src/lua/log.lua
6
1700
-- log.lua -- local ffi = require('ffi') ffi.cdef[[ typedef void (*sayfunc_t)(int level, const char *filename, int line, const char *error, const char *format, ...); void say_set_log_level(int new_level); extern sayfunc_t _say; extern void say_logrotate(int); enum say_level { ...
bsd-2-clause
tianxiawuzhei/cocos-quick-lua
libs/libzq/ui/UITouch.lua
1
6029
--[[-- zq UITouch -- @classmod UITouch ]] local UIImage = import(".UIImage") local UITouch = class("UITouch", UIImage) -------------------------------- -- UIImage构建函数 -- @function ctor function UITouch:ctor() UITouch.super.ctor(self) -- self:setTouchEnabled(true) -- self:setTouchSwallowEnabled(true) ...
mit
Falcon-peregrinus/awesome-nontiled
awesome/freedesktop/desktop.lua
5
4229
local wibox = wibox local widget = widget local screen = screen local image = image local button = button local table = table local ipairs = ipairs local awful = require("awful") local utils = require("freedesktop.utils") module("freedesktop.desktop") local current_pos = {} local iconsize = { width = 48, height = 48 ...
unlicense
dicebox/minetest-france
mods/awards/chat_commands.lua
2
2438
-- AWARDS -- -- Copyright (C) 2013-2015 rubenwardy -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU Lesser General Public License as published by -- the Free Software Foundation; either version 2.1 of the License, or -- (at your option) any later version. -- This ...
gpl-3.0
dicebox/minetest-france
games/minetest_game/mods/farming/init.lua
10
2267
-- Global farming namespace farming = {} farming.path = minetest.get_modpath("farming") -- Load files dofile(farming.path .. "/api.lua") dofile(farming.path .. "/nodes.lua") dofile(farming.path .. "/hoes.lua") -- WHEAT farming.register_plant("farming:wheat", { description = "Wheat seed", paramtype2 = "meshoptions",...
gpl-3.0
bizkut/BudakJahat
System/Lists/Spells.lua
1
171273
local function flipRace() local race = select(2,UnitRace("player")) local class = select(3,UnitClass("player")) if UnitBuffID("player",193863) then if race == "Orc" then return "Dwarf" elseif race == "Undead" then return "Human" elseif race == "Troll" then ...
gpl-3.0
guard163/tarantool
test/replication/hot_standby.test.lua
7
3063
--# set connection default box.schema.user.grant('guest', 'replication') box.schema.func.create('_set_pri_lsn') box.schema.user.grant('guest', 'execute', 'function', '_set_pri_lsn') --# create server hot_standby with script='replication/hot_standby.lua', rpl_master=default --# create server replica with rpl_master=defa...
bsd-2-clause
jeremiahmarks/sl4a
lua/luasocket/src/socket.lua
146
4061
----------------------------------------------------------------------------- -- LuaSocket helper module -- Author: Diego Nehab -- RCS ID: $Id: socket.lua,v 1.22 2005/11/22 08:33:29 diego Exp $ ----------------------------------------------------------------------------- -----------------------------------------------...
apache-2.0
mqmaker/witi-openwrt
package/ramips/ui/luci-mtk/src/applications/luci-diag-devinfo/luasrc/controller/luci_diag/devinfo_common.lua
76
5638
--[[ Luci diag - Diagnostics controller module (c) 2009 Daniel Dickinson 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 ]]-- module("luci.cont...
gpl-2.0
facebook/fbcunn
fbcunn/TemporalConvolutionFB.lua
1
1851
-- Copyright 2004-present Facebook. All Rights Reserved. require 'nn' local TemporalConvolutionFB, parent = torch.class('nn.TemporalConvolutionFB', 'nn.Module') function TemporalConvolutionFB:__init(inputFrameSize, outputFrameSize, kW, dW) parent.__init(self) dW = dW or 1 self.inputFrameSize = inputFra...
bsd-3-clause
ld-test/oil
lua/oil/corba/giop/Referrer.lua
6
6098
-------------------------------------------------------------------------------- ------------------------------ ##### ## ------------------------------ ------------------------------ ## ## # ## ------------------------------ ------------------------------ ## ## ## ## ---------------------------...
mit
ReactorScram/driving
lua-cher/main.lua
1
1707
local Cher = require "lua-cher" local polylines = Cher.polylines local FixedTimestep = require "fixed-timestep" local ctx = Cher.new ({400, 100}) local ctxs = {} for i = 1, 50 do ctxs [i] = Cher.new {400 + (i - 25) * 2, 100} end local timestep = FixedTimestep (60, 1) local scale_den = Cher.scale_den local steps = ...
agpl-3.0
guard163/tarantool
src/lua/strict.lua
12
1376
-- strict.lua -- checks uses of undeclared global variables -- All global variables must be 'declared' through a regular assignment -- (even assigning nil will do) in a main chunk before being used -- anywhere or assigned to inside a function. -- local getinfo, error, rawset, rawget = debug.getinfo, error, rawset, raw...
bsd-2-clause
robert00s/koreader
spec/unit/hook_container_spec.lua
14
2931
describe("HookContainer tests", function() setup(function() require("commonrequire") end) it("should register and unregister functions", function() local HookContainer = require("ui/hook_container"):new() local f1 = spy.new(function() end) local f2 = spy.new(function() end) ...
agpl-3.0
dschoeffm/MoonGen
examples/l3-tcp-syn-flood.lua
5
2290
local mg = require "moongen" local memory = require "memory" local device = require "device" local stats = require "stats" local log = require "log" function configure(parser) parser:description("Generates TCP SYN flood from varying source IPs, supports both IPv4 and IPv6") parser:argument("dev", "Devices to tra...
mit
ShieldTeams/oldsdp
plugins/ingroup.lua
1
60155
do -- Check Member local function check_member_autorealm(cb_extra, success, result) local receiver = cb_extra.receiver local data = cb_extra.data local msg = cb_extra.msg for k,v in pairs(result.members) do local member_id = v.peer_id if member_id ~= our_id then -- Group configuration data[...
agpl-3.0
NSAKEY/prosody-modules
mod_http_index/mod_http_index.lua
31
3606
local st = require "util.stanza"; local url = require"socket.url"; module:depends"http"; -- local dump = require"util.serialization".new"dump".serialize; local function template(data) --[[ DOC Like util.template, but deals with plain text Returns a closure that is called with a table of values {name} is substitu...
mit
iceman1001/proxmark3
client/scripts/calc_mizip.lua
1
4633
local bin = require('bin') local getopt = require('getopt') local lib14a = require('read14a') local utils = require('utils') author = 'Iceman' version = 'v1.0.0' desc = [[ This script calculates mifare keys based on uid diversification for mizip. Algo not found by me. ]] example = [[ -- if called without, it reads...
gpl-2.0
nyov/luakit
lib/lousy/signal.lua
7
3274
-------------------------------------------------------------- -- Mimic the luakit signal api functions for tables -- -- @author Fabian Streitel &lt;karottenreibe@gmail.com&gt; -- -- @author Mason Larobina &lt;mason.larobina@gmail.com&gt; -- -- @copyright 2010 Fabian Streitel, Mason Larobina -- -----...
gpl-3.0
piesbert/ymine_old
script/Init.lua
1
1104
-- File: Init.lua -- Project: ymine -- Created on: Nov 18, 2014 22:14:34 AM -- Author: piesbert -- -- Copyright (C) 2014 Sebastian Szymak -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software F...
gpl-2.0
cshore/luci
applications/luci-app-multiwan/luasrc/controller/multiwan.lua
62
1929
module("luci.controller.multiwan", package.seeall) function index() local fs = require "nixio.fs" if not fs.access("/etc/config/multiwan") then return end local page page = entry({"admin", "network", "multiwan"}, cbi("multiwan/multiwan"), _("Multi-WAN")) page.dependent = true entry({"admin", "network", "m...
apache-2.0
bizkut/BudakJahat
System/UI/Toggles/Toggles.lua
1
6067
-- this handles old profiles buttons function TogglesFrame() GarbageButtons() --------------------------- -- Main Button -- --------------------------- -- Default Values emptyIcon = [[Interface\FrameGeneral\UI-Background-Marble]] backIconOn = [[Interface\ICONS\Spell_Holy_PowerWordShield]] backIconOff = [[...
gpl-3.0
ProtectiveTeam/protectiveBot
plugins/ingroup.lua
371
44212
do -- Check Member local function check_member_autorealm(cb_extra, success, result) local receiver = cb_extra.receiver local data = cb_extra.data local msg = cb_extra.msg for k,v in pairs(result.members) do local member_id = v.id if member_id ~= our_id then -- Group configuration data[tostr...
gpl-2.0