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
NerdWalletOSS/Q
QLI_LUA/DEPRECATED/Q_TOOL/deps/mime.lua
6
5619
--[[lit-meta name = "creationix/mime" version = "2.0.0" description = "A simple mime type database useful for serving static files over http." tags = {"mime", "static"} license = "MIT" author = { name = "Tim Caswell" } homepage = "https://github.com/creationix/weblit/blob/master/libs/mime.lua" ]] local m...
mit
codergreen/ValyriaTear
img/sprites/map/characters/thanis_idle.lua
4
1050
-- 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
tboox/xmake
xmake/modules/detect/tools/find_gzip.lua
1
1807
--!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
aim-for-better/redis
deps/lua/test/life.lua
888
2635
-- life.lua -- original by Dave Bollinger <DBollinger@compuserve.com> posted to lua-l -- modified to use ANSI terminal escape sequences -- modified to use for instead of while local write=io.write ALIVE="¥" DEAD="þ" ALIVE="O" DEAD="-" function delay() -- NOTE: SYSTEM-DEPENDENT, adjust as necessary for i=1,10000 do...
bsd-3-clause
fperrad/lua
t/test/life.lua
888
2635
-- life.lua -- original by Dave Bollinger <DBollinger@compuserve.com> posted to lua-l -- modified to use ANSI terminal escape sequences -- modified to use for instead of while local write=io.write ALIVE="¥" DEAD="þ" ALIVE="O" DEAD="-" function delay() -- NOTE: SYSTEM-DEPENDENT, adjust as necessary for i=1,10000 do...
artistic-2.0
Flexibity/luci
libs/web/luasrc/cbi/datatypes.lua
2
5452
--[[ LuCI - Configuration Bind Interface - Datatype Tests (c) 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://www.apache.org/licenses/LICENSE...
apache-2.0
leecrest/luvit
tests/test-emitter.lua
6
2343
--[[ Copyright 2014 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
LuaDist2/npy4th
init.lua
2
1981
--Copyright (C) 2016 Hani Altwaijry --Released under MIT License --license available in LICENSE file require 'torch' require 'libnpy4th' require 'xlua' local npy4th = {} local help = { loadnpy = [[loadnpy(filepath) -- Loads a numpy .npy file to a torch.Tensor]], loadnpz = [[loadnpz(filepath) -- Loads a numpy .npz f...
mit
mentor81/kgbot
plugins/groupmanager.lua
166
11272
-- 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 not is_admin(msg) then return "You're not admin!" end local group_creator = msg.from.print_name create_group_chat (group_cr...
gpl-2.0
TeslaCloud/TTTRewrite
terrortown/entities/weapons/weapon_zm_mac10.lua
1
1275
AddCSLuaFile() SWEP.HoldType = "ar2" if CLIENT then SWEP.PrintName = "MAC10" SWEP.Slot = 2 SWEP.Icon = "vgui/ttt/icon_mac" SWEP.IconLetter = "l" end SWEP.Base = "weapon_tttbase" SWEP.Kind = WEAPON_HEAVY SWEP.WeaponID = AMMO_MAC10 SWEP.Primary.Damage = 12 SWEP.Primary.Delay = 0.065 SWEP.P...
mit
NerdWalletOSS/Q
UTILS/lua/logger.lua
1
2146
local Logger= {} Logger.__index = Logger setmetatable(Logger, { __call = function (cls, ...) return cls.new(...) end, }) local modes = { { name = "trace", color = "\27[34m", }, { name = "debug", color = "\27[36m", }, { name = "info", color = "\27[32m", }, { name = "warn", color = "\27[33m", }, {...
mit
patrikrm13/patix
plugins/setrank.lua
4
8885
do local Dev = 122774063 --put your id here(BOT OWNER ID) local function setrank(msg, name, value) -- setrank function local hash = nil if msg.to.type == 'chat' then hash = 'rank:'..msg.to.id..':variables' end if hash then redis:hset(hash, name, value) return send_msg('chat#id'..msg.to.id, 'مقام کاربر...
gpl-2.0
roastchicken/LTB
src/ltn12.lua
3
8632
----------------------------------------------------------------------------- -- LTN12 - Filters, sources, sinks and pumps. -- LuaSocket toolkit. -- Author: Diego Nehab ----------------------------------------------------------------------------- ------------------------------------------------------------------------...
mit
FlightControl-Master/MOOSE
Moose Development/Moose/AI/AI_Cargo_Ship.lua
1
16886
--- **AI** - Models the intelligent transportation of infantry and other cargo. -- -- === -- -- ### Author: **acrojason** (derived from AI_Cargo_APC by FlightControl) -- -- === -- -- @module AI.AI_Cargo_Ship -- @image AI_Cargo_Dispatcher.JPG --- @type AI_CARGO_SHIP -- @extends AI.AI_Cargo#AI_CARGO --- Brings a dynami...
gpl-3.0
fperrad/lua
t/shootout/knucleotide_lua-2.lua
6
1669
-- The Great Computer Language Shootout -- http://shootout.alioth.debian.org/ -- contributed by Mike Pall local function kfrequency(seq, freq, k, frame) local sub = string.sub local k1 = k - 1 for i=frame,string.len(seq)-k1,k do local c = sub(seq, i, i+k1) freq[c] = freq[c] + 1 end end local function ...
artistic-2.0
tboox/xmake
xmake/modules/os/winver.lua
1
3046
--!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/VanillaGuide/VGuideFu.lua
1
5507
--[[-------------------------------------------------- ----- VanillaGuide ----- ------------------ VGuideFu.lua Authors: mrmr Version: 1.04.2 ------------------------------------------------------ Description: Fubar plugin for VGuide 1.00 -- Initial Ace2 release 1.99a -- Ally addition starter version ...
gpl-3.0
great90/skynet
test/testsha.lua
30
77636
local skynet = require "skynet" local crypt = require "skynet.crypt" local function sha1(text) local c = crypt.sha1(text) return crypt.hexencode(c) end local function hmac_sha1(key, text) local c = crypt.hmac_sha1(key, text) return crypt.hexencode(c) end -- test case from http://regex.info/code/sha1.lua print(1...
mit
leecrest/luvit
examples/http-keepalive.lua
16
2387
--[[ 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
daurnimator/lpeg_patterns
lpeg_patterns/phone.lua
1
3343
-- Phone numbers local lpeg = require "lpeg" local P = lpeg.P local R = lpeg.R local S = lpeg.S local digit = R"09" local seperator = S"- ,." local function optional_parens(patt) return P"(" * patt * P")" + patt end local _M = {} local extension = P"e" * (P"xt")^-1 * seperator^-1 * digit^1 local optional_extension...
mit
keyidadi/luci
modules/base/luasrc/cbi/datatypes.lua
62
6006
--[[ LuCI - Configuration Bind Interface - Datatype Tests (c) 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://www.apache.org/licenses/LICENSE...
apache-2.0
Oliveryo/Interface
AddOns/WIM/WIM.lua
1
39980
WIM_VERSION = "1.3.1"; WIM_Windows = {}; WIM_EditBoxInFocus = nil; WIM_NewMessageFlag = false; WIM_NewMessageCount = 0; WIM_Icon_TheMenu = nil; WIM_Icon_UpdateInterval = .5; WIM_CascadeStep = 0; WIM_MaxMenuCount = 20; WIM_ClassIcons = {}; WIM_ClassColors = {}; WIM_PlayerCache = {} WIM_PlayerCacheQueue = {} WIM_Whisper...
gpl-3.0
weirdouncle/QSanguosha-For-Hegemony
lang/zh_CN/Audio/StandardShuLines.lua
6
3115
return { -- 刘备 ["$rende1"] = "以德服人。", ["$rende2"] = "惟贤惟德,能服于人。", ["$jijiang1"] = "蜀将何在?", ["$jijiang2"] = "尔等敢应战否?", ["~liubei"] = "这就是桃园吗?", -- 关羽 ["$wusheng1"] = "关羽在此,尔等受死!", ["$wusheng2"] = "看尔乃插标卖首!", ["~guanyu"] = "什么?此地名叫麦城?", -- 张飞 ["$paoxiao1"] = "啊~~~", ["$paoxiao2"] = "燕人张飞在此!", ["~zhang...
gpl-3.0
billbonney/ardupilot
Tools/CHDK-Scripts/Cannon S100/3DR_EAI_S100.lua
96
29695
--[[ KAP UAV Exposure Control Script v3.2 -- Released under GPL by waterwingz and wayback/peabody http://chdk.wikia.com/wiki/KAP_%26_UAV_Exposure_Control_Script 3DR EAI 1.0 is a fork of KAP 3.1 with settings specific to Canon cameras triggered off the Pixhawk autopilot. Changelog: -Modified Tv, Av, and...
gpl-3.0
gmorishere/gm
plugins/owners.lua
1467
12478
local function lock_group_namemod(msg, data, target) local group_name_set = data[tostring(target)]['settings']['set_name'] local group_name_lock = data[tostring(target)]['settings']['lock_name'] if group_name_lock == 'yes' then return 'Group name is already locked' else data[tostring(target)]['setting...
gpl-2.0
RamiLego4Game/PixelizerBox-Sandbox
Helpers/loveframes/objects/tree.lua
13
8247
--[[------------------------------------------------ -- Love Frames - A GUI library for LOVE -- -- Copyright (c) 2012-2014 Kenny Shields -- --]]------------------------------------------------ -- get the current require path local path = string.sub(..., 1, string.len(...) - string.len(".objects.tree")) local lovefra...
apache-2.0
tboox/xmake
xmake/core/base/object.lua
1
2541
--!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
g0t-ya/XiaoyuBox
luci/controller/ddns.lua
6
7451
-- Copyright 2008 Steven Barth <steven@midlink.org> -- Copyright 2008 Jo-Philipp Wich <jow@openwrt.org> -- Copyright 2013 Manuel Munz <freifunk at somakoma dot de> -- Copyright 2014 Christian Schoenebeck <christian dot schoenebeck at gmail dot com> -- Licensed to the public under the Apache License 2.0. module("luci.c...
lgpl-3.0
Oliveryo/Interface
AddOns/BigWigs_NefCount/BigWigs_CounterBars.lua
1
1700
assert(BigWigs, "BigWigs not found!") assert(BigWigsBars, "BigWigsBars not found!") ------------------------------ -- Are you local? -- ------------------------------ local candybar = AceLibrary("CandyBar-2.0") ---------------------------------- -- Module Declaration -- ------------------------...
gpl-3.0
cyfdecyf/luanet
ffi/kqueue.lua
1
1411
local ffi = require 'ffi' local C = ffi.C require('luanet.ffi.kqueue_' .. ffi.os) ffi.cdef[[ int kqueue(void); int kevent(int kq, const struct kevent *changelist, int nchanges, struct kevent *eventlist, int nevents, const struct timespec *timeout); ]] local M = {} M.EVFILT_READ = C.EVFILT_READ M.EVFILT_WRITE = C....
mit
mahdisudo/see
plugins/anti_spam.lua
417
3978
--An empty table for solving multiple kicking problem(thanks to @topkecleon ) kicktable = {} do local TIME_CHECK = 2 -- seconds local data = load_data(_config.moderation.data) -- Save stats, ban user local function pre_process(msg) -- Ignore service msg if msg.service then return msg end if msg.from.id =...
gpl-2.0
goldguard/goldguard
plugins/anti_spam.lua
417
3978
--An empty table for solving multiple kicking problem(thanks to @topkecleon ) kicktable = {} do local TIME_CHECK = 2 -- seconds local data = load_data(_config.moderation.data) -- Save stats, ban user local function pre_process(msg) -- Ignore service msg if msg.service then return msg end if msg.from.id =...
gpl-2.0
Shayan123456/botttttt2
plugins/translate.lua
674
1637
--[[ -- Translate text using Google Translate. -- http://translate.google.com/translate_a/single?client=t&ie=UTF-8&oe=UTF-8&hl=en&dt=t&tl=en&sl=auto&text=hello --]] do function translate(source_lang, target_lang, text) local path = "http://translate.google.com/translate_a/single" -- URL query parameters local p...
gpl-2.0
Oliveryo/Interface
AddOns/oCB/mirror.lua
1
1450
local elapsed = 0 function oCB:MIRROR_TIMER_START(type, value, maxValue, scale, pause, text) self:Debug("MIRROR_TIMER_START - %s | %s | %s | %s | %s | %s", type, value, maxValue, scale, pause, text) oCB.frames[type].value = (value / 1000) oCB.frames[type].scale = scale if ( pause > 0 ) then CB.frames[type].pau...
gpl-3.0
tboox/xmake
xmake/modules/core/tools/ldc2.lua
1
1211
--!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/companion
bin/iproscan_gaf_merge.lua
4
6435
#!/usr/bin/env gt --[[ Author: Sascha Steinbiss <ss34@sanger.ac.uk> Copyright (c) 2014-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 a...
isc
RamiLego4Game/PixelizerBox-Sandbox
Helpers/loveframes/objects/base.lua
10
28458
--[[------------------------------------------------ -- Love Frames - A GUI library for LOVE -- -- Copyright (c) 2012-2014 Kenny Shields -- --]]------------------------------------------------ -- get the current require path local path = string.sub(..., 1, string.len(...) - string.len(".objects.base")) local lovefra...
apache-2.0
slayerrensky/luci
modules/luci-base/luasrc/http.lua
44
4772
-- Copyright 2008 Steven Barth <steven@midlink.org> -- Licensed to the public under the Apache License 2.0. local ltn12 = require "luci.ltn12" local protocol = require "luci.http.protocol" local util = require "luci.util" local string = require "string" local coroutine = require "coroutine" local table = require "tab...
apache-2.0
dsalychev/mcusim
tests/atmega8a/timer0-ext-clock-source/check-timer0.lua
1
1806
--[[ 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
NerdWalletOSS/Q
OPERATORS/DROP_NULLS/lua/drop_nulls.lua
1
2327
local T = {} local function drop_nulls(x, sval) local Q = require 'Q/q_export' local qc = require 'Q/UTILS/lua/q_core' local ffi = require 'Q/UTILS/lua/q_ffi' local get_ptr = require 'Q/UTILS/lua/get_ptr' local qconsts = require 'Q/UTILS/lua/q_consts' local to_scalar = require 'Q/UTILS/lua/to_scalar' ...
mit
tboox/xmake
xmake/core/sandbox/modules/import/core/project/template.lua
1
1991
--!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
libs/nixio/docsrc/CHANGELOG.lua
95
1036
--- Changes and improvements. module "CHANGELOG" --- Service Release. -- <ul> -- <li>Added getifaddrs() function.</li> -- <li>Added getsockopt(), setsockopt(), getsockname() and getpeername() -- directly to TLS-socket objects unifying the socket interface.</li> -- <li>Added support for CyaSSL as cryptographical backen...
apache-2.0
EvilHero90/forgottenserver
data/npc/lib/npcsystem/keywordhandler.lua
7
5709
-- Advanced NPC System by Jiddo if not KeywordHandler then KeywordNode = { keywords = nil, callback = nil, parameters = nil, children = nil, parent = nil } -- Created a new keywordnode with the given keywords, callback function and parameters and without any childNodes. function KeywordNode:new(keys, fu...
gpl-2.0
sasanhastam/sasan
plugins/banhammer.lua
24
41763
local function pre_process(msg) if msg.to.type ~= 'pv' then chat = msg.to.id user = msg.from.id local function check_newmember(arg, data) test = load_data(_config.moderation.data) lock_bots = test[arg.chat_id]['settings']['lock_bots'] local hash = "gp_lang:"..arg.chat_id local lang = redis:get(hash) if data...
gpl-3.0
slayerrensky/luci
modules/luci-base/luasrc/util.lua
46
16763
-- Copyright 2008 Steven Barth <steven@midlink.org> -- Licensed to the public under the Apache License 2.0. local io = require "io" local math = require "math" local table = require "table" local debug = require "debug" local ldebug = require "luci.debug" local string = require "string" local coroutine = require "coro...
apache-2.0
Telewildv4/Telewildv4bot
plugins/Fantasy.lua
1
12162
-- http://www.messletters.com/fa/ local function run(msg, matches) if not is_admin(msg) then return "این قابلیت فقط مربوط به ادمینهاست" end if #matches < 2 then return "بعد از این دستور، با قید یک فاصله کلمه یا جمله ی مورد نظر را جهت زیبا نویسی وارد کنید" end if string.len(matches[2]) > 20 then return "حداک...
gpl-2.0
MaliciouZzHD/AndroidChromeCastControl
files/nmap/nselib/data/http-fingerprints.lua
2
216073
local table = require "table" ---HTTP Fingerprint files, compiled by Ron Bowes with a special thanks to... -- o Kevin Johnson (@secureideas) for the fingerprints that come with Yokoso -- http://yokoso.inguardians.com -- o Jason H. (@jhaddix) for helping out with a whole pile of fingerprints he's -- collected -- o ...
gpl-3.0
NerdWalletOSS/Q
DEPRECATED_Q2/Q_TOOL/deps/json.lua
14
22787
--[[lit-meta name = "luvit/json" version = "2.5.2" homepage = "http://dkolf.de/src/dkjson-lua.fsl" description = "David Kolf's JSON library repackaged for lit." tags = {"json", "codec"} license = "MIT" author = { name = "David Kolf", homepage = "http://dkolf.de/", } contributors = { "Tim C...
mit
Oliveryo/Interface
AddOns/enemyFrames/UIElements/customCooldown.lua
1
1852
------------------------------------------------------------------------------- local OnUpdateAnimation = function() if GetTime() < this.timeEnd then local finished = (GetTime() - this.timeStart) / (this.timeEnd - this.timeStart) if finished < 1.0 then local time = finished * 1000; this:SetSequenceT...
gpl-3.0
NerdWalletOSS/Q
experimental/testgc.lua
1
1250
collectgarbage("collect") print (collectgarbage("count")) local ffi = require 'ffi' --local C = terralib.includec("stdlib.h") ffi.cdef[[ void *malloc(int); void free(void*); ]] --[[ local Array = function(typ) return terra(N : int) var r : &typ = [&typ](C.malloc(sizeof(typ) * N)) return r ...
mit
Oliveryo/Interface
AddOns/Cartographer/Libs/AceEvent-2.0/AceEvent-2.0.lua
2
28515
--[[ Name: AceEvent-2.0 Revision: $Rev: 14125 $ Developed by: The Ace Development Team (http://www.wowace.com/index.php/The_Ace_Development_Team) Inspired By: Ace 1.x by Turan (turan@gryphon.com) Website: http://www.wowace.com/ Documentation: http://www.wowace.com/index.php/AceEvent-2.0 SVN: http://svn.wowace.com/root/...
gpl-3.0
Spring-SpringBoard/SpringBoard-Core
scen_edit/command/import_shading_image_command.lua
1
1286
ImportShadingImageCommand = Command:extends{} ImportShadingImageCommand.className = "ImportShadingImageCommand" function ImportShadingImageCommand:init(texType, texturePath) self.texType = texType self.texturePath = texturePath end function LoadShadingTexture(texType, path, fromProject) local texObj = SB....
mit
EvilHero90/forgottenserver
data/lib/core/game.lua
6
3576
function Game.broadcastMessage(message, messageType) if not messageType then messageType = MESSAGE_STATUS_WARNING end for _, player in ipairs(Game.getPlayers()) do player:sendTextMessage(messageType, message) end end function Game.convertIpToString(ip) local band = bit.band local rshift = bit.rshift return...
gpl-2.0
paulmoore/Factor-Friends
result/scene.lua
1
4534
--- scene.lua -- -- This is the ending scene for a game. Displays the winner/loser and final scores. -- -- @author Paul Moore -- -- Copyright (c) 2012 Strange Ideas Software -- -- This file is part of Factor Friends. -- -- Factor Friends is free software: you can redistribute it and/or modify -- it under the terms of ...
gpl-3.0
Rodeo314/tim-vlc
share/lua/sd/icast.lua
81
4264
--[[ $Id$ Copyright © 2010 VideoLAN and AUTHORS Authors: Julien 'Lta' BALLET <contact at lta dot io> 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 y...
gpl-2.0
Spring-SpringBoard/SpringBoard-Core
scen_edit/model/terrain_manager.lua
1
1725
TerrainManager = Observable:extends{} function TerrainManager:init() self.shapes = {} end function TerrainManager:addShape(name, value) self.shapes[name] = value end function TerrainManager:getShape(name) return self.shapes[name] end function TerrainManager:generateShape(name) if self:getShape(name)...
mit
zorbathut/logal
logal_make.lua
1
14188
local params = {...} local mode = params[1] local filename = params[2] assert(filename) local OLMODE, olmode if mode == "gl2.0" then OLMODE = "GL" olmode = "gl" elseif mode == "al1.1" then OLMODE = "AL" olmode = "al" else assert(false) end local fil = io.open(filename, "w") assert(fil) fil:write( [[ /**...
bsd-3-clause
Flexibity/luci
modules/admin-full/luasrc/model/cbi/admin_network/dhcp.lua
8
8099
--[[ 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
starius/kodomoquiz
quiz/dict_file.lua
1
10963
local math = require("math") math.randomseed(os.time()) local h = require('quiz.helpers') local rr = h.rr local _ = h._ local dict_file = {} function dict_file.dict_get(req) local task = [[>>> mydict = {1: 2, 2: 3, 3: 4, 4: 5} >>> mydict[%i] ]] local val = rr(1, 3) local result = val + 1 loc...
mit
Hikari-no-Tenshi/android_external_skia
resources/lua/slides_transitions.lua
78
6033
function scale_text_delta(template, delta) template = template.slide for i = 1, #template do local paint = template[i].paint paint:setTextSize(paint:getTextSize() + delta) end end function slide_transition(prev, next, is_forward) local rec = { proc = function(self, canvas, drawS...
bsd-3-clause
protito/nyas-space-quest-qd
cocos2d/plugin/luabindings/auto/api/ProtocolAds.lua
146
1442
-------------------------------- -- @module ProtocolAds -- @extend PluginProtocol -- @parent_module plugin -------------------------------- -- brief show adview<br> -- param info The information of adview will be shown<br> -- Pay attention to the subclass definition<br> -- param pos The position where the adview be s...
apache-2.0
tboox/xmake
xmake/themes/plain/xmake.lua
1
1680
--!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
Rhalyf/RhalyfsKeybindings
lib/LibAddonMenu-2.0/controls/colorpicker.lua
7
3888
--[[colorpickerData = { type = "colorpicker", name = "My Color Picker", tooltip = "Color Picker's tooltip text.", getFunc = function() return db.r, db.g, db.b, db.a end, --(alpha is optional) setFunc = function(r,g,b,a) db.r=r, db.g=g, db.b=b, db.a=a end, --(alpha is optional) width = "full", --or "half" (optiona...
mit
NerdWalletOSS/Q
DEPRECATED_Q2/LUAQ/qinit.lua
1
1380
#!/home/subramon/LUA/lua-5.3.0/src/lua function qinit() dofile "../LUAQ/metaq.lua" dofile "../LUAQ/q.lua" dofile "../LUAQ/aux.lua" dofile "../LUAQ/add_tbl.lua" dofile "../LUAQ/add_fld.lua" dofile "../LUAQ/del_tbl.lua" dofile "../LUAQ/del_fld.lua" dofile "../LUAQ/tbl_meta.lua" dofile "../LUAQ/show_t...
mit
tboox/xmake
xmake/modules/detect/tools/find_gdc.lua
1
1714
--!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
NerdWalletOSS/Q
OPERATORS/PRINT/test/test_I4_to_txt.lua
1
1140
local Q = require 'Q' local qc = require 'Q/UTILS/lua/q_core' local ffi = require 'Q/UTILS/lua/q_ffi' local qconsts = require 'Q/UTILS/lua/q_consts' local cmem = require 'libcmem' local get_ptr = require 'Q/UTILS/lua/get_ptr' require 'Q/UTILS/lua/strict' local tests = {} local BUFLEN = 1024 tests.t1 = function() ...
mit
facebook/learningSimpleAlgorithms
utils/colors.lua
2
1320
--[[ * Copyright (c) 2015-present, 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. ]]-- -- All...
bsd-3-clause
rickmcfarley/bees_candles
init.lua
1
41932
-- init.lua -- bees + candles minetest mod, by rickmcfarley -- Copyright (C) Rick McFarley 2015 <rickmcfarley@gmail.com> -- -- 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 3 o...
gpl-3.0
goldguard/goldguard
plugins/admin.lua
381
7085
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(rec...
gpl-2.0
NerdWalletOSS/Q
UTILS/build/tests.lua
1
1890
-- Specify script in order in which they should run local T = {} T[#T+1] = { dir = "/OPERATORS/A_IN_B/test/", scripts = { "run_tests.sh" }} T[#T+1] = { dir = "/OPERATORS/F_TO_S/test/", scripts = { "run_tests.sh" }} T[#T+1] = { dir = "/OPERATORS/F1F2OPF3/test/", scripts = { "run_tests.sh" }} T[#T+1] = { dir = "/OPERATOR...
mit
NerdWalletOSS/Q
QLI_LUA/DEPRECATED/Q_TOOL/deps/weblit-websocket.lua
7
2914
--[[lit-meta name = "creationix/weblit-websocket" version = "3.0.0" dependencies = { "creationix/websocket-codec@3.0.0", "creationix/coro-websocket@3.0.0", } description = "The websocket middleware for Weblit enables handling websocket clients." tags = {"weblit", "middleware", "websocket"} license...
mit
coopmaster/GalacticTradeMod-Factorio
GalacticTrade_/control.lua
1
59826
require "defines" require("prototypes.scripts.trading-chest") require 'config' --require "luasocket" --game.getplayer(index or name) for multiplayer support function comma_value(n) -- credit http://richard.warburton.it if n ~= nil then local left,num,right = string.match(n,'^([^%d]*%d)(%d*)(.-)$') return left..(...
mit
jie-meng/Lunar
publish/tools/cocos2dx/cocos_lua_sort_imports.lua
2
2058
local pattern_import_line = [[local%s+([%w_]+)%s*=%s*import%s*%("([%w%._]+)"%)]] local files = util.findFilesInDirRecursively(util.currentPath()) for _, f in ipairs(files) do if util.strEndWith(f, ".lua") then local text = util.readTextFile(f) local lines = util.strSplit(text, "\n") local ...
gpl-2.0
codergreen/ValyriaTear
img/sprites/map/npcs/npc_woman02_walk.lua
4
1987
-- 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
keyidadi/luci
applications/luci-diag-devinfo/luasrc/controller/luci_diag/smap_common.lua
76
3395
--[[ 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...
apache-2.0
Shayan123456/botttttt2
plugins/ingroup.lua
87
48801
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
TeslaCloud/TTTRewrite
terrortown/entities/entities/info_manipulate.lua
3
1537
-- Dummy entity to convert ZM info_manipulate traps to TTT ones ENT.Type = "point" ENT.Base = "base_point" function ENT:Think() if not self.Replaced then self:CreateReplacement() self:Remove() end end function ENT:KeyValue(key, value) if key == "OnPressed" then -- store raw, will be feedi...
mit
RamiLego4Game/PixelizerBox-Sandbox
Helpers/loveframes/objects/list.lua
13
19810
--[[------------------------------------------------ -- Love Frames - A GUI library for LOVE -- -- Copyright (c) 2012-2014 Kenny Shields -- --]]------------------------------------------------ -- get the current require path local path = string.sub(..., 1, string.len(...) - string.len(".objects.list")) local lovefra...
apache-2.0
jaythomas/love-experiment
src/services/util.spec.lua
1
5173
describe('services/util', function() local Util before_each(function() Util = require 'services/util' end) describe('angle', function() it('should exist', function() assert.equal('function', type(Util.angle)) end) it('should return the arctangent radians between two vectors', function(...
lgpl-3.0
NerdWalletOSS/Q
TESTS/functional_test_cases/test_sort_csv.lua
1
1505
-- Test sort behaviour of Q with load csv local Q = require 'Q' require 'Q/UTILS/lua/strict' local tests = {} tests.t1 = function () -- TEST SORT TWICE: DSC & ASC local meta = { { name = "empid", has_nulls = true, qtype = "I4", is_load = true } } local datadir = os.getenv("Q_SRC_ROOT") .. "/TESTS/functional...
mit
Spring-SpringBoard/SpringBoard-Core
LuaUI/widgets/api_springmon_loader.lua
2
1127
---------------------------------------------------------------------------- ---------------------------------------------------------------------------- -- Copy this file to the luaui/widgets and luarules/gadgets folders -- Set this line to the springmon installation folder SPRINGMON_DIR = "libs_sb/springmon/" -- Do...
mit
Flexibity/luci
applications/luci-flexibity/luasrc/controller/flexibity.lua
1
1686
--[[ LuCI - Lua Configuration Interface Copyright 2008 Steven Barth <steven@midlink.org> Copyright 2008 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 h...
apache-2.0
Hikari-no-Tenshi/android_external_skia
resources/lua/slides.lua
10
9961
gShowBounds = false gUseBlurInTransitions = false gPath = "resources/lua/" function load_file(file) local prev_path = package.path package.path = package.path .. ";" .. gPath .. file .. ".lua" require(file) package.path = prev_path end load_file("slides_utils") gSlides = parse_file(io.open("resource...
bsd-3-clause
Spring-SpringBoard/SpringBoard-Core
triggers/core.lua
1
57324
local function CanBeVariable(type) local sources = type.sources if sources == nil then return true end for _, s in pairs(sources) do if s == "var" then return true end end return false end return { actions = function() local variableAssignments =...
mit
codergreen/ValyriaTear
dat/maps/layna_village/layna_village_center_shop_map.lua
4
26703
map_data = {} -- The number of rows, and columns that compose the map map_data.num_tile_cols = 32 map_data.num_tile_rows = 24 -- The tilesets definition files used. map_data.tileset_filenames = {} map_data.tileset_filenames[1] = "dat/tilesets/building_interior_objects_01.lua" map_data.tileset_filenames[2] = "dat/tile...
gpl-2.0
NerdWalletOSS/Q
RUNTIME/test/stress_test_cmem.lua
1
1227
local cmem = require 'libcmem' ; local qc = require 'Q/UTILS/lua/q_core' local utils = require 'Q/UTILS/lua/utils' local tests = {} local niter = 100000000 tests.t1 = function() -- basic test local start_time = qc.RDTSC() for i = 1, niter do local buf = cmem.new(1048576, "I4", "hello world") assert(ty...
mit
NerdWalletOSS/Q
DEPRECATED_Q2/Q_TOOL/deps/weblit-etag-cache.lua
6
1388
--[[lit-meta name = "creationix/weblit-etag-cache" version = "2.0.0" description = "The etag-cache middleware caches WebLit responses in ram and uses etags to support conditional requests." tags = {"weblit", "middleware", "etag"} license = "MIT" author = { name = "Tim Caswell" } homepage = "https://github...
mit
keyidadi/luci
modules/admin-full/luasrc/model/cbi/admin_network/ifaces.lua
36
15568
--[[ LuCI - Lua Configuration Interface Copyright 2008 Steven Barth <steven@midlink.org> Copyright 2008-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
tboox/xmake
xmake/core/sandbox/modules/assert.lua
1
1026
--!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/rules/qt/moc/moc.lua
1
2346
--!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
FlightControl-Master/MOOSE
Moose Development/Moose/Ops/Airboss.lua
1
664183
--- **Ops** - Manages aircraft CASE X recoveries for carrier operations (X=I, II, III). -- -- The AIRBOSS class manages recoveries of human pilots and AI aircraft on aircraft carriers. -- -- **Main Features:** -- -- * CASE I, II and III recoveries. -- * Supports human pilots as well as AI flight groups. -- * A...
gpl-3.0
Oliveryo/Interface
AddOns/LunaUnitFrames/LunaUnitFrames.lua
1
14117
LunaUF = AceLibrary("AceAddon-2.0"):new("AceEvent-2.0", "AceConsole-2.0", "AceDB-2.0", "AceHook-2.1", "FuBarPlugin-2.0", "AceDebug-2.0") LunaUF:RegisterDB("LunaDB") -- Assets ---------------------------------------------------------------------------------- LunaUF.Version = 2100 LunaUF.BS = AceLibrary("Babble-Spell-2....
gpl-3.0
lhmwzy/vanilla
resty/lua-resty-cookie-0.1.0/lib/resty/cookie.lua
22
5227
-- Copyright (C) 2013 Jiale Zhi (calio), Cloudflare Inc. -- See RFC6265 http://tools.ietf.org/search/rfc6265 -- require "luacov" local type = type local byte = string.byte local sub = string.sub local format = string.format local log = ngx.log local ERR = ngx.ERR ...
mit
ahnqirage/thrift
test/lua/test_basic_server.lua
57
5557
-- Licensed to the Apache Software Foundation (ASF) under one -- or more contributor license agreements. See the NOTICE file ...
apache-2.0
slayerrensky/luci
applications/luci-app-radvd/luasrc/model/cbi/radvd/dnssl.lua
61
2025
-- Copyright 2010 Jo-Philipp Wich <jow@openwrt.org> -- Licensed to the public under the Apache License 2.0. local sid = arg[1] local utl = require "luci.util" m = Map("radvd", translatef("Radvd - DNSSL"), translate("Radvd is a router advertisement daemon for IPv6. " .. "It listens to router solicitations and sends...
apache-2.0
satta/annot-nf
bin/create_polypeptides.lua
4
8868
#!/usr/bin/env gt --[[ Author: Sascha Steinbiss <ss34@sanger.ac.uk> Copyright (c) 2014-2016 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 a...
isc
tboox/xmake
xmake/core/ui/panel.lua
1
8591
--!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
vixns/marathon-lb
getmaps.lua
4
1638
-- A simple Lua script which serves up the HAProxy -- vhost to backend map file. function check_file_exists(name) local f = io.open(name, "r") if f ~= nil then io.close(f) return true else return false end end function read_file(filepath) -- Read all of the given file, returning an empty string if the file doesn...
apache-2.0
slayerrensky/luci
applications/luci-app-minidlna/luasrc/controller/minidlna.lua
72
1242
-- Copyright 2012 Gabor Juhos <juhosg@openwrt.org> -- Licensed to the public under the Apache License 2.0. module("luci.controller.minidlna", package.seeall) function index() if not nixio.fs.access("/etc/config/minidlna") then return end local page page = entry({"admin", "services", "minidlna"}, cbi("minidlna...
apache-2.0
NerdWalletOSS/Q
experimental/SUM/q_vagg.lua
1
1865
--[[ A function (that invokes a C function) to perform numerical aggregation of a vector. Parameters: l - library containing aggFn v - vector to be aggregated e.g. {3,2,5,-1} elemType - type of vector elements e.g. "int32_t" aggType - type of aggregation result e.g. "int64_t" aggFn - name of the C function e.g. "sum...
mit