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 |
|---|---|---|---|---|---|
noa/nn | L1Penalty.lua | 42 | 1129 | local L1Penalty, parent = torch.class('nn.L1Penalty','nn.Module')
--This module acts as an L1 latent state regularizer, adding the
--[gradOutput] to the gradient of the L1 loss. The [input] is copied to
--the [output].
function L1Penalty:__init(l1weight, sizeAverage, provideOutput)
parent.__init(self)
self... | bsd-3-clause |
ntop/ntopng | scripts/lua/modules/alert_definitions/flow/alert_dns_invalid_query.lua | 1 | 1527 | --
-- (C) 2019-22 - ntop.org
--
-- ##############################################
local flow_alert_keys = require "flow_alert_keys"
-- Import the classes library.
local classes = require "classes"
-- Make sure to import the Superclass!
local alert = require "alert"
-- ##############################################
... | gpl-3.0 |
wubenqi/zengine | bin/scripts2/util/util.lua | 2 | 1702 | -- Copyright (C) 2012 by wubenqi
-- Distributable under the terms of either the Apache License (Version 2.0) or
-- the GNU Lesser General Public License, as specified in the COPYING file.
--
-- By: wubenqi<wubenqi@gmail.com>
--
local print = print
local tconcat = table.concat
local tinsert = table.insert
local srep =... | apache-2.0 |
nsimplex/snailking | scripts/snailking/brains/snailkingbrain.lua | 1 | 1991 | --@@GLOBAL ENVIRONMENT BOOTUP
local _modname = assert( (assert(..., 'This file should be loaded through require.')):match('^[%a_][%w_%s]*') , 'Invalid path.' )
module( ..., package.seeall, require(_modname .. '.booter') )
--@@END ENVIRONMENT BOOTUP
require "behaviours/wander"
require "behaviours/faceentity"
require "... | gpl-2.0 |
corbinmunce/domoticz | scripts/lua_parsers/example_owm.lua | 37 | 1285 | -- Example of XML parser handling data with the following structure
-- Data are coming from the OpenWeatherMap API : See http://www.openweathermap.org/current
-- <current>
-- <city id="12345" name="Paris">
-- <coord lon="2.35" lat="48.85"/>
-- <country>FR</country>
-- <sun rise="2016-04-22T04:45:07" set="2016-... | gpl-3.0 |
awesomenessispure/chattag | lua/ulx/modules/sh/chattags.lua | 1 | 1720 | -------------------------------------
-- This file holds the chat tags --
-------------------------------------
if ( SERVER ) then
AddCSLuaFile( )
return
end
if ( CLIENT ) then
local string = string
local str = string
local str2
local TagColor = {}
--TagColor["YourCustomUsergroupNameHere"] = Color( red,... | mit |
longmian/skynet | test/testsha.lua | 79 | 77629 | local skynet = require "skynet"
local crypt = require "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) asser... | mit |
Planimeter/lgameframework | lua/framework/window.lua | 1 | 2535 | --=========== Copyright © 2020, Planimeter, All rights reserved. ===========--
--
-- Purpose:
--
--==========================================================================--
local SDL = require( "sdl" )
local ffi = require( "ffi" )
local bit = require( "bit" )
local GL = require( "opengl" )
local pairs = pairs... | mit |
maikerumine/aftermath | mods/thirsty/init.lua | 4 | 2450 | --[[
Thirsty mod [thirsty]
==========================
A mod that adds a "thirst" mechanic, similar to hunger.
Copyright (C) 2015 Ben Deutsch <ben@bendeutsch.de>
License
-------
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as publis... | lgpl-2.1 |
Banderi/OpenTomb | scripts/entity/entity_model_ID_override.lua | 2 | 6598 | -- OPENTOMB ENTITY MODEL OVERRIDE SCRIPT
-- by TeslaRus
--------------------------------------------------------------------------------
-- The purpose of this script is to replace certain in-game models with another
-- ones. This is needed for early TR versions, which had sprites instead of
-- in-level items.
-------... | lgpl-3.0 |
ntop/ntopng | third-party/i18n.lua-master/i18n/plural.lua | 4 | 7308 | local plural = {}
local defaultFunction = nil
-- helper functions
local function assertPresentString(functionName, paramName, value)
if type(value) ~= 'string' or #value == 0 then
local msg = "Expected param %s of function %s to be a string, but got %s (a value of type %s) instead"
error(msg:format(paramName... | gpl-3.0 |
gajop/chiliui | luaui/chili/chili/handlers/debughandler.lua | 1 | 13451 | --// =============================================================================
--// Chili DebugHandler
--// =============================================================================
--// todo:
--// * use the custom errorhandler for any widget- > chili interaction,
--// atm if a widget calls mybutton:Se... | gpl-2.0 |
phpgao/Atlas | examples/tutorial-rewrite.lua | 39 | 2740 | --[[ $%BEGINLICENSE%$
Copyright (c) 2007, 2008, Oracle and/or its affiliates. All rights reserved.
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; version 2 of the
License.
This program is dis... | gpl-2.0 |
deveNovar/DEveNovar | plugins/addred.lua | 3 | 2751 | local function get_variables_hash(msg)
if msg.to.type == 'chat' or msg.to.type == 'channel' then
return 'chat:bot:variables'
end
end
local function get_value(msg, var_name)
local hash = get_variables_hash(msg)
if hash then
local value = redis:hget(hash, var_name)
if not value then
r... | gpl-2.0 |
mohammad8/123456 | plugins/service_entergroup.lua | 355 | 3585 | local add_user_cfg = load_from_file('data/add_user_cfg.lua')
local function template_add_user(base, to_username, from_username, chat_name, chat_id)
base = base or ''
to_username = '@' .. (to_username or '')
from_username = '@' .. (from_username or '')
chat_name = string.gsub(chat_name, '_', ' ') or ''
c... | gpl-2.0 |
Bierbuikje/Mr.Green-MTA-Resources | resources/[gameplay]/gcshop/items/items_gui.lua | 2 | 11332 | -------------------------------------
-- Code generated by DKR QT to Lua 0.1.7 --
-- Source: items.ui --
-- Date: 20/12/2012 - 01:19:10 --
-------------------------------------
function build_itemsWidget(parent, offsetX, offsetY)
local gui = {}
gui._placeHolders = {}
local widgetWidth, widgetHeight = 780, 105... | mit |
lizh06/premake-4.x | src/actions/example/_example.lua | 32 | 3632 | -- Define a namespace for my new action. The second line defines an alias that I
-- can use in this file, saving myself some typing. It will not be visible outside
-- of this file (though I can always define it again).
premake.example = { }
local example = premake.example
-- The description of the action. Note th... | bsd-3-clause |
Altenius/cuberite | Server/Plugins/InfoReg.lua | 5 | 7015 |
-- InfoReg.lua
-- Implements registration functions that process g_PluginInfo
--- Lists all the subcommands that the player has permissions for
local function ListSubcommands(a_Player, a_Subcommands, a_CmdString)
if (a_Player == nil) then
LOGINFO("The " .. a_CmdString .. " command requires another verb:")
el... | apache-2.0 |
trax100/luapm4tc | db.lua | 1 | 371971 | --Mon Mar 14 08:56:48 2011
return {
cl= 22245,
ts= 1300044710,
data= {
gpgme= {
229376,
1278887883,
"962f3e615ac15ce41ca04329d3a0bb68",
{
"libgpg-error",
"pth",
"libassuan",
"gnupg",
},
},
["libgeotiff-dev"]= {
36864,
1277926716,
"a66456a0cf1b6dc6f1ea954348b790ab",
{
"libgeotiff",
"graphics-libs... | mit |
Brajanowski/Behind-Society | assets/gameplay/gui.lua | 1 | 3064 | GuiStyle = {}
GuiStyle.Colors = {}
GuiStyle.Colors.Text = 0
GuiStyle.Colors.TextDisabled = 1
GuiStyle.Colors.WindowBg = 2
GuiStyle.Colors.ChildWindowBg = 3
GuiStyle.Colors.PopupBg = 4
GuiStyle.Colors.Border = 5
GuiStyle.Colors.BorderShadow = 6
GuiStyle.Colors.FrameBg = 7
GuiStyle.Colors.FrameBgHovered = 8
GuiStyle.Col... | apache-2.0 |
ntop/ntopng | scripts/lua/modules/timeseries_info.lua | 1 | 66028 | --
-- (C) 2014-22 - ntop.org
--
local dirs = ntop.getDirs()
package.path = dirs.installdir .. "/scripts/lua/modules/?.lua;" .. package.path
local ts_utils = require "ts_utils_core"
local timeseries_info = {}
-- #################################
local series_extra_info = {
alerts = {
color = '#2d99bd'
},
... | gpl-3.0 |
jasonrudolph/dotfiles | hammerspoon/night-shift.lua | 1 | 1199 | --------------------------------------------------------------------------------
--- Function
--- Toggle Night Shift.
---
--- Depends on https://github.com/smudge/nightlight being installed on the
--- system. To install via homebrew, run:
---
--- $ brew install smudge/smudge/nightlight
---
--- Parameters:
--- * None... | mit |
mamadtnt/um | plugins/Robot.lua | 292 | 1641 | -- Checks if bot was disabled on specific chat
local function is_channel_disabled( receiver )
if not _config.disabled_channels then
return false
end
if _config.disabled_channels[receiver] == nil then
return false
end
return _config.disabled_channels[receiver]
end
local function enable_channel(receiver)
if... | gpl-2.0 |
kristofe/mlskeleton | torch_src/1_data.lua | 1 | 8652 | ----------------------------------------------------------------------
-- This script demonstrates how to load the (SVHN) House Numbers
-- training data, and pre-process it to facilitate learning.
--
-- The SVHN is a typicaly example of supervised training dataset.
-- The problem to solve is a 10-class classification... | mit |
FelixMaxwell/ReDead | gamemode/cl_notice.lua | 1 | 3251 |
local HUDNote_c = 0
local HUDNote_i = 1
local HUDNotes = {}
local NoteQueue = {}
local NextNotify = 0
surface.CreateFont ( "Notice", { size = 18, weight = 500, antialias = true, additive = true, font = "Typenoksidi" } )
function DoNotice( msg )
local str = msg:ReadString()
local r = msg:ReadShort()
local g = msg... | mit |
drandell/btmn | menuOptionsState.lua | 1 | 6553 | --[[
-- Menu options state
-- Handles game options available in main menu
-- Made Afternoon, April 23rd 2014
-- Dan
]]--
menuOptionsState = {}
menuOptionsState.logo = nil;
menuOptionsState.logoPos = { x = 0, y = 0 };
menuOptionsState.options = {
{text = "Master BG Volume:", xOffset = 60, implemented = true, got... | gpl-3.0 |
Bierbuikje/Mr.Green-MTA-Resources | resources/[admin]/admin/client/admin_client.lua | 7 | 6682 | --[[**********************************
*
* Multi Theft Auto - Admin Panel
*
* admin_client.lua
*
* Original File by lil_Toady
*
**************************************]]
_DEBUG = false
_version = '1.3.1'
_root = getRootElement()
_flags = {}
_widgets = {}
_settings = nil
aWeathers = {}
_weathers_max = 0
function aCl... | mit |
Scoth42/rfkasm | fceux-2.2.2-win32/luaScripts/taseditor/InputDisplay_for_Selection.lua | 3 | 2447 | ---------------------------------------------------------------------------
-- Display Input at Selection cursor
-- by AnS, 2012
---------------------------------------------------------------------------
-- Showcases following functions:
-- * taseditor.getselection()
-- * taseditor.getinput()
-------------------------... | gpl-2.0 |
ntop/ntopng | attic/scripts/lua/modules/recipients/recipients.lua | 2 | 2196 | --
-- (C) 2017-21 - ntop.org
--
local json = require "dkjson"
-- ##############################################
local recipients = {}
-- ##############################################
function recipients:create(args)
if args then
-- We're being sub-classed
if not args.key then
return nil
end... | gpl-3.0 |
caohongtao/quick-cocos-demo | src/framework/cc/ui/UIBoxLayout.lua | 19 | 9415 |
--[[
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, di... | apache-2.0 |
phpgao/Atlas | examples/tutorial-scramble.lua | 40 | 1816 | --[[ $%BEGINLICENSE%$
Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
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; version 2 of the
License.
This program is distribut... | gpl-2.0 |
ntop/ntopng | scripts/lua/edit_notification_recipient.lua | 1 | 2513 | --
-- (C) 2019-22 - ntop.org
--
local dirs = ntop.getDirs()
package.path = dirs.installdir .. "/scripts/lua/modules/?.lua;" .. package.path
package.path = dirs.installdir .. "/scripts/lua/modules/pools/?.lua;" .. package.path
package.path = dirs.installdir .. "/scripts/lua/modules/notifications/?.lua;" .. package.path... | gpl-3.0 |
SF-TEAM/SF | bot/seedbot.lua | 180 | 10314 | 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... | agpl-3.0 |
adib1380/BotiSmylife | 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 |
trompetin17/wxFormBuilder-Atlas | build/premake/4.3/src/actions/xcode/xcode_common.lua | 6 | 24416 | --
-- xcode_common.lua
-- Functions to generate the different sections of an Xcode project.
-- Copyright (c) 2009-2010 Jason Perkins and the Premake project
--
local xcode = premake.xcode
local tree = premake.tree
--
-- Return the Xcode build category for a given file, based on the file extension.
--
-- @param no... | gpl-2.0 |
Bierbuikje/Mr.Green-MTA-Resources | resources/[race]/race_delay_indicator/textlib.lua | 3 | 7856 | dxText = {}
dxText_mt = { __index = dxText }
local idAssign,idPrefix = 0,"c"
local g_screenX,g_screenY = guiGetScreenSize()
local visibleText = {}
------
defaults = {
fX = 0.5,
fY = 0.5,
bRelativePosition = true,
strText = "",
bVerticalAlign = "center",
bHorizontalAlign = "center",
tCol... | mit |
caohongtao/quick-cocos-demo | src/framework/cc/ui/UIPageView.lua | 9 | 18458 |
--[[
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, di... | apache-2.0 |
Bierbuikje/Mr.Green-MTA-Resources | resources/[admin]/admin/client/gui/admin_report.lua | 5 | 4162 | --[[**********************************
*
* Multi Theft Auto - Admin Panel
*
* gui\admin_report.lua
*
* Original File by lil_Toady
*
**************************************]]
aReportForm = nil
function aReport ( player )
if ( aReportForm == nil ) then
local x, y = guiGetScreenSize()
aReportForm = guiCreateWindow... | mit |
caohongtao/quick-cocos-demo | src/app/layers/SettingLayer.lua | 1 | 3355 | local SettingLayer = class("SettingLayer", function()
return display.newLayer("SettingLayer")
end)
function SettingLayer:ctor(event)
cc(self):addComponent("components.behavior.EventProtocol"):exportMethods()
local panel = cc.ui.UIImage.new("ui/panel2.png")
:align(display.CENT... | apache-2.0 |
Banderi/OpenTomb | scripts/level/tr3/NEVADA.lua | 2 | 1844 | -- OPENTOMB LEVEL SCRIPT
-- FOR TOMB RAIDER 3, NEVADA.TR2
print("Level script loaded (NEVADA.lua)");
-- STATIC COLLISION FLAGS ------------------------------------------------------
--------------------------------------------------------------------------------
static_tbl[00] = {coll = COLLISION_TYPE_NONE, shape ... | lgpl-3.0 |
rigeirani/a | plugins/autoleave.lua | 16 | 1845 | --[[
Kicking ourself (bot) from unmanaged groups.
When someone invited this bot to a group, the bot then will chek if the group
is in its moderations (moderation.json).
If not, the bot will exit immediately by kicking itself out of that group.
Enable plugin using !plugins plugin. And if your bot already invited into gr... | gpl-2.0 |
mbmahdiiii/m | plugins/LinkPv.lua | 46 | 31163 | do
local function check_member(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[tostring(msg.to.id)] = {
... | gpl-2.0 |
caohongtao/quick-cocos-demo | runtime/ios/PrebuiltRuntimeLua.app/src/cocos/cocos2d/Cocos2d.lua | 37 | 10083 |
cc = cc or {}
function cc.clampf(value, min_inclusive, max_inclusive)
-- body
local temp = 0
if min_inclusive > max_inclusive then
temp = min_inclusive
min_inclusive = max_inclusive
max_inclusive = temp
end
if value < min_inclusive then
return min_inclusive
el... | apache-2.0 |
ntop/ntopng | scripts/lua/get_hosts_stats.lua | 1 | 4728 | --
-- (C) 2013-22 - ntop.org
--
local dirs = ntop.getDirs()
package.path = dirs.installdir .. "/scripts/lua/modules/?.lua;" .. package.path
require "lua_utils"
local json = require "dkjson"
local custom_column_utils = require "custom_column_utils"
local custom_column = _GET["custom_column"]
sendHTTPHeader('applica... | gpl-3.0 |
dangowrt/packages | net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan/memberconfig.lua | 110 | 1317 | -- ------ extra functions ------ --
function cbi_add_interface(field)
uci.cursor():foreach("mwan3", "interface",
function (section)
field:value(section[".name"])
end
)
end
-- ------ member configuration ------ --
dsp = require "luci.dispatcher"
arg[1] = arg[1] or ""
m5 = Map("mwan3", translate("MWAN Membe... | gpl-2.0 |
Scoth42/rfkasm | fceux-2.2.2-win32/luaScripts/SMB-AreaScrambler.lua | 3 | 2464 | --SMB area scrambler
--Randomly changes the level contents. Doesn't garuantee a winnable level (nor does it guarantee it won't crash the game)
--Written by XKeeper
require("x_functions");
if not x_requires then
-- Sanity check. If they require a newer version, let them know.
timer = 1;
while (true) do
timer = t... | gpl-2.0 |
mohammad8/123456 | 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 |
1yvT0s/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 |
neo-umbrella/neo-umbrella | plugins/stats.lua | 25 | 4017 | -- Saves the number of messages from a user
-- Can check the number of messages with !stats
do
local NUM_MSG_MAX = 5
local TIME_CHECK = 4 -- seconds
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.... | gpl-2.0 |
emiln/Protipper | defaults/ProtipperWarlock.lua | 1 | 6420 | if not (UnitClass("player") == "Warlock") then
return
end
Protipper.COOLDOWN_FREE_SPELL["Affliction"] = "Malefic Grasp"
Protipper.SPEC_LIST["Affliction"] = {
preparation = {
{
"Summon Terrorguard",
function(api)
return (not api.Pet().isActive) and
api.Talent("Demonic ... | gpl-3.0 |
graydon/monotone | tests/renaming_a_file/__driver__.lua | 1 | 1858 |
mtn_setup()
writefile("foo", "foo file")
writefile("bleh", "bleh file")
-- produce root
addfile("foo")
commit()
root_r_sha = base_revision()
root_f_sha = sha1("foo")
-- produce move edge
check(mtn("rename", "--bookkeep-only", "foo", "bar"), 0, false, false)
copy("foo", "bar")
commit()
-- revert to root
probe_node(... | gpl-2.0 |
eaufavor/AwesomeWM-powerarrow-dark | extern/vicious/widgets/weather.lua | 1 | 3401 | ---------------------------------------------------
-- Licensed under the GNU General Public License v2
-- * (c) 2010, Adrian C. <anrxc@sysphere.org>
---------------------------------------------------
-- {{{ Grab environment
local tonumber = tonumber
local io = { popen = io.popen }
local setmetatable = setmetatable
... | apache-2.0 |
ntop/ntopng | scripts/lua/rest/v2/delete/flow/alerts.lua | 1 | 1155 | --
-- (C) 2013-22 - ntop.org
--
local dirs = ntop.getDirs()
package.path = dirs.installdir .. "/scripts/lua/modules/?.lua;" .. package.path
package.path = dirs.installdir .. "/scripts/lua/modules/alert_store/?.lua;" .. package.path
local alert_utils = require "alert_utils"
local alert_consts = require "alert_consts"
... | gpl-3.0 |
maikerumine/aftermath | mods/farming/cucumber.lua | 3 | 2215 |
--= Cucumber (Original textures from DocFarming mod)
-- https://forum.minetest.net/viewtopic.php?id=3948
minetest.register_craftitem("farming:cucumber", {
description = "Cucumber",
inventory_image = "farming_cucumber.png",
on_place = function(itemstack, placer, pointed_thing)
return farming.place_seed(itemstack,... | lgpl-2.1 |
eaufavor/AwesomeWM-powerarrow-dark | repetitive/init.lua | 1 | 2359 | local unpack = unpack
local aw_button = require( "awful.button" )
local aw_util = require( "awful.util" )
local aw_key = require( "awful.key" )
local tag = require( "awful.tag" )
local macro = require( "repetitive.macro")
local capi = {timer = timer,root=root,client=client,mouse=mous... | apache-2.0 |
trompetin17/wxFormBuilder-Atlas | build/premake/4.3/src/base/table.lua | 7 | 2374 | --
-- table.lua
-- Additions to Lua's built-in table functions.
-- Copyright (c) 2002-2008 Jason Perkins and the Premake project
--
--
-- Returns true if the table contains the specified value.
--
function table.contains(t, value)
for _,v in pairs(t) do
if (v == value) then
return true
end
end
retu... | gpl-2.0 |
icetoggle/skynet | lualib/http/httpd.lua | 6 | 3688 | local internal = require "http.internal"
local string = string
local type = type
local httpd = {}
local http_status_msg = {
[100] = "Continue",
[101] = "Switching Protocols",
[200] = "OK",
[201] = "Created",
[202] = "Accepted",
[203] = "Non-Authoritative Information",
[204] = "No Content",
[205] = "Reset Con... | mit |
eaufavor/AwesomeWM-powerarrow-dark | repetitive/macro.lua | 1 | 2610 | --local socket = require("socket")
local print = print
local table = table
local capi = {
mousegrabber = mousegrabber,
keygrabber = keygrabber,
timer = timer,
root = root,
mouse = mouse,
}
local module = {}
local buttons = {}
local x = capi.mouse.coords().x
local y = capi.mouse.coords().y
local ... | apache-2.0 |
Bierbuikje/Mr.Green-MTA-Resources | resources/[web]/irc/scripts/runcode/server_util.lua | 4 | 1143 | local rootElement = getRootElement()
function outputConsoleR(message, toElement)
return outputIRC("10"..tostring(message))
end
function outputChatBoxR(message, toElement, forceLog)
return outputIRC("10"..tostring(message))
end
-- dump the element tree
function map(element, outputTo, level)
level = level or 0
e... | mit |
mega9/GTW-RPG | [maps]/GTWcoremap/mapEditorScriptingExtension_s.lua | 6 | 24047 | -- FILE: mapEditorScriptingExtension_s.lua
-- PURPOSE: Prevent the map editor feature set being limited by what MTA can load from a map file by adding a script file to maps
-- VERSION: RemoveWorldObjects (v1) AutoLOD (v1)
local usedLODModels = {}
function onResourceStartOrStop ( )
for _, object in ipairs ( getEleme... | gpl-3.0 |
ntop/ntopng | scripts/lua/http_status_code.lua | 2 | 1728 | --
-- (C) 2020 - ntop.org
--
-- This page shows the HTTP errors that a user can get
-- example: 404, 403, ...
dirs = ntop.getDirs()
package.path = dirs.installdir .. "/scripts/lua/modules/?.lua;" .. package.path
require("lua_utils")
local page_utils = require("page_utils")
local message = _GET["message"] or "... | gpl-3.0 |
Choonster/luabnet_tools | lua/bnet/tools/external/plfuncs.lua | 1 | 2202 | -- This is a subset of functions from the Penlight modules pl.app and pl.path modified so that they don't depend on LuaFileSystem.
-- Penlight's licence (the MIT licence) is included below.
--[[
Copyright (C) 2009 Steve Donovan, David Manura.
Permission is hereby granted, free of charge, to any person obtaining a cop... | mit |
Brajanowski/Behind-Society | assets/gameplay/main_menu.lua | 1 | 10299 | MainMenu = {}
local credits_timer = 0.0
local current_tab = "Main"
local new_game_tab = "Name"
local temp_volume = 0.0
local abode_in_background = 0
local current_res = 1
local preview_slot = -1
local credits = {}
MainMenu.Init = function()
for line in io.lines("./assets/credits.txt") do
credits[#credits + 1]... | apache-2.0 |
Noneatme/MTA-NFS | client/CSoundManager.lua | 1 | 4342 | -- ###############################
-- ## Project: MTA:Speedrace ##
-- ## Name: SoundManager ##
-- ## Author: Noneatme ##
-- ## Version: 1.0 ##
-- ## License: See top Folder ##
-- ###############################
-- FUNCTIONS / METHODS --
local cFunc = {}; -- Local Functions
local cSetting = {}; -- Local Settin... | mit |
longmian/skynet | lualib/socketchannel.lua | 7 | 8236 | local skynet = require "skynet"
local socket = require "socket"
local socketdriver = require "socketdriver"
-- channel support auto reconnect , and capture socket error in request/response transaction
-- { host = "", port = , auth = function(so) , response = function(so) session, data }
local socket_channel = {}
loca... | mit |
solid021/TeleBeyond | plugins/help_en.lua | 4 | 3778 | do
function run(msg, matches)
if msg.to.type == 'chat' and is_momod(msg) then
return 'Tele Beyond Command List'..[[
❤لیست دستورات💙:
🔴kick [آیدی،یوزر،ریپلی]
🔹شخص مورد نظر از گروه اخراج ميشود. ☑️
🔴ban [آیدی،یوزر،ریپلی]
🔹شخص مورد نظر از گروه محروم میشود ☑️
🔴unban [آیدی،یوزر،ریپلی]
🔹شخص مورد نظر از محرومیت خا... | gpl-2.0 |
Bierbuikje/Mr.Green-MTA-Resources | resources/[race]/race/countdown.lua | 4 | 4971 | Countdown = {}
function Countdown:__index(k)
if Countdown[k] then
return Countdown[k]
end
if k == 'client' then
self.client = { hooks = {} }
return self.client
end
end
Countdown.instances = {}
Countdown.clientinstances = {}
function Countdown.create(start, endFunction, text, r, g, b, ypos, scale, bSingleLin... | mit |
Arashbrsh/copymer | plugins/greeter.lua | 21 | 4109 | --[[
Sends a custom message when a user enters or leave a chat.
!welcome group
The custom message will send to the group. Recommended way.
!welcome pm
The custom message will send to private chat newly joins member.
Not recommended as a privacy concern and the possibility of user reporting the bot.
!welcome disable
... | gpl-2.0 |
huangleiBuaa/CenteredWN | module/NormLinear_new.lua | 1 | 11236 | --[[
----This file implements natural neural network based on the paper:https://arxiv.org/abs/1507.00210
----
--Only for 2D input used in MLP architecture.
----
---------------------------------------------------------------------
----Author: Lei Huang
----mail: huanglei@nlsde.buaa.edu.cn
-----
----]]
--]]
local Nor... | bsd-2-clause |
deveNovar/DEveNovar | plugins/addsudo.lua | 2 | 1728 |
local function getindex(t,id)
for i,v in pairs(t) do
if v == id then
return i
end
end
return nil
end
function reload_plugins( )
plugins = {}
load_plugins()
end
function run(msg, matches)
if tonumber (msg.from.id) == 373906612 then
if matches[1]:lower() == "اضف مطور" then
tab... | gpl-2.0 |
ntop/ntopng | scripts/lua/modules/alert_definitions/flow/alert_ndpi_dns_fragmented.lua | 1 | 1114 | --
-- (C) 2019-22 - ntop.org
--
-- ##############################################
local flow_alert_keys = require "flow_alert_keys"
-- Import the classes library.
local classes = require "classes"
-- Make sure to import the Superclass!
local alert = require "alert"
-- ##############################################
... | gpl-3.0 |
nimaghorbani/nimabot | 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 |
eagle14/telesnippy | 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 |
v1993/cocos2d-x-lua-i18n | cocos2d-x-test/src/tests/menu.lua | 1 | 2884 | local tests = {
{name = 'test1', path = 'tests.test1'};
{name = 'test2', path = 'tests.test2'};
}
local ci18n = require 'cocos-i18n'
local LINE_SPACE = 40
local s = cc.Director:getInstance():getWinSize()
local TESTS_COUNT = #tests
local sc = cc.Scene:create()
local menuNode = cc.Node:create()
sc:addChild(menuNode... | mit |
RockySeven3161/Unknown8765 | 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 |
shayanchabok007/antispam_ok_new | plugins/boobs.lua | 1 | 1738 | do
— Recursive function
local function getRandomButts(attempt)
attempt = attempt or 0
attempt = attempt + 1
local res,status = http.request("http://api.obutts.ru/noise/1")
if status ~= 200 then return nil end
local data = json:decode(res)[1]
— The OpenBoobs API sometimes returns an empty array
if not ... | gpl-2.0 |
vikas17a/Algorithm-Implementations | Bellman_Ford_Search/Lua/Yonaba/bellmanford_test.lua | 26 | 1717 | -- Tests for dijkstra.lua
local BellmanFord = require 'bellmanford'
local total, pass = 0, 0
local function dec(str, len)
return #str < len
and str .. (('.'):rep(len-#str))
or str:sub(1,len)
end
local function same(t, p, comp)
for k,v in ipairs(t) do
if not comp(v, p[k]) then return false end
en... | mit |
cere-bro/telegram-bot | plugins/xkcd.lua | 628 | 1374 | do
function get_last_id()
local res,code = https.request("http://xkcd.com/info.0.json")
if code ~= 200 then return "HTTP ERROR" end
local data = json:decode(res)
return data.num
end
function get_xkcd(id)
local res,code = http.request("http://xkcd.com/"..id.."/info.0.json")
if code ~= 200 then return "HT... | gpl-2.0 |
ntop/ntopng | scripts/lua/modules/check_definitions/interface/throughput.lua | 1 | 1808 | --
-- (C) 2019-22 - ntop.org
--
local alerts_api = require("alerts_api")
local alert_consts = require("alert_consts")
local checks = require("checks")
local script = {
-- Script category
category = checks.check_categories.network,
default_enabled = false,
default_value = {
-- "> 5%"
operator = "gt",... | gpl-3.0 |
graydon/monotone | tests/netsync_permissions/__driver__.lua | 1 | 4491 |
include("/common/netsync.lua")
mtn_setup()
keys = {}
revs = {}
-- generate a new key
function genkey(keyname, mt)
if mt == nil then mt = mtn end
check(mt("genkey", keyname), 0, false, false, string.rep(keyname.."\n", 2))
end
keys.other = "other@test.net"
genkey(keys.other)
netsync.setup()
-- test with open sec... | gpl-2.0 |
shironecko/LuaMaze | source/maze/generators/hunt_and_kill.lua | 1 | 1669 | -- Hunt and kill algorithm
-- Detailed description: http://weblog.jamisbuck.org/2011/1/24/maze-generation-hunt-and-kill-algorithm
local random = math.random
local function hunt_and_kill(maze)
maze:ResetDoors(true)
maze[1][1].visited = true
-- these will track last hunt position and free us of need to traverse... | mit |
caohongtao/quick-cocos-demo | src/framework/cc/utils/ByteArray.lua | 21 | 11042 | --[[
Serialzation bytes stream like ActionScript flash.utils.ByteArray.
It depends on lpack.
A sample: https://github.com/zrong/lua#ByteArray
@see http://underpop.free.fr/l/lua/lpack/
@see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/utils/ByteArray.html
@author zrong(zengrong.net)
Creatio... | apache-2.0 |
cis542/VR_Wall | PongGame2/glsdk/links.lua | 5 | 1688 | local thisDirectory = os.getcwd();
local LinkFuncs =
{
glload = function()
includedirs "glload/include"
libdirs "glload/lib"
configuration "Debug"
links {"glloadD"}
configuration "Release"
links {"glload"}
end,
glimage = function()
includedirs "glimg/include"
libdirs "glimg/lib"
configuration... | epl-1.0 |
cfromknecht/GRing | third_party/glsdk/links.lua | 5 | 1688 | local thisDirectory = os.getcwd();
local LinkFuncs =
{
glload = function()
includedirs "glload/include"
libdirs "glload/lib"
configuration "Debug"
links {"glloadD"}
configuration "Release"
links {"glload"}
end,
glimage = function()
includedirs "glimg/include"
libdirs "glimg/lib"
configuration... | mit |
shangjiyu/openwrt-extra | luci/applications/luci-app-epg-oscam/luasrc/model/cbi/sattv/oscam.lua | 1 | 1522 | --[[
LuCI - Lua Configuration Interface
Copyright 2011 flyzjhz <flyzjhz@gmail.com>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
]]--
local fs ... | gpl-2.0 |
Bierbuikje/Mr.Green-MTA-Resources | resources/[gameplay]/privateMessaging/server.lua | 3 | 2109 | local delay = {}
local min_delay = 500
local g_PlayersRefuse = {}
addCommandHandler('messages',
function(player)
g_PlayersRefuse[player] = not g_PlayersRefuse[player]
outputChatBox("Private messaging has been turned "..(g_PlayersRefuse[player] and 'off' or 'on').." for you!", player, 255, 0, 0)
... | mit |
RadioactiveMonkey/InflateGame | Inflate/deathscreen.lua | 1 | 2457 | class = require 'middleclass'
DeathScreen = class('DeathScreen')
function DeathScreen:initialize()
self.TitlePosition = Vector2:new( XCenter - XScreen / 3 , YCenter - YScreen / 2.5 )
self.InstructionPosition = Vector2:new( 0 , YCenter + YScreen / 4 )
self.StatPosition = Vector2:new( 0 , YCenter - YScreen / 6 )
s... | mit |
weloxux/ludumdare-34 | lib/sick.lua | 1 | 1234 | -- SICK: Simple Indicative of Competitive sKill
-- aka libhighscore
local h = {}
h.scores = {}
function h.set(filename, places, name, score)
h.filename = filename
h.places = places
if not h.load() then
h.scores = {}
for i = 1, places do
h.scores[i] = {score, name}
end
end
end
function h.load()
local fil... | gpl-3.0 |
mohammad8/123456 | plugins/exchange.lua | 352 | 2076 | local ltn12 = require "ltn12"
local https = require "ssl.https"
-- Edit data/mashape.lua with your Mashape API key
-- http://docs.mashape.com/api-keys
local function comma_value(n) -- credit http://richard.warburton.it
local left,num,right = string.match(n,'^([^%d]*%d)(%d*)(.-)$')
return left..(num:reverse():gsub('... | gpl-2.0 |
sdw2330976/luaer | src/resty/logger.lua | 1 | 2220 | --module("resty.logger", package.seeall)
--[[
collect from https://github.com/dcshi/lua-resty-Logger
How to use
local logger = require("resty.logger");
logger.debug("i am debug"); --for debug
logger.info("i am info"); --for info
logger.error("i am error"); --for error
]]--
local bit = require "bit"
local ffi = requir... | apache-2.0 |
Bierbuikje/Mr.Green-MTA-Resources | resources/[gameplay]/sc-musicplayer/server.lua | 4 | 7882 |
-- SEARCH CURL = http://api.soundcloud.com/tracks.json?q=QUERY&streamable=true&limit=10&client_id=e796074ad95696e84774e2eaa0c78369
searchFetcherURL = "http://mrgreengaming.com/stuff/SoundCloudFetcher/searchFetch.php" -- the URL to the php page with cURL code to fetch song info --
clientID = "e796074ad95696e84774e2eaa... | mit |
longmian/skynet | lualib/socket.lua | 15 | 8240 | local driver = require "socketdriver"
local skynet = require "skynet"
local skynet_core = require "skynet.core"
local assert = assert
local socket = {} -- api
local buffer_pool = {} -- store all message buffer object
local socket_pool = setmetatable( -- store all socket object
{},
{ __gc = function(p)
for id,v in ... | mit |
lizh06/premake-4.x | src/actions/make/make_cpp.lua | 3 | 9915 | --
-- make_cpp.lua
-- Generate a C/C++ project makefile.
-- Copyright (c) 2002-2013 Jason Perkins and the Premake project
--
premake.make.cpp = { }
local cpp = premake.make.cpp
local make = premake.make
function premake.make_cpp(prj)
-- create a shortcut to the compiler interface
local cc = premake.gettool(p... | bsd-3-clause |
caohongtao/quick-cocos-demo | runtime/mac/PrebuiltRuntimeLua.app/Contents/Resources/src/cocos/cocos2d/Cocos2dConstants.lua | 35 | 15728 |
cc = cc or {}
cc.SPRITE_INDEX_NOT_INITIALIZED = 0xffffffff
cc.TMX_ORIENTATION_HEX = 0x1
cc.TMX_ORIENTATION_ISO = 0x2
cc.TMX_ORIENTATION_ORTHO = 0x0
cc.Z_COMPRESSION_BZIP2 = 0x1
cc.Z_COMPRESSION_GZIP = 0x2
cc.Z_COMPRESSION_NONE = 0x3
cc.Z_COMPRESSION_ZLIB = 0x0
cc.BLEND_DST = 0x303
cc.BLEND_SRC = 0x1... | apache-2.0 |
James226/track-master | TrackMaster/Libs/LibBusted-2.0/LibBusted-2.0.lua | 1 | 13089 | local MAJOR,MINOR = "Lib:Busted-2.0", 5
-- Get a reference to the package information if any
local APkg = Apollo.GetPackage(MAJOR)
-- If there was an older version loaded we need to see if this is newer
if APkg and (APkg.nVersion or 0) >= MINOR then
return -- no upgrade needed
end
-- Set a reference to the actual p... | gpl-2.0 |
jonathantompson/jtorch | lua/save_spatial_convolution_map_node.lua | 1 | 1100 | function jtorch._saveSpatialConvolutionMapNode(node, ofile)
-- The layout is as follows:
-- 1. filter width (int)
-- 2. filter height (int)
-- 3. filter input features (int)
-- 4. filter output features (int)
-- 5. filter fan in (int)
-- 6. filter weights (float array)
-- 7. filter connection table (sh... | bsd-2-clause |
ophal/core | includes/database/init.lua | 1 | 1205 | dbh = {} -- Database handlers
local DBI, db_id, drivers = require 'DBI', 'default', {}
function db_set_db_id(id)
db_id = id
end
function db_connect()
local err, driver
local connection = settings.db[db_id]
if connection == nil then return end
if not connection.autocommit then connection.autocommit = true... | agpl-3.0 |
telematin/telematinweb | bot/seedbot.lua | 9 | 10246 | 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 = '1.0'
-- This function is called when tg receive a msg
function on_msg_receive (msg)
if not started then
retu... | gpl-2.0 |
FelixMaxwell/ReDead | entities/entities/sent_dropflare/cl_init.lua | 1 | 1574 | include('shared.lua')
function ENT:Initialize()
self.Emitter = ParticleEmitter( self.Entity:GetPos() )
self.Smoke = 0
end
function ENT:OnRemove()
if self.Emitter then
self.Emitter:Finish()
end
end
function ENT:Think()
if self.Entity:GetNWFloat( "BurnDelay", 9000 ) > CurTime() then return end
if... | mit |
ntop/ntopng | scripts/lua/modules/datamodel/heatmap.lua | 1 | 2482 | --
-- (C) 2019-22 - ntop.org
--
local dirs = ntop.getDirs()
package.path = dirs.installdir .. "/scripts/lua/modules/?.lua;" .. package.path
package.path = dirs.installdir .. "/scripts/lua/modules/datamodel/?.lua;" .. package.path
-- ##############################################
-- Import the classes library.
local ... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.