repo_name
stringlengths
6
69
path
stringlengths
6
178
copies
stringclasses
278 values
size
stringlengths
4
7
content
stringlengths
671
917k
license
stringclasses
15 values
padrinoo/padrino85
plugins/pokedex.lua
626
1668
do local images_enabled = true; local function get_sprite(path) local url = "http://pokeapi.co/"..path print(url) local b,c = http.request(url) local data = json:decode(b) local image = data.image return image end local function callback(extra) send_msg(extra.receiver, extra.text, ok_cb, false) end lo...
gpl-2.0
slayerrensky/luci
applications/luci-app-diag-devinfo/luasrc/controller/luci_diag/smap_common.lua
61
3184
-- Copyright 2009 Daniel Dickinson -- Licensed to the public under the Apache License 2.0. module("luci.controller.luci_diag.smap_common", package.seeall) require("luci.i18n") require("luci.util") require("luci.sys") require("luci.cbi") require("luci.model.uci") local translate = luci.i18n.translate local DummyValue...
apache-2.0
NerdWalletOSS/Q
ML/DT/lua/convert_sklearn_to_q_dt.lua
1
6407
local plstring = require 'pl.stringx' local utils = require 'Q/UTILS/lua/utils' local load_csv_col_seq = require 'Q/ML/UTILS/lua/utility'['load_csv_col_seq'] local fns = {} -- see if the file exists local function file_exists(file) local f = io.open(file, "rb") if f then f:close() end return f ~= nil end -- ...
mit
celarco/ardupilot
libraries/AP_Scripting/applets/motor_failure_test.lua
16
2121
-- This is a script that stops motors in flight, for use testing motor failure handling -- add new param MOT_STOP_BITMASK local PARAM_TABLE_KEY = 75 assert(param:add_table(PARAM_TABLE_KEY, "MOT_", 1), "could not add param table") assert(param:add_param(PARAM_TABLE_KEY, 1, "STOP_BITMASK", 0), "could not add param") lo...
gpl-3.0
Oliveryo/Interface
AddOns/BigWigs/Plugins/Comm.lua
1
1931
assert(BigWigs, "BigWigs not found!") ------------------------------ -- Are you local? -- ------------------------------ local throt, times = {}, {} local playerName = nil local coreSyncs = { ["BossEngaged"] = 5, } ---------------------------------- -- Module Declaration -- --------------------...
gpl-3.0
keyidadi/luci
applications/luci-statistics/luasrc/model/cbi/luci_statistics/network.lua
80
3002
--[[ Luci configuration model for statistics - collectd network plugin configuration (c) 2008 Freifunk Leipzig / Jo-Philipp Wich <xm@leipzig.freifunk.net> 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 Licen...
apache-2.0
adminomega/exterme-2
plugins/inrealm.lua
287
25005
-- data saved to moderation.json -- check moderation plugin do local function create_group(msg) -- superuser and admins only (because sudo are always has privilege) if is_sudo(msg) or is_realm(msg) and is_admin(msg) then local group_creator = msg.from.print_name create_g...
gpl-2.0
Rodeo314/tim-vlc
share/lua/meta/art/02_frenchtv.lua
51
2724
--[[ Gets an artwork from amazon $Id$ Copyright © 2007 the VideoLAN team 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 Foundation; either version 2 of the License, or (at your option) any later version...
gpl-2.0
g0t-ya/XiaoyuBox
luci/model/cbi/pdnsd.lua
1
1690
--[[ RA-MOD ]]-- local fs = require "nixio.fs" local running=(luci.sys.call("pidof pdnsd > /dev/null") == 0) if running then m = Map("pdnsd", translate("pdnsd"), translate("pdnsd is running")) else m = Map("pdnsd", translate("pdnsd"), translate("pdnsd is not running")) end s = m:section(TypedSection, "pdnsd", "")...
lgpl-3.0
Flexibity/luci
applications/luci-olsr/luasrc/model/cbi/olsr/olsrd.lua
29
16495
--[[ LuCI - Lua Configuration Interface Copyright 2008 Steven Barth <steven@midlink.org> Copyright 2010 Jo-Philipp Wich <xm@subsignal.org> 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://w...
apache-2.0
mentor81/kgbot
plugins/help.lua
337
5009
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]] ...
gpl-2.0
padrinoo/padrino85
plugins/help.lua
337
5009
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]] ...
gpl-2.0
m-2k/wrk
deps/luajit/src/jit/dis_arm.lua
88
19364
---------------------------------------------------------------------------- -- LuaJIT ARM disassembler module. -- -- Copyright (C) 2005-2015 Mike Pall. All rights reserved. -- Released under the MIT license. See Copyright Notice in luajit.h ---------------------------------------------------------------------------- -...
apache-2.0
celarco/ardupilot
libraries/AP_Scripting/examples/mount-poi.lua
8
7174
-- mount-poi.lua: finds the point-of-interest that the gimbal mount is pointing at using the vehicle's current Location, mount attitude and terrain database -- -- How To Use -- 1. set RCx_OPTION to 300 to enable triggering the POI calculation from an auxiliary switch -- 2. optionally set POI_DIST_MAX to the maximum...
gpl-3.0
Flexibity/luci
modules/admin-full/luasrc/model/cbi/admin_network/vlan.lua
4
7803
--[[ LuCI - Lua Configuration Interface Copyright 2008 Steven Barth <steven@midlink.org> Copyright 2010-2011 Jo-Philipp Wich <xm@subsignal.org> 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 htt...
apache-2.0
Oliveryo/Interface
AddOns/!Questie/Libs/Dewdrop-2.0/Dewdrop-2.0.lua
2
82495
--[[ Name: Dewdrop-2.0 Revision: $Rev: 15987 $ Author(s): ckknight (ckknight@gmail.com) Website: http://ckknight.wowinterface.com/ Documentation: http://wiki.wowace.com/index.php/Dewdrop-2.0 SVN: http://svn.wowace.com/root/trunk/DewdropLib/Dewdrop-2.0 Description: A library to provide a clean dropdown menu interface. D...
gpl-3.0
Oliveryo/Interface
AddOns/dpsmate/modules/DPSMate_Absorbs.lua
1
9518
-- Global Variables DPSMate.Modules.Absorbs = {} DPSMate.Modules.Absorbs.Hist = "Absorbs" DPSMate.Options.Options[1]["args"]["absorbs"] = { order = 110, type = 'toggle', name = DPSMate.L["absorbs"], desc = DPSMate.L["show"].." "..DPSMate.L["absorbs"]..".", get = function() return DPSMateSettings["windows"][DPSMate...
gpl-3.0
keith/dotfiles
config/awesome/rc.lua
2
17679
-- Standard awesome library local gears = require("gears") local awful = require("awful") awful.rules = require("awful.rules") require("awful.autofocus") -- Widget and layout library local wibox = require("wibox") -- Theme handling library local beautiful = require("beautiful") -- Notification library local naughty = r...
mit
slayerrensky/luci
protocols/luci-proto-ppp/luasrc/model/cbi/admin_network/proto_pppoe.lua
18
3631
-- Copyright 2011 Jo-Philipp Wich <jow@openwrt.org> -- Licensed to the public under the Apache License 2.0. local map, section, net = ... local username, password, ac, service local ipv6, defaultroute, metric, peerdns, dns, keepalive_failure, keepalive_interval, demand, mtu username = section:taboption("gener...
apache-2.0
tboox/xmake
xmake/core/sandbox/modules/format.lua
1
1030
--!A cross-platform build utility based on Lua -- -- Licensed to the Apache Software Foundation (ASF) under one -- or more contributor license agreements. See the NOTICE file -- distributed with this work for additional information -- regarding copyright ownership. The ASF licenses this file -- to you under the Apach...
apache-2.0
EvilHero90/forgottenserver
data/spells/scripts/support/find_person.lua
6
2804
local LEVEL_LOWER = 1 local LEVEL_SAME = 2 local LEVEL_HIGHER = 3 local DISTANCE_BESIDE = 1 local DISTANCE_CLOSE = 2 local DISTANCE_FAR = 3 local DISTANCE_VERYFAR = 4 local directions = { [DIRECTION_NORTH] = "north", [DIRECTION_SOUTH] = "south", [DIRECTION_EAST] = "east", [DIRECTION_WEST] = "west", [DIRECTION_NO...
gpl-2.0
great90/skynet
lualib/sproto.lua
31
5663
local core = require "sproto.core" local assert = assert local sproto = {} local host = {} local weak_mt = { __mode = "kv" } local sproto_mt = { __index = sproto } local sproto_nogc = { __index = sproto } local host_mt = { __index = host } function sproto_mt:__gc() core.deleteproto(self.__cobj) end function sproto...
mit
memorysafe/cartographer_ros
cartographer_ros/configuration_files/pr2.lua
1
1599
-- Copyright 2016 The Cartographer Authors -- -- 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...
apache-2.0
funshine/nodemcu-firmware
lua_examples/ucglib/UcgLogo.lua
11
4755
-- setup SPI and connect display function init_spi_display() -- Hardware SPI CLK = GPIO14 -- Hardware SPI MOSI = GPIO13 -- Hardware SPI MISO = GPIO12 (not used) -- CS, D/C, and RES can be assigned freely to available GPIOs local cs = 8 -- GPIO15, pull-down 10k to GND local dc = 4 -- GPIO2 ...
mit
NerdWalletOSS/Q
RUNTIME/test/test_cmem.lua
1
5428
local cmem = require 'libcmem' ; local ffi = require 'ffi' local get_ptr = require 'Q/UTILS/lua/get_ptr' local tests = {} local qconsts = require 'Q/UTILS/lua/q_consts' ffi.cdef([[ char *strncpy(char *dest, const char *src, size_t n); ]] ) tests.t0 = function() -- basic test local buf = cmem.new(128, "I4") as...
mit
tboox/xmake
xmake/languages/asm/xmake.lua
1
5133
--!A cross-platform build utility based on Lua -- -- Licensed to the Apache Software Foundation (ASF) under one -- or more contributor license agreements. See the NOTICE file -- distributed with this work for additional information -- regarding copyright ownership. The ASF licenses this file -- to you under the Apach...
apache-2.0
leecrest/luvit
deps/hooks.lua
6
1186
--[[ 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...
apache-2.0
tboox/xmake
xmake/languages/dlang/xmake.lua
1
4151
--!A cross-platform build utility based on Lua -- -- Licensed to the Apache Software Foundation (ASF) under one -- or more contributor license agreements. See the NOTICE file -- distributed with this work for additional information -- regarding copyright ownership. The ASF licenses this file -- to you under the Apach...
apache-2.0
cc122cc/THETETOO2
plugins/me.lua
1
2118
do local function run(msg, matches) if matches[1] == 'موقعي' then if is_sudo(msg) then send_document(get_receiver(msg), "./files/me/sudo.webp", ok_cb, false) return "▫️انت المطور مالتي 🙂❤️\n▫️ اسمك :"..msg.from.first_name.."\n" .."▫️ايديك :("..msg.from.id..")\n" .."▫️ايدي الكروب :("..msg.to.i...
gpl-2.0
NerdWalletOSS/Q
OPERATORS/GETK/test/test_maxk.lua
1
2386
local Q = require 'Q' local qconsts = require 'Q/UTILS/lua/q_consts' local tests = {} tests.t1 = function() local col = Q.mk_col({1, 5, 4, 2, 3, 7, 9}, "I4") local res = Q.maxk_vector(col, 3) local exp_col = Q.mk_col({9, 7, 5}, "I8") local sum = Q.sum(Q.vveq(res, exp_col)):eval() assert(sum:to_num() == exp_...
mit
xkfz007/vlc
share/lua/playlist/anevia_xml.lua
124
3618
--[[ Parse list of available streams on Anevia servers. The URI http://ipaddress/ws/Mgmt/* describes a list of available streams on the server. Copyright © 2009 M2X BV Authors: Jean-Paul Saman <jpsaman@videolan.org> This program is free software; you can redistribute it and/or modify it under the terms of the...
lgpl-2.1
FlightControl-Master/MOOSE
Moose Development/Moose/AI/AI_Escort_Request.lua
1
14041
--- **AI** - Taking the lead of AI escorting your flight or of other AI, upon request using the menu. -- -- === -- -- ## Features: -- -- * Escort navigation commands. -- * Escort hold at position commands. -- * Escorts reporting detected targets. -- * Escorts scanning targets in advance. -- * Escorts attac...
gpl-3.0
tboox/xmake
xmake/actions/uninstall/uninstall_admin.lua
1
1777
--!A cross-platform build utility based on Lua -- -- Licensed to the Apache Software Foundation (ASF) under one -- or more contributor license agreements. See the NOTICE file -- distributed with this work for additional information -- regarding copyright ownership. The ASF licenses this file -- to you under the Apach...
apache-2.0
codergreen/ValyriaTear
img/sprites/map/npcs/story/orlinn_idle.lua
4
1056
-- Sprite animation file descriptor -- This file will describe the frames used to load the sprite animations -- This files is following a special format compared to other animation scripts. local ANIM_SOUTH = vt_map.MapMode.ANIM_SOUTH; local ANIM_NORTH = vt_map.MapMode.ANIM_NORTH; local ANIM_WEST = vt_map.MapMode.ANI...
gpl-2.0
njrat/BREKEBOT
libs/dateparser.lua
502
6212
local difftime, time, date = os.difftime, os.time, os.date local format = string.format local tremove, tinsert = table.remove, table.insert local pcall, pairs, ipairs, tostring, tonumber, type, setmetatable = pcall, pairs, ipairs, tostring, tonumber, type, setmetatable local dateparser={} --we shall use the host OS's...
gpl-2.0
tboox/xmake
xmake/modules/detect/tools/find_ccache.lua
1
1635
--!A cross-platform build utility based on Lua -- -- Licensed to the Apache Software Foundation (ASF) under one -- or more contributor license agreements. See the NOTICE file -- distributed with this work for additional information -- regarding copyright ownership. The ASF licenses this file -- to you under the Apach...
apache-2.0
keyidadi/luci
applications/luci-statistics/luasrc/statistics/rrdtool/definitions/processes.lua
78
2188
--[[ Luci statistics - processes plugin diagram definition (c) 2008 Freifunk Leipzig / Jo-Philipp Wich <xm@leipzig.freifunk.net> 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-2.0
Oliveryo/Interface
AddOns/ShaguQuest/EQL3_QuestDB.lua
1
7565
-- Storage of Quest levels... -- All credits go to Elkano for his addon Quest Level -- ---------------------- -- -- hooking game functions -- -- ---------------------- -- local QuestLevel_original_GetTitleText = GetTitleText; -- GossipFrame -- local QuestLevel_original_GossipFrameUpdate = GossipFrameUpdate; local Qu...
gpl-3.0
bcreusot/BankManager
src/init.lua
1
7853
-------------------------------------------------------------------------------- -- ***** Bank Manager ***** -- -- * Benjamin Creusot - Todo -- * Creation : 17/04/2014 -- * v2.9.1 -- Manage easily your bank. Automatically places items in your bank/inventory -- -- * LICENSE MIT -- -------------------------...
mit
NerdWalletOSS/Q
RUNTIME/test/stress_test_lVector.lua
1
3289
local plfile = require 'pl.file' local plpath = require 'pl.path' local Vector = require 'libvec' local Scalar = require 'libsclr' local cmem = require 'libcmem' local lVector = require 'Q/RUNTIME/lua/lVector' local qconsts = require 'Q/UTILS/lua/q_consts' local get_ptr = require 'Q/UTILS/lua/get_ptr' loca...
mit
moteus/lzmq-dist
lzmq/examples/perf2/thr_nomsg/local_thr.lua
16
1683
local ZMQ_NAME = "lzmq" local argc = select("#", ...) local argv = {...} if (argc < 3) or (argc > 4)then print("usage: local_thr <bind-to> <message-size> <message-count> [ffi]"); return 1 end local bind_to = argv [1] local message_size = assert(tonumber(argv [2])) local message_count = assert(tonumber(arg...
mit
TeslaCloud/TTTRewrite
terrortown/entities/entities/ttt_map_settings.lua
1
2820
ENT.Type = "point" ENT.Base = "base_point" function ENT:Initialize() -- Backwards compatibility: TTT maps compiled before the addition of the -- propspec setting may expect it to be off, so default it to off if a map -- settings entity exists (a reliable way of identifying a TTT map) GAMEMODE.propspec_all...
mit
Oliveryo/Interface
AddOns/enemyFrames/globals/commHandler.lua
1
2785
------------------------------------------------------------------------------- local msgPrefix = {['RT'] = 'BGEFRT', ['EFC'] = 'BGEFEFC', ['AV'] = 'BGEFEAV', ['BF'] = 'BGEFEBF'} function sendMSG(typ, d, icon, bg) if icon == nil then icon = '' end d = UnitName'player' .. '/' .. d .. '/' .. icon local channel...
gpl-3.0
kaptanblack15/jackspark
bot/utils.lua
309
23029
URL = require "socket.url" http = require "socket.http" https = require "ssl.https" ltn12 = require "ltn12" serpent = require "serpent" feedparser = require "feedparser" json = (loadfile "./libs/JSON.lua")() mimetype = (loadfile "./libs/mimetype.lua")() redis = (loadfile "./libs/redis.lua")() JSON = (loadfile "./libs/...
gpl-2.0
alfred-bot/phmbot
plugins/isX.lua
605
2031
local https = require "ssl.https" local ltn12 = require "ltn12" local function request(imageUrl) -- Edit data/mashape.lua with your Mashape API key -- http://docs.mashape.com/api-keys local mashape = load_from_file('data/mashape.lua', { api_key = '' }) local api_key = mashape.api_key if ...
gpl-2.0
padrinoo/padrino85
plugins/isX.lua
605
2031
local https = require "ssl.https" local ltn12 = require "ltn12" local function request(imageUrl) -- Edit data/mashape.lua with your Mashape API key -- http://docs.mashape.com/api-keys local mashape = load_from_file('data/mashape.lua', { api_key = '' }) local api_key = mashape.api_key if ...
gpl-2.0
codergreen/ValyriaTear
dat/tilesets/autotiling.lua
6
13201
CaveDirt = {} CaveDirt[1] = { "desert_cave_ground", 0 } CaveDirt[2] = { "desert_cave_ground", 1 } CaveDirt[3] = { "desert_cave_ground", 2 } CaveDirt_CaveFloor = {} CaveDirt_CaveFloor[1] = { "desert_cave_ground", 3 } -- northwest border CaveDirt_CaveFloor[2] = { "desert_cave_ground", 39 } -- northern border CaveDirt...
gpl-2.0
CRAPproject/CRAPnode-firmware
NodeMCU/crapmain_server.lua
1
1290
--crapmain.lua --This is the main module for the crap nodes print ('in crapmain') --Initialise UART 9600baud, 8 data bits, no parity, 1 stop bit) --uart.setup(0,9600,8,0,1,0) --uart.write(0,'UART Active\n') SSID = "HACKSPACE" PW = "Hack_A_Day" IPADR = "192.168.1.93" --Requested static IP address for the ESP IPROUTER ...
mit
dsalychev/mcusim
tests/atmega328p/timer0-ctc/stop-test.lua
1
1809
--[[ This file is part of MCUSim, an XSPICE library with microcontrollers. Copyright (C) 2017-2019 MCUSim Developers, see AUTHORS.txt for contributors. MCUSim 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 Found...
gpl-3.0
sinavafa/test
plugins/qr.lua
21
1783
--- https://github.com/amirhmz --- https://telegram.me/AmirDark local function get_hex(str) local colors = { red = "f00", blue = "00f", green = "0f0", yellow = "ff0", purple = "f0f", white = "fff", black = "000", gray = "ccc" } for color, value in pairs(colors) do if color ==...
gpl-2.0
xriss/fun64
fun/raymarch.fun.lua
1
12354
local wstr=require("wetgenes.string") local wgrd=require("wetgenes.grd") local tardis=require("wetgenes.tardis") -- matrix/vector math local bitdown=require("wetgenes.gamecake.fun.bitdown") local bitdown_font_4x8=require("wetgenes.gamecake.fun.bitdown_font_4x8") -- -- This is fun64 code, you can copy paste it into ...
mit
gaohuang/MSDNet
models/JointTrainContainer.lua
1
7499
require 'nn' require 'cudnn' require 'cunn' require 'models/MSDNet_Layer' local function build_transition(nIn, nOut, outScales, offset, opt) local function conv1x1(nIn, nOut) local s = nn.Sequential() s:add(cudnn.SpatialConvolution(nIn, nOut, 1,1, 1,1, 0,0)) s:add(cudnn.SpatialBatchNormalization(n...
mit
EvilHero90/forgottenserver
data/migrations/15.lua
7
2478
function onUpdateDatabase() print("> Updating database to version 16 (moving skills into players table)") db.query("ALTER TABLE `players` ADD `skill_fist` int unsigned NOT NULL DEFAULT 10, ADD `skill_fist_tries` bigint unsigned NOT NULL DEFAULT 0, ADD `skill_club` int unsigned NOT NULL DEFAULT 10, ADD `skill_club_tri...
gpl-2.0
TeslaCloud/TTTRewrite
terrortown/entities/entities/ttt_decoy.lua
2
1782
-- Decoy sending out a radar blip and redirecting DNA scans. Based on old beacon -- code. AddCSLuaFile() ENT.Type = "anim" ENT.Model = Model("models/props_lab/reciever01b.mdl") ENT.CanHavePrints = false ENT.CanUseKey = true function ENT:Initialize() self:SetModel(self.Model) if SERVER then self:PhysicsI...
mit
sysuzhang/arcemu
src/scripts/lua/LuaBridge/Stable Scripts/Outland/Sethekk Halls/BOSS_SethekkHalls_Anzu.lua
30
1076
function Anzu_HealthCheckA(Unit) if Unit:GetHealthPct() < 66 and Didthat == 0 then Unit:FullCastSpell(41196) Unit:SpawnCreature(23134, -90.7, 265.7, 26.86, 0, 18, 36000000); Didthat = 1 else end end function Anzu_HealthCheckB(Unit) if Unit:GetHealthPct() < 33 and Didthat == 1 then Unit:FullCastSpell(41196)...
agpl-3.0
xriss/fun64
fun/input.fun.lua
1
3146
-- -- This is fun64 code, you can copy paste it into https://xriss.github.io/fun64/pad/ to run it. -- hardware,main=system.configurator({ mode="fun64", -- select the standard 320x240 screen using the swanky32 palette. update=function() update() end, -- called repeatedly to update draw=function() draw() end, -- calle...
mit
FlightControl-Master/MOOSE
Moose Development/Moose/Functional/ZoneGoalCargo.lua
1
13051
--- **Functional** - Base class that models processes to achieve goals involving a Zone and Cargo. -- -- === -- -- ZONE_GOAL_CARGO models processes that have a Goal with a defined achievement involving a Zone and Cargo. -- Derived classes implement the ways how the achievements can be realized. -- -- === -- -- ###...
gpl-3.0
Oliveryo/Interface
AddOns/aux-addon/util/money.lua
1
4167
module 'aux.util.money' include 'T' include 'aux' M.GOLD_TEXT = '|cffffd70ag|r' M.SILVER_TEXT = '|cffc7c7cfs|r' M.COPPER_TEXT = '|cffeda55fc|r' local COPPER_PER_GOLD = 10000 local COPPER_PER_SILVER = 100 function M.to_gsc(money) local gold = floor(money / COPPER_PER_GOLD) local silver = floor(mod(money, COPPER_PE...
gpl-3.0
tboox/xmake
xmake/core/sandbox/modules/pairs.lua
1
1916
--!A cross-platform build utility based on Lua -- -- Licensed to the Apache Software Foundation (ASF) under one -- or more contributor license agreements. See the NOTICE file -- distributed with this work for additional information -- regarding copyright ownership. The ASF licenses this file -- to you under the Apach...
apache-2.0
satta/annot-nf
bin/no_abacas_prepare.lua
4
4580
#!/usr/bin/env gt --[[ Author: Sascha Steinbiss <ss34@sanger.ac.uk> Copyright (c) 2015 Genome Research Ltd Permission to use, copy, modify, and distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all co...
isc
NerdWalletOSS/Q
RUNTIME/DNN/lua/get_fops.lua
1
2181
local get_f_fops = function(npl, nI) local cnt = 0 for i = 2, #npl do local factor if i==#npl then factor = 6 else factor = 2 end cnt = cnt + (npl[i-1] * npl[i] * nI * factor) end return cnt end local get_b_fops = function(npl, nI) local cnt = 0 local da_last_fops = npl[#npl...
mit
NerdWalletOSS/Q
OPERATORS/LOAD_CSV/lua/dictv2.lua
1
2359
_G["Q_DICTIONARIES"] = _G['Q_DICTIONARIES'] or {} local dict_obj_mt = { __newindex = function(self, key, value) print("newindex metamethod called") assert(value == true, "Dictionary only accepts setting values") if self.add == false then error("Cannot add to this dictionary", 2) end ...
mit
Flexibity/luci
modules/niu/luasrc/model/cbi/niu/network/assign1.lua
48
2518
--[[ LuCI - Lua Configuration Interface Copyright 2008 Steven Barth <steven@midlink.org> 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 $Id$ ]]-- loc...
apache-2.0
Spring-SpringBoard/SpringBoard-Core
scen_edit/view/map/sky_editor.lua
1
4058
SB.Include(Path.Join(SB.DIRS.SRC, 'view/editor.lua')) SkyEditor = Editor:extends{} SkyEditor:Register({ name = "skyEditor", tab = "Env", caption = "Sky", tooltip = "Edit sky and fog", image = Path.Join(SB.DIRS.IMG, 'night-sky.png'), order = 1, }) function SkyEditor:init() self:super("init"...
mit
jaythomas/love-experiment
lib/timer.lua
6
4883
local Timer = {} -- group management local function detach (group, item) local index = item.index group[index] = group[#group] group[index].index = index group[#group] = nil item.groupField = nil end local function attach (group, item) if item.groupField then detach (item.groupField,...
lgpl-3.0
TeslaCloud/TTTRewrite
terrortown/gamemode/libs/sh_util.lua
1
8973
-- Random stuff if not util then return end local math = math local string = string local table = table local pairs = pairs -- attempts to get the weapon used from a DamageInfo instance needed because the -- GetAmmoType value is useless and inflictor isn't properly set (yet) function util.WeaponFromDamage(dmg) lo...
mit
Spring-SpringBoard/SpringBoard-Core
scen_edit/command/widget_command_executed.lua
1
1982
WidgetCommandExecuted = Command:extends{} WidgetCommandExecuted.className = "WidgetCommandExecuted" function WidgetCommandExecuted:init(display, cmdIDs) self.display = display self.cmdIDs = cmdIDs end function WidgetCommandExecuted:execute() SB.commandManager:callListeners("OnCommandExecuted", sel...
mit
Flexibity/luci
applications/luci-statistics/luasrc/controller/luci_statistics/luci_statistics.lua
8
5931
--[[ Luci statistics - statistics controller module (c) 2008 Freifunk Leipzig / Jo-Philipp Wich <xm@leipzig.freifunk.net> 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....
apache-2.0
NerdWalletOSS/Q
experimental/luajit_vs_terra/terra_vs_luajit_performance/lua/utils_lua/dictionary.lua
1
1952
-- START: Following is standard stuff for creating a class local Dictionary = {} local g_err = require("error_code") _G["Q_DICTIONARIES"] = _G["Q_DICTIONARIES"] or {} Dictionary.__index = Dictionary setmetatable(Dictionary, { __call = function (cls, ...) return cls.get_instance(...) end, ...
mit
slayerrensky/luci
applications/luci-app-firewall/luasrc/tools/firewall.lua
63
5812
-- Copyright 2011-2012 Jo-Philipp Wich <jow@openwrt.org> -- Licensed to the public under the Apache License 2.0. module("luci.tools.firewall", package.seeall) local ut = require "luci.util" local ip = require "luci.ip" local nx = require "nixio" local translate, translatef = luci.i18n.translate, luci.i18n.translatef...
apache-2.0
tboox/xmake
xmake/actions/install/xmake.lua
1
2565
--!A cross-platform build utility based on Lua -- -- Licensed to the Apache Software Foundation (ASF) under one -- or more contributor license agreements. See the NOTICE file -- distributed with this work for additional information -- regarding copyright ownership. The ASF licenses this file -- to you under the Apach...
apache-2.0
tboox/xmake
xmake/languages/objc++/load.lua
9
1088
--!A cross-platform build utility based on Lua -- -- Licensed to the Apache Software Foundation (ASF) under one -- or more contributor license agreements. See the NOTICE file -- distributed with this work for additional information -- regarding copyright ownership. The ASF licenses this file -- to you under the Apach...
apache-2.0
Oliveryo/Interface
AddOns/dpsmate/modules/DPSMate_Interrupts.lua
1
4829
-- Global Variables DPSMate.Modules.Interrupts = {} DPSMate.Modules.Interrupts.Hist = "Interrupts" DPSMate.Options.Options[1]["args"]["interrupts"] = { order = 160, type = 'toggle', name = DPSMate.L["interrupts"], desc = DPSMate.L["show"].." "..DPSMate.L["interrupts"]..".", get = function() return DPSMateSettings[...
gpl-3.0
digitaltoys/lightpack
Software/apiexamples/LUA/luaLightpack.lua
11
4157
--[[ luaLightpack 1.0 Äàííûé êîä ðàñïðîñòðàíÿåòñÿ ïî ëèöåíçèè GNU GPL v3. Àâòîð: Êî÷åìàåâ Âëàäèñëàâ (VladDev). luaLightpack -- ýòî íàáîð îïðåäåëåíèé è ìåòîäîâ äëÿ ÿçûêà Lua, êîòîðûå ñèëüíî óïðîùàþò ïðîöåññ âçàèìîäåéñòâèÿ ñ API è íàïèñàíèå ïëàãèíîâ äëÿ Ëàéòïàêà. Íàçâàíèå ôóíêöèé è ïðèíèìàå...
gpl-3.0
NerdWalletOSS/Q
TESTS/sanity_test_cases/test_absolute.lua
1
1200
-- SANITY TEST -- ## Problem: Verifying the sum of opposite vector and the change when abs operator comes into play. -- ## Using Q.seq & absolute function to solve a problem -- Library Calls local Q = require 'Q' require 'Q/UTILS/lua/strict' local tests = {} tests.t1 = function () -- Negative Series local a = Q.s...
mit
LuaDist2/lua-websockets
src/websocket/ev_common.lua
5
4133
local ev = require'ev' local frame = require'websocket.frame' local tinsert = table.insert local tconcat = table.concat local eps = 2^-40 local detach = function(f,loop) if ev.Idle then ev.Idle.new(function(loop,io) io:stop(loop) f() end):start(loop) else ev.Timer.new(function(loop,io...
mit
MaliciouZzHD/AndroidChromeCastControl
files/nmap/nselib/eap.lua
2
7992
--- -- EAP (Extensible Authentication Protocol) library supporting a -- limited subset of features. -- -- The library was designed and tested against hostapd v0.6.10 -- The EAP protocol names are the ones specified in: -- http://www.iana.org/assignments/eap-numbers/eap-numbers.xml -- -- Scripts can use the library to ...
gpl-3.0
Flexibity/luci
applications/luci-statistics/luasrc/statistics/rrdtool/colors.lua
81
1538
--[[ Luci statistics - diagram color helper class (c) 2008 Freifunk Leipzig / Jo-Philipp Wich <xm@leipzig.freifunk.net> 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.or...
apache-2.0
Oliveryo/Interface
AddOns/enemyFrames/enemyFramesCore.lua
1
11952
local playerFaction local bgs = {['Warsong Gulch'] = 10, ['Arathi Basin'] = 15, --['Alterac Valley'] = 40 } -- TIMERS local playerListInterval, playerListRefresh, enemyNearbyInterval, enemyNearbyRefresh = 30, 0, .3, 0 local raidMemberIndex = 1 local playerOutdoorLastseen = 60 local insideBG = false local...
gpl-3.0
Oliveryo/Interface
AddOns/Cartographer/Modules/InstanceMaps.lua
1
10580
local revision = tonumber(string.sub("$Revision: 18625 $", 12, -3)) if revision > Cartographer.revision then Cartographer.version = "r" .. revision Cartographer.revision = revision Cartographer.date = string.sub("$Date: 2006-12-02 16:13:35 +0300 (Сб, 02 дек 2006) $", 8, 17) end local L = AceLibrary("AceLocale-2.2")...
gpl-3.0
FlightControl-Master/MOOSE
Moose Development/Moose/Wrapper/Static.lua
1
8334
--- **Wrapper** - STATIC wraps the DCS StaticObject class. -- -- === -- -- ### Author: **FlightControl** -- -- ### Contributions: **funkyfranky** -- -- === -- -- @module Wrapper.Static -- @image Wrapper_Static.JPG --- @type STATIC -- @extends Wrapper.Positionable#POSITIONABLE --- Wrapper class to handle Static ...
gpl-3.0
funshine/nodemcu-firmware
lua_examples/yet-another-bmp085.lua
65
2608
------------------------------------------------------------------------------ -- BMP085 query module -- -- LICENCE: http://opensource.org/licenses/MIT -- Vladimir Dronnikov <dronnikov@gmail.com> -- Heavily based on work of Christee <Christee@nodemcu.com> -- -- Example: -- dofile("bmp085.lua").read(sda, scl) ----------...
mit
dogdirt2000/cmft
scripts/cmft_cli.lua
3
1781
-- -- Copyright 2014-2015 Dario Manesku. All rights reserved. -- License: http://www.opensource.org/licenses/BSD-2-Clause -- function cmftCliProject(_cmftDir) local CMFT_INCLUDE_DIR = (_cmftDir .. "include/") local CMFT_SRC_DIR = (_cmftDir .. "src/cmft/") local CMFT_CLI_SRC_DIR = (_cmftDir .....
bsd-2-clause
cc122cc/THETETOO2
plugins/sticker.lua
17
1616
--[[ ▀▄ ▄▀▀▄▄▀▀▄▄▀▀▄▄▀▀▄▄▀▀▄▄▀▀▄▄▀▀▄▀▄▄▀▀▄▄▀▀▄▄▀▀▄▄▀▀ ▀▄ ▄▀ ▀▄ ▄▀ ▀▄ ▄▀ BY MOHAMMED HISHAM ▀▄ ▄▀ ▀▄ ▄▀ BY MOHAMMEDHISHAM (@TH3BOSS) ▀▄ ▄▀ ▀▄ ▄▀ JUST WRITED BY MOHAMMED HISHAM ▀▄ ▄▀ ▀▄ ▄▀ sticker : تحويل ملصق ▀▄ ▄▀ ▀▄...
gpl-2.0
sysuzhang/arcemu
src/scripts/lua/Lua/Stable Scripts/Outland/Auchenai Crypts/BOSS_AuchenaiCrypts_Shirrak.lua
30
1144
function Shirrak_Inhibit_Magic(Unit, event, miscunit, misc) print "Shirrak Inhibit Magic" Unit:FullCastSpellOnTarget(32264,Unit:GetRandomPlayer()) Unit:SendChatMessage(11, 0, "Your weak...") end function Shirrak_Attract_Magic(Unit, event, miscunit, misc) print "Shirrak Attract Magic" Unit:FullCastSpellOnTarget(32...
agpl-3.0
MaliciouZzHD/AndroidChromeCastControl
files/nmap/nselib/data/psexec/drives.lua
4
1336
---This configuration file pulls info about a given harddrive -- Any variable in the 'config' table in smb-psexec.nse can be overriden in the -- 'overrides' table. Most of them are not really recommended, such as the host, -- key, etc. overrides = {} --overrides.timeout = 40 modules = {} local mod mod = {} mod.upl...
gpl-3.0
EvilHero90/forgottenserver
data/scripts/actions/others/blue_surprise_bag.lua
7
1496
local config = { {chanceFrom = 0, chanceTo = 1046, itemId = 6569, count = 3}, -- candy {chanceFrom = 1047, chanceTo = 1997, itemId = 6280}, -- party cake {chanceFrom = 1998, chanceTo = 2962, itemId = 6576}, -- fireworks rocket {chanceFrom = 2963, chanceTo = 3872, itemId = 2114}, -- piggy bank {chanceFrom = 3873, c...
gpl-2.0
x-v8/bkb
deps/lua-expat/expat.lua
1
11861
local ffi = require( "ffi" ) local expat = ffi.load( "expat" ) ffi.cdef[[ struct XML_ParserStruct; typedef struct XML_ParserStruct *XML_Parser; enum { XML_MAJOR_VERSION = 2, XML_MINOR_VERSION = 0, XML_MICRO_VERSION = 1 }; typedef enum XML_Status { XML_STATUS_ERROR = 0, XML_STATUS_OK = 1, XML_S...
mit
slayerrensky/luci
modules/luci-mod-rpc/luasrc/controller/rpc.lua
10
4431
-- 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
starius/kodomoquiz
quiz/lua1quiz.lua
1
1529
local lua1quiz = {} function lua1quiz.greeter(req) return '', '>', '$', '#', '%', [[Каким символом интерпретатор Lua приветствует пользователя в интерактивном режиме?]] end function lua1quiz.operator(req) return '', 'operator', 'statement', 'function', 'call', ...
mit
titansec/openwaf
lib/twaf/twaf_anti_cc/twaf_cc_trigger_cond.lua
1
2030
-- Copyright (C) Miracle -- Copyright (C) OpenWAF local _M = { _VERSION = "1.0.0" } local twaf_func = require "lib.twaf.inc.twaf_func" local modules_name = "twaf_limit_conn" local people = 1 local evil = 2 local god = 3 local ngx_now = ngx.now local table_insert = table.insert loc...
apache-2.0
tboox/xmake
xmake/platforms/cross/config.lua
1
4123
--!A cross-platform build utility based on Lua -- -- Licensed to the Apache Software Foundation (ASF) under one -- or more contributor license agreements. See the NOTICE file -- distributed with this work for additional information -- regarding copyright ownership. The ASF licenses this file -- to you under the Apach...
apache-2.0
wangeek/Egoboo
src/game/Makefile.lua
1
1521
# note if you change the prefix also update egoboo.sh PREFIX := ${HOME}/.local EGO_SRC := \ camera.c char.c client.c clock.c egoboo_console.c egoboo_endian.c \ egoboo_fileutil.c egoboo_math.c egoboo_setup.c egoboo_strutil.c \ egoboo_typedef.c egoboo_vfs.c enchant.c file_common.c \ font_bmp.c font_ttf.c gam...
gpl-2.0
u20024804/torch7
TensorMath.lua
28
42196
local wrap = require 'cwrap' require 'torchcwrap' local interface = wrap.CInterface.new() local method = wrap.CInterface.new() interface:print([[ #include "TH.h" #include "luaT.h" #include "utils.h" ]]) -- specific to torch: we generate a 'dispatch' function -- first we create a helper function -- n...
bsd-3-clause
Oliveryo/Interface
AddOns/dpsmate/modules/DPSMate_Decurses.lua
1
4193
-- Global Variables DPSMate.Modules.Decurses = {} DPSMate.Modules.Decurses.Hist = "Dispels" DPSMate.Options.Options[1]["args"]["decurses"] = { order = 195, type = 'toggle', name = DPSMate.L["decurses"], desc = DPSMate.L["show"].." "..DPSMate.L["decurses"]..".", get = function() return DPSMateSettings["windows"][DP...
gpl-3.0
jaythomas/love-experiment
src/systems/actions/update-bg-turret.lua
1
1228
--- UpdateBgTurret -- Make the turret's sprite follow the player local GameState = require 'src/services/game-state' local System = require 'lib/system' --local Timer = require 'lib/timer' local Util = require 'src/services/util' local components = { 'body', '=sprite', 'sprites' } local system = function(body,...
lgpl-3.0
leecrest/luvit
tests/test-path.lua
14
28907
--[[ Copyright 2012 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 or agr...
apache-2.0
Oliveryo/Interface
AddOns/Cartographer/Modules/GroupColors.lua
1
4698
local revision = tonumber(string.sub("$Revision: 18625 $", 12, -3)) if revision > Cartographer.revision then Cartographer.version = "r" .. revision Cartographer.revision = revision Cartographer.date = string.sub("$Date: 2006-12-02 16:13:35 +0300 (Сб, 02 дек 2006) $", 8, 17) end local L = AceLibrary("AceLocale-2.2")...
gpl-3.0
NerdWalletOSS/Q
DEPRECATED_Q2/LUAQ/s_to_f.lua
1
4624
#!/home/subramon/lua-5.3.0/src/lua function chk_s_to_f(J) assert(J ~= nil) assert(type(J) == "table") local t = assert(J.tbl) assert(chk_tbl_name(t)) assert(is_tbl(t), "Table not found " .. t) local f = assert(J.fld) assert(chk_fld_name(f)) local jop = assert(J.OP) assert(J.fld) local jargs = assert...
mit
zhityer/zhityer7
plugins/giphy.lua
633
1796
-- Idea by https://github.com/asdofindia/telegram-bot/ -- See http://api.giphy.com/ do local BASE_URL = 'http://api.giphy.com/v1' local API_KEY = 'dc6zaTOxFJmzC' -- public beta key local function get_image(response) local images = json:decode(response).data if #images == 0 then return nil end -- No images loca...
gpl-2.0