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 |
|---|---|---|---|---|---|
ahua/redis | deps/lua/test/sort.lua | 889 | 1494 | -- two implementations of a sort function
-- this is an example only. Lua has now a built-in function "sort"
-- extracted from Programming Pearls, page 110
function qsort(x,l,u,f)
if l<u then
local m=math.random(u-(l-1))+l-1 -- choose a random pivot in range l..u
x[l],x[m]=x[m],x[l] -- swap pivot to first posit... | bsd-3-clause |
cburlacu/packages | net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan/ruleconfig.lua | 82 | 4185 | -- ------ extra functions ------ --
function ruleCheck() -- determine if rule needs a protocol specified
local sourcePort = ut.trim(sys.exec("uci -p /var/state get mwan3." .. arg[1] .. ".src_port"))
local destPort = ut.trim(sys.exec("uci -p /var/state get mwan3." .. arg[1] .. ".dest_port"))
if sourcePort ~= "" or d... | gpl-2.0 |
Bew78LesellB/awesome | lib/awful/button.lua | 7 | 2130 | ---------------------------------------------------------------------------
--- Create easily new buttons objects ignoring certain modifiers.
--
-- @author Julien Danjou <julien@danjou.info>
-- @copyright 2009 Julien Danjou
-- @classmod awful.button
----------------------------------------------------------------... | gpl-2.0 |
ToFran/ComputercraftPrograms | RainbowTreeChopper.lua | 1 | 6075 | --Rainbow Tree Farm [RTC] - Computer Craft Mining Turtles Program
--Post (info & stuff): http://www.computercraft.info/forums2/index.php?/topic/20411-rainbow-tree-farm-program-rtc/
--by ToFran
local function DigAndForward(times)
times = times or 1
for i = 1,times do
turtle.dig()
turtle.forward()
end
end
l... | mit |
seem-sky/FrameworkBenchmarks | lapis/web.lua | 2 | 5594 | local lapis = require("lapis")
local db = require("lapis.db")
local Model
do
local _obj_0 = require("lapis.db.model")
Model = _obj_0.Model
end
local config
do
local _obj_0 = require("lapis.config")
config = _obj_0.config
end
local insert
do
local _obj_0 = table
insert = _obj_0.insert
end
local sort
do
loc... | bsd-3-clause |
avr-aics-riken/hpcpfGUI | lib/excase.lua | 1 | 3790 |
local excase = {}
function generateTargetConf(args_table)
for i, k in pairs(args_table) do
--print(i, k);
if (i == 1) and next(k) then
for n, m in pairs(k) do
--print(n, m);
if n == "machine" then
return m;
end
end
end
end
end
function getProcs(args_table)
for i, k in pairs(args_table... | bsd-2-clause |
Anarchid/Zero-K | LuaUI/Widgets/chili/Skins/Robocracy/skin.lua | 8 | 6393 | --// =============================================================================
--// Skin
local skin = {
info = {
name = "Robocracy",
version = "0.3",
author = "jK",
}
}
--// =============================================================================
--//
skin.general = {
focusColor = {1.0, 0.7, 0... | gpl-2.0 |
nnesse/b2l-tools | lgi/samples/gtk-demo/demo-dialogs.lua | 6 | 3451 | return function(parent, dir)
local lgi = require 'lgi'
local GObject = lgi.GObject
local Gtk = lgi.Gtk
local Gdk = lgi.Gdk
local GdkPixbuf = lgi.GdkPixbuf
local window = Gtk.Window {
title = "Dialogs",
border_width = 8,
Gtk.Frame {
label = "Dialogs",
Gtk.Box {
orientation = 'VERTICAL',
border... | gpl-2.0 |
Anarchid/Zero-K | LuaRules/Gadgets/unit_mex_overdrive.lua | 4 | 65272 | -- $Id: unit_mex_overdrive.lua 4550 2009-05-05 18:07:29Z licho $
-------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------
if not (gadgetHandler:IsSyncedCode()) then
return
end
--------------------------... | gpl-2.0 |
Anarchid/Zero-K | units/fakeunit_aatarget.lua | 4 | 1533 | return { fakeunit_aatarget = {
unitname = [[fakeunit_aatarget]],
name = [[Fake AA target]],
description = [[Used by the jumpjet script.]],
acceleration = 0,
activateWhenBuilt = false,
brakeRate = 0,
buildCostEnergy = 0.45,
buildCostM... | gpl-2.0 |
taha560/ir | libs/serpent.lua | 656 | 7877 | local n, v = "serpent", 0.28 -- (C) 2012-15 Paul Kulchenko; MIT License
local c, d = "Paul Kulchenko", "Lua serializer and pretty printer"
local snum = {[tostring(1/0)]='1/0 --[[math.huge]]',[tostring(-1/0)]='-1/0 --[[-math.huge]]',[tostring(0/0)]='0/0'}
local badtype = {thread = true, userdata = true, cdata = true}
lo... | gpl-2.0 |
NUTIEisBADYT/NUTIEisBADYTS-PD2-Modpack | Full Speed Swarm/lua/blt_keybinds_manager.lua | 1 | 3089 | function BLTKeybind:_SetKey(idx, key)
if not idx then
return false
end
if key == '' then
self._key.idstring = nil
self._key.input = nil
elseif string.find(key, 'mouse ') == 1 then
self._key.idstring = Idstring(key:sub(7))
self._key.input = Input:mouse()
else
self._key.idstring = Idstring(key)
self._... | mit |
jerizm/kong | kong/tools/timestamp.lua | 2 | 2046 | --- Module for timestamp support.
-- Based on the LuaTZ module.
-- @copyright Copyright 2016 Mashape Inc. All rights reserved.
-- @license [Apache 2.0](https://opensource.org/licenses/Apache-2.0)
-- @module kong.tools.timestamp
local luatz = require "luatz"
local _M = {}
--- Current UTC time
-- @return UTC time
funct... | apache-2.0 |
jerizm/kong | kong/plugins/response-ratelimiting/dao/postgres.lua | 4 | 1591 | local PostgresDB = require "kong.dao.postgres_db"
local timestamp = require "kong.tools.timestamp"
local fmt = string.format
local concat = table.concat
local _M = PostgresDB:extend()
_M.table = "response_ratelimiting_metrics"
_M.schema = require("kong.plugins.response-ratelimiting.schema")
function _M:increment(api... | apache-2.0 |
vincent178/dotfiles | .config/nvim/lua/keymap.lua | 1 | 3467 | -- use vim.keymap.set instead of vim.api.nvim_set_keymap, check more in https://github.com/neovim/neovim/commit/6d41f65aa45f10a93ad476db01413abaac21f27d
local noremap = { noremap = true }
local noremapsilent = { noremap = true, silent = true }
-- Save and exit
vim.keymap.set('n', '<Leader>w', ':w<CR>', noremap)
vim.k... | mit |
Mutos/StarsOfCall-NAEV | dat/events/start.lua | 1 | 10053 | -- Prepare variables
startupSystem = "Ek'In"
menuTitle = {}
menuComment = {}
menuText = {}
menuOptions = {}
ridiculousMoney = 100000000
-- localization stuff, translators would work here
lang = naev.lang()
if lang == "es" then
else -- default english
-- Character species menu
menuTitle ["Species"] = "Ch... | gpl-3.0 |
Sannis/tarantool | test/box/fiber.test.lua | 6 | 8503 | fiber = require('fiber')
space = box.schema.space.create('tweedledum')
index = space:create_index('primary', { type = 'hash' })
-- A test case for a race condition between ev_schedule
-- and wal_schedule fiber schedulers.
-- The same fiber should not be scheduled by ev_schedule (e.g.
-- due to cancellation) if it is wi... | bsd-2-clause |
PichotM/DarkRP | gamemode/modules/afk/sv_interface.lua | 6 | 2208 | DarkRP.hookStub{
name = "playerAFKDemoted",
description = "When a player is demoted for being AFK.",
parameters = {
{
name = "ply",
description = "The player being demoted.",
type = "Player"
}
},
returns = {
{
name = "shouldDemo... | mit |
wesnoth/wesnoth | data/campaigns/World_Conquest/lua/map/postgeneration/6B_Maritime.lua | 7 | 10147 | -- Maritime
local images = {
dock_ship = "misc/blank-hex.png~BLIT(units/transport/boat.png~CROP(0,15,72,57))",
dock_ship_2 = "misc/blank-hex.png~BLIT(units/transport/boat.png~FL()~CROP(0,15,72,57))"
}
function get_possible_maritime_bridge()
return {
{
type = "Bsb|",
locs = map:find(f.all(
f.terrain("Ww"... | gpl-2.0 |
Whit3Tig3R/bestspammbot2 | plugins/rss.lua | 700 | 5434 | local function get_base_redis(id, option, extra)
local ex = ''
if option ~= nil then
ex = ex .. ':' .. option
if extra ~= nil then
ex = ex .. ':' .. extra
end
end
return 'rss:' .. id .. ex
end
local function prot_url(url)
local url, h = string.gsub(url, "http://", "")
local... | gpl-2.0 |
amircheshme/megatron | plugins/rss.lua | 700 | 5434 | local function get_base_redis(id, option, extra)
local ex = ''
if option ~= nil then
ex = ex .. ':' .. option
if extra ~= nil then
ex = ex .. ':' .. extra
end
end
return 'rss:' .. id .. ex
end
local function prot_url(url)
local url, h = string.gsub(url, "http://", "")
local... | gpl-2.0 |
githubmereza/creed_plug | plugins/welcome.lua | 190 | 3526 | 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 |
Anarchid/Zero-K | LuaRules/Gadgets/unit_jugglenaut_juggle.lua | 5 | 9027 | function gadget:GetInfo()
return {
name = "Old Jugglenaut Juggle",
desc = "Implementes special weapon Juggling for Old Jugglenaut",
author = "Google Frog",
date = "1 April 2011",
license = "GNU GPL, v2 or later",
layer = 0,
enabled = false -- loaded by default?
... | gpl-2.0 |
ivendrov/nn | MM.lua | 46 | 2695 | --[[ Module to perform matrix multiplication on two minibatch inputs,
producing a minibatch.
]]
local MM, parent = torch.class('nn.MM', 'nn.Module')
--[[ The constructor takes two optional arguments, specifying whether or not transpose
any of the input matrices before perfoming the multiplication.
]]
functi... | bsd-3-clause |
Anarchid/Zero-K | scripts/factoryjump.lua | 4 | 3028 | include "constants.lua"
local spGetUnitTeam = Spring.GetUnitTeam
--------------------------------------------------------------------------------
-- pieces
--------------------------------------------------------------------------------
local base, center1, center2, side1, side2, pad = piece('base', 'center1', 'cente... | gpl-2.0 |
Anarchid/Zero-K | LuaRules/Configs/MetalSpots/BlackStar.lua | 8 | 3040 | return {
spots = {
{x = 4136, z = 7528, metal = 1.5},
{x = 3944, z = 7528, metal = 1.5},
{x = 2360, z = 6568, metal = 1.5},
{x = 1864, z = 1192, metal = 1.5},
{x = 648, z = 5192, metal = 1.5},
{x = 5768, z = 6616, me... | gpl-2.0 |
alexandrebarachant/openvibe | applications/demos/motor-imagery/bci-examples/motor-imagery/motor-imagery-bci-graz-stimulator.lua | 4 | 2314 |
function initialize(box)
dofile(box:get_config("${Path_Data}") .. "/plugins/stimulation/lua-stimulator-stim-codes.lua")
number_of_trials = box:get_setting(2)
first_class = _G[box:get_setting(3)]
second_class = _G[box:get_setting(4)]
baseline_duration = box:get_setting(5)
wait_for_beep_duration = box:get_settin... | agpl-3.0 |
Insurgencygame/LivingDead | TheLivingDeadv0.1.sdd/units/unused/armsam.lua | 1 | 3345 | return {
armsam = {
acceleration = 0.039599999785423,
airsightdistance = 800,
brakerate = 0.016499999910593,
buildcostenergy = 2027,
buildcostmetal = 140,
buildpic = "ARMSAM.DDS",
buildtime = 2945,
canmove = true,
category = "ALL TANK MOBILE WEAPON NOTSUB NOTSHIP NOTAIR NOTHOVER SURFACE",
corpse = ... | gpl-2.0 |
Anarchid/Zero-K | LuaUI/Configs/unit_state_defaults.lua | 6 | 1493 | local alwaysHoldPos = {
[UnitDefNames["spidercrabe"].id] = true,
[UnitDefNames["vehsupport"].id] = true,
[UnitDefNames["tankheavyarty"].id] = true,
}
local holdPosException = {
[UnitDefNames["staticcon"].id] = true,
}
local dontFireAtRadarUnits = {
[UnitDefNames["cloaksnipe"].id] = true,
[UnitDefNames["ho... | gpl-2.0 |
Bew78LesellB/awesome | tests/test-awful-layout.lua | 10 | 4027 | -- This test hit the client layout code paths to see if there is errors.
-- it doesn't check if the layout are correct.
local awful = require("awful")
local gtable = require("gears.table")
local first_layout = nil
local t = nil
local has_spawned = false
local steps = {
-- Add enough clients
function(count... | gpl-2.0 |
punisherbot/ma | plugins/all.lua | 1321 | 4661 | do
data = load_data(_config.moderation.data)
local function get_msgs_user_chat(user_id, chat_id)
local user_info = {}
local uhash = 'user:'..user_id
local user = redis:hgetall(uhash)
local um_hash = 'msgs:'..user_id..':'..chat_id
user_info.msgs = tonumber(redis:get(um_hash) or 0)
user_info.name = user_print... | gpl-2.0 |
mahdib9/mjk | plugins/all.lua | 1321 | 4661 | do
data = load_data(_config.moderation.data)
local function get_msgs_user_chat(user_id, chat_id)
local user_info = {}
local uhash = 'user:'..user_id
local user = redis:hgetall(uhash)
local um_hash = 'msgs:'..user_id..':'..chat_id
user_info.msgs = tonumber(redis:get(um_hash) or 0)
user_info.name = user_print... | gpl-2.0 |
OmarReaI/RealBot | plugins/all.lua | 1321 | 4661 | do
data = load_data(_config.moderation.data)
local function get_msgs_user_chat(user_id, chat_id)
local user_info = {}
local uhash = 'user:'..user_id
local user = redis:hgetall(uhash)
local um_hash = 'msgs:'..user_id..':'..chat_id
user_info.msgs = tonumber(redis:get(um_hash) or 0)
user_info.name = user_print... | gpl-2.0 |
Anarchid/Zero-K | scripts/jumpcon.lua | 4 | 19729 | include "constants.lua"
include "JumpRetreat.lua"
local jump = piece 'jump'
local torso = piece 'torso'
local flare = piece 'flare'
local pelvis = piece 'pelvis'
local rcalf = piece 'rcalf'
local lcalf = piece 'lcalf'
local lthigh = piece 'lthigh'
local rthigh = piece 'rthigh'
local larm = piece 'larm'
local rarm = pi... | gpl-2.0 |
poculeka/IntWars | BinWars/Scripts/Heroes/Karthus.lua | 4 | 4297 | --[[
NotSingleTargetSpell = true
DoesntBreakShields = true
DoesntTriggerSpellCasts = false
CastingBreaksStealth = true
IsDamagingSpell = true
local R1 = {Function = BBPreloadParticle}
R1["Params"] = {Name = 'laywaste_point.troy'} --R2 = {} / R2["Name"] = "laywaste_point.troy" / R1["Params"] = R2
local R2 = {Function ... | gpl-3.0 |
MinaciousGrace/Til-Death | Scripts/00 settings_system.lua | 2 | 6485 | local settings_prefix= "/" .. THEME:GetThemeDisplayName() .. "_settings/"
global_cur_game= GAMESTATE:GetCurrentGame():GetName():lower()
function force_table_elements_to_match_type(candidate, must_match, depth_remaining)
for k, v in pairs(candidate) do
if type(must_match[k]) ~= type(v) then
candidate[k]= nil
el... | mit |
samtaylorblack/black | plugins/mutetime.lua | 1 | 1315 |
local function pre_process(msg)
local hash = 'mute_time:'..msg.chat_id_
if redis:get(hash) and gp_type(msg.chat_id_) == 'channel' and not is_admin(msg) then
tdcli.deleteMessages(msg.chat_id_, {[0] = tonumber(msg.id_)})
end
end
local function run(msg, matches)
if matches[1]:lower() == 'mt' and is_admin(... | gpl-3.0 |
Insurgencygame/LivingDead | TheLivingDeadv0.1.sdd/lups/headers/mathenv.lua | 15 | 3508 | -- $Id: mathenv.lua 3345 2008-12-02 00:03:50Z jk $
---------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------
--
-- file: mathenv.lua
-- brief: parses and processes custom lups effects... | gpl-2.0 |
LanceJenkinZA/prosody-modules | mod_auth_external/mod_auth_external.lua | 31 | 4708 | --
-- Prosody IM
-- Copyright (C) 2010 Waqas Hussain
-- Copyright (C) 2010 Jeff Mitchell
-- Copyright (C) 2013 Mikael Nordfeldth
-- Copyright (C) 2013 Matthew Wild, finally came to fix it all
--
-- This project is MIT/X11 licensed. Please see the
-- COPYING file in the source package for more information.
--
local lpt... | mit |
Ractis/HookAndSlice | scripts/vscripts/DotaHS_MissionManager_CustomLevel.lua | 1 | 5823 |
require( "DotaHS_Common" )
require( "DotaHS_ItemManager" )
require( "DotaHS_GridNavMap" )
require( "DotaHS_SpawnManager" )
require( "DotaHS_SpawnDirector" )
--------------------------------------------------------------------------------
if MissionManager_CustomLevel == nil then
MissionManager_CustomLevel = class({}... | mit |
mnemnion/grym | lib/pl/List.lua | 1 | 15794 | --- Python-style list class.
--
-- **Please Note**: methods that change the list will return the list.
-- This is to allow for method chaining, but please note that `ls = ls:sort()`
-- does not mean that a new copy of the list is made. In-place (mutable) methods
-- are marked as returning 'the list' in this documentati... | mit |
Anarchid/Zero-K | LuaUI/Widgets/unit_marker.lua | 4 | 4339 | function widget:GetInfo() return {
name = "Unit Marker Zero-K",
desc = "[v1.3.10] Marks spotted buildings of interest and commander corpse.",
author = "Sprung",
date = "2015-04-11",
license = "GNU GPL v2",
layer = -1,
enabled = true,
} end
local knownUnits = {}
local unitList = {}
local markingActi... | gpl-2.0 |
futzle/MiOS-CombinationSwitch | L_CombinationSwitch1Plugin_WeatherCondition.lua | 1 | 3849 | module ("L_CombinationSwitch1Plugin_WeatherCondition", package.seeall)
local MAIN
local WEATHER_SERVICE_ID = "urn:upnp-micasaverde-com:serviceId:Weather1"
local WEATHER_VARIABLE_CONDITION = "Condition"
local INDEX_SWITCH_DEVICE_ID = "DeviceId"
local INDEX_SWITCH_CONDITION = "MatchCondition"
function initialize(main... | gpl-2.0 |
chukong/sdkbox-facebook-sample-v2 | samples/Lua/TestLua/Resources/luaScript/LayerTest/LayerTest.lua | 6 | 22631 | local scheduler = CCDirector:sharedDirector():getScheduler()
local kTagLayer = 1
local function createLayerDemoLayer(title, subtitle)
local layer = CCLayer:create()
Helper.initWithLayer(layer)
local titleStr = title == nil and "No title" or title
local subTitleStr = subtitle == nil and "" or subtitle
... | mit |
omid1212/telsed2 | plugins/owners.lua | 68 | 12477 |
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 |
Anarchid/Zero-K | LuaUI/Widgets/api_lag_monitor.lua | 6 | 4640 | --------------------------------------------------------------------------------
--------------------------------------------------------------------------------
function widget:GetInfo()
return {
name = "Lag (AFK) monitor",
desc = "Monitors user presses and mouse moves",
author = "Licho",
date ... | gpl-2.0 |
hfjgjfg/sy | plugins/admin.lua | 230 | 6382 | 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 |
Anarchid/Zero-K | LuaUI/Widgets/chili/Skins/Carbon/skin.lua | 8 | 5888 | --// =============================================================================
--// Skin
local skin = {
info = {
name = "Carbon",
version = "1.0",
author = "luckywaldo7",
}
}
--// =============================================================================
--//
skin.general = {
focusColor = {0.0, ... | gpl-2.0 |
rollasoul/HaikuDenseCap | eval/eval_utils.lua | 4 | 10674 |
local cjson = require 'cjson'
local utils = require 'densecap.utils'
local box_utils = require 'densecap.box_utils'
local eval_utils = {}
--[[
Evaluate a DenseCapModel on a split of data from a DataLoader.
Input: An object with the following keys:
- model: A DenseCapModel object to evaluate; required.
- loader: A ... | mit |
Anarchid/Zero-K | effects/slam.lua | 6 | 38258 | -- slam
-- slam_sparks_smokejets
-- slam_flash
-- slam_ray
-- slam_heat_pillar
-- slam_landcloud
-- slam_landcloud_ring
-- slam_landcloud_topcap
-- slam_landcloud_cap
-- slam_landcloud_pillar
-- slam_landcloud_topsuction
-- slam_seacloud
-- slam_seacloud_topcap
-- slam_seacloud_ring
-- slam_seacloud_cap
-- slam_seaclou... | gpl-2.0 |
alisa-dolinsky/Thirst | src/thirst.lua | 3 | 5455 | if not table.unpack and unpack then table.unpack = unpack end -- polyfill
local sentinel = {}
local quote_sentinel = {}
local void = {}
local function exit (operands) print ('result', table.unpack (operands)) print ('exit') end
local function quote (operands) return operands end
local operator_prototype_base
local ... | mit |
LanceJenkinZA/prosody-modules | mod_muc_limits/mod_muc_limits.lua | 10 | 3327 |
local mod_muc = module:depends"muc";
local rooms = rawget(mod_muc, "rooms"); -- Old MUC API
if not rooms then
rooms = module:shared"muc/rooms"; -- New MUC API
end
local jid_split, jid_bare = require "util.jid".split, require "util.jid".bare;
local st = require "util.stanza";
local new_throttle = require "util.thrott... | mit |
imashkan/ABCYAGOP | plugins/meme.lua | 637 | 5791 | local helpers = require "OAuth.helpers"
local _file_memes = './data/memes.lua'
local _cache = {}
local function post_petition(url, arguments)
local response_body = {}
local request_constructor = {
url = url,
method = "POST",
sink = ltn12.sink.table(response_body),
headers = {},
red... | gpl-2.0 |
lxl1140989/dmsdk | feeds/luci/protocols/ipv6/luasrc/model/network/proto_6x4.lua | 78 | 1602 | --[[
LuCI - Network model - 6to4, 6in4 & 6rd protocol extensions
Copyright 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
http://www.apache.org/licenses/L... | gpl-2.0 |
imashkan/ABCYAGOP | plugins/search_youtube.lua | 674 | 1270 | do
local google_config = load_from_file('data/google.lua')
local function httpsRequest(url)
print(url)
local res,code = https.request(url)
if code ~= 200 then return nil end
return json:decode(res)
end
local function searchYoutubeVideos(text)
local url = 'https://www.googleapis.com/youtube/v3/search?'
u... | gpl-2.0 |
Stepets/utf8.lua | begins/compiletime/vanilla.lua | 1 | 1078 | return function(utf8)
local matchers = {
sliding = function()
return [[
add(function(ctx) -- sliding
while ctx.pos <= ctx.len do
local clone = ctx:clone()
-- debug('starting from', clone, "start_pos", clone.pos)
clone.result.start = clone.pos
clone:next_function()
... | mit |
Insurgencygame/LivingDead | TheLivingDeadv0.1.sdd/units/unused/coreter.lua | 1 | 3088 | return {
coreter = {
acceleration = 0.040699999779463,
activatewhenbuilt = true,
brakerate = 0.019799999892712,
buildcostenergy = 1757,
buildcostmetal = 100,
buildpic = "CORETER.DDS",
buildtime = 6404,
canattack = false,
canmove = true,
category = "ALL TANK MOBILE NOTSUB NOWEAPON NOTSHIP NOTAIR NOT... | gpl-2.0 |
Anarchid/Zero-K | LuaUI/Widgets/unit_selectionblurryhalo.lua | 6 | 17502 | --------------------------------------------------------------------------------
--------------------------------------------------------------------------------
function widget:GetInfo()
return {
name = "Selection BlurryHalo",
desc = "Shows a halo for selected, hovered ally-selected units.",
a... | gpl-2.0 |
Mutos/StarsOfCall-NAEV | dat/ai/_commons/_baseCommonTasks/_land.lua | 1 | 1829 | -- =======================================================================================
--
-- TASK and SUBTASKs to handle landing.
--
-- =======================================================================================
-- ===============================================================================... | gpl-3.0 |
Sasu98/Nerd-Gaming-Public | resources/NGVIP/vip_s.lua | 2 | 4607 | print_ = print
print = outputChatBox
exports.scoreboard:scoreboardAddColumn ( "VIP", root, 50, "VIP", 10 )
for i, v in pairs ( getElementsByType ( "player" ) ) do
if ( not getElementData ( v, "VIP" ) ) then
setElementData ( v, "VIP", "None" )
end
end
addEventHandler ( "onPlayerJoin", root, function ( )
setElemen... | mit |
delram/yago | plugins/boobs.lua | 731 | 1601 | 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 no... | gpl-2.0 |
mamaddeveloper/DeveloperMMD_bot | plugins/boobs.lua | 731 | 1601 | 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 no... | gpl-2.0 |
ggcrunchy/Old-Love2D-Demo | Scripts/Utility/NumericOps.lua | 1 | 5074 | -- See TacoShell Copyright Notice in main folder of distribution
-- Standard library imports --
local max = math.max
local min = math.min
-- Cached routines --
local BoxesIntersect_
local SortPairs_
local SwapIf_
-- Export numericops namespace.
module "numericops"
--- Status.
-- @param x1 Box #1 x-coordinate.
-- @p... | mit |
Ractis/HookAndSlice | scripts/vscripts/DotaHS_AI_Follower_Kotl.lua | 1 | 8592 |
require( "DotaHS_AI_FollowerBase" )
--
-- TODO:
--
--------------------------------------------------------------------------------
-- AI / Kotl
--------------------------------------------------------------------------------
if AI_Kotl == nil then
AI_BehaviorTreeBuilder_Kotl = class({}, nil, AI_BehaviorTreeBuilder... | mit |
LanceJenkinZA/prosody-modules | mod_auth_sql/mod_auth_sql.lua | 32 | 3498 | -- Simple SQL Authentication module for Prosody IM
-- Copyright (C) 2011 Tomasz Sterna <tomek@xiaoka.com>
-- Copyright (C) 2011 Waqas Hussain <waqas20@gmail.com>
--
local log = require "util.logger".init("auth_sql");
local new_sasl = require "util.sasl".new;
local DBI = require "DBI"
local connection;
local params = ... | mit |
Anarchid/Zero-K | LuaUI/Widgets/unit_building_starter.lua | 7 | 3993 | -- $Id$
function widget:GetInfo()
return {
name = "Building Starter",
desc = "v2 Hold Q to queue a building to be started and not continued.",
author = "Google Frog",
date = "Dec 13, 2008",
license = "GNU GPL, v2 or later",
layer = 5,
enabled = true -- loaded by default?
}
e... | gpl-2.0 |
hinrik/layla | lib/layla/model.lua | 1 | 14859 | local M = {
db_file = "layla.sqlite",
caching = true,
new_db = true,
_order = 2,
_token_cache = {},
_expr_cache = {},
_link_cache = {},
_sth = {},
}
local M_mt = { __index = M }
local sqlite3 = require "lsqlite3"
local D = require "serpent".block
math.randomseed(os.time())
M._schema = [[
CREATE TABLE... | mit |
ComputerNerd/Retro-Graphics-Toolkit | level.lua | 1 | 19003 | --[[
This file is part of Retro Graphics Toolkit
Retro Graphics Toolkit 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 of the License, or any later version.
Retro Graphics Toolkit is distr... | gpl-3.0 |
makefu/nodemcu-firmware | lua_examples/adc_rgb.lua | 73 | 1163 | --
-- Light sensor on ADC(0), RGB LED connected to gpio12(6) Green, gpio13(7) Blue & gpio15(8) Red.
-- This works out of the box on the typical ESP8266 evaluation boards with Battery Holder
--
-- It uses the input from the sensor to drive a "rainbow" effect on the RGB LED
-- Includes a very "pseudoSin" function
--
f... | mit |
Insurgencygame/LivingDead | TheLivingDeadv0.1.sdd/luaui/widgets/unit_stockpile_dynamic.lua | 1 | 4556 | -------------------------------------------------------------------------------
-- DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
-- Version 2, December 2004
--
--Copyright (C) 2009 BrainDamage
--Everyone is permitted to copy and distribute verbatim or modified
--copies of this license document... | gpl-2.0 |
MinaciousGrace/Til-Death | BGAnimations/ScreenSelectMusic decorations/songinfo.lua | 2 | 1273 | local update = false
local t = Def.ActorFrame{
BeginCommand=cmd(queuecommand,"Set");
OffCommand=cmd(bouncebegin,0.2;xy,-500,0;); -- visible(false) doesn't seem to work with sleep
OnCommand=cmd(bouncebegin,0.2;xy,0,0;);
SetCommand=function(self)
self:finishtweening()
if getTabIndex() == 0 then
self:queuecomma... | mit |
githubmereza/creed_plug | plugins/add_bot.lua | 189 | 1492 | --[[
Bot can join into a group by replying a message contain an invite link or by
typing !add [invite link].
URL.parse cannot parsing complicated message. So, this plugin only works for
single [invite link] in a post.
[invite link] may be preceeded but must not followed by another characters.
--]]
do
local function... | gpl-2.0 |
Insurgencygame/LivingDead | TheLivingDeadv0.1.sdd/units/unused/corcv.lua | 1 | 2550 | return {
corcv = {
acceleration = 0.057199999690056,
brakerate = 0.17820000648499,
buildcostenergy = 0,
buildcostmetal = 200,
builddistance = 112,
buildpic = "CORCV.DDS",
buildtime = 2000,
canmove = true,
category = "ALL TANK MOBILE NOTSUB NOWEAPON NOTSHIP NOTAIR NOTHOVER SURFACE",
corpse = "DEAD",... | gpl-2.0 |
PichotM/DarkRP | entities/entities/spawned_shipment/init.lua | 2 | 6643 | AddCSLuaFile("cl_init.lua")
AddCSLuaFile("shared.lua")
include("shared.lua")
include("commands.lua")
util.AddNetworkString("DarkRP_shipmentSpawn")
function ENT:Initialize()
local contents = CustomShipments[self:Getcontents() or ""]
self.Destructed = false
self:SetModel(contents and contents.shipmodel or... | mit |
imashkan/ABCYAGOP | plugins/get.lua | 613 | 1067 | local function get_variables_hash(msg)
if msg.to.type == 'chat' then
return 'chat:'..msg.to.id..':variables'
end
if msg.to.type == 'user' then
return 'user:'..msg.from.id..':variables'
end
end
local function list_variables(msg)
local hash = get_variables_hash(msg)
if hash then
local names =... | gpl-2.0 |
Insurgencygame/LivingDead | TheLivingDeadv0.1.sdd/gadg dev/battlestance0.9.lua | 1 | 4877 |
function gadget:GetInfo()
return {
name = "battlestance",
desc = "Toggle between Defensive, Assault and Sprint",
author = "Zealot",
date = "13th July 2013",
license = "GNU LGPL, v2.1 or later",
layer = 101, -------------------------What does this do?
enabled = t... | gpl-2.0 |
sandeepthota/CydoPhenia | Training.lua | 1 | 1262 | require 'torch'
require 'nn'
require 'optim'
require 'LanguageModel'
require 'util.DataLoader'
local utils = require 'util.utils'
local unpack = unpack or table.unpack
local cmd = torch.CmdLine()
-- Dataset options
cmd:option('-input_h5', 'data/tiny-shakespeare.h5')
cmd:option('-input_json', 'data/tiny-shakespeare.... | mit |
rollasoul/HaikuDenseCap | test/evaluation_test.lua | 4 | 2353 |
local eval_utils = require 'eval.eval_utils'
local utils = require 'densecap.utils'
local tests = torch.TestSuite()
local tester = torch.Tester()
function tests.sanityCheckTest()
local records = {}
table.insert(records, {references={'an example ref', 'another ref', 'and one more'}, candidate='one words matches'... | mit |
lxl1140989/dmsdk | feeds/luci/applications/luci-asterisk/luasrc/model/cbi/asterisk-mod-app.lua | 137 | 15546 | cbimap = Map("asterisk", "asterisk", "")
module = cbimap:section(TypedSection, "module", "Modules", "")
module.anonymous = true
app_alarmreceiver = module:option(ListValue, "app_alarmreceiver", "Alarm Receiver Application", "")
app_alarmreceiver:value("yes", "Load")
app_alarmreceiver:value("no", "Do Not Load")
app_al... | gpl-2.0 |
LanceJenkinZA/prosody-modules | mod_manifesto/mod_manifesto.lua | 32 | 6828 | -- mod_manifesto
local timer = require "util.timer";
local jid_split = require "util.jid".split;
local st = require "util.stanza";
local dm = require "util.datamanager";
local dataforms_new = require "util.dataforms".new;
local adhoc_initial = require "util.adhoc".new_initial_data_form;
local mm_reload = require "modu... | mit |
LORgames/premake-core | modules/gmake/gmake_utility.lua | 15 | 1409 | --
-- make_utility.lua
-- Generate a C/C++ project makefile.
-- Copyright (c) 2002-2014 Jason Perkins and the Premake project
--
local p = premake
p.make.utility = {}
local make = p.make
local utility = p.make.utility
local project = p.project
local config = p.config
local fileconfig = p.fileco... | bsd-3-clause |
LightenPan/skynet-yule | datacenter/mysqlpool.lua | 1 | 1322 | local skynet = require "skynet"
local mysql = require "mysql"
local snax = require "snax"
local pool = {}
local maxconn
local index = 2
local function getconn(sync)
local db
if sync then
db = pool[1]
else
db = pool[index]
assert(db)
index = index + 1
if index > maxconn then
index = 2
end
end
retur... | mit |
Anarchid/Zero-K | LuaRules/Configs/StartBoxes/Bryce_Arena_fixed_2.lua | 17 | 1187 | return {
[0] = {
startpoints = {
{2785,1270},
},
boxes = {
{
{2212,655},
{3359,655},
{3359,1884},
{2212,1884},
},
},
},
[1] = {
startpoints = {
{5530,6840},
},
boxes = {
{
{4915,6226},
{6144,6226},
{6144,7455},
{4915,7455},
},
},
},
[2] = {
startp... | gpl-2.0 |
DarkJaguar91/DJUI | libs/LibStub/LibStub.lua | 4 | 1534 | -- LibStub is a simple versioning stub meant for use in Libraries. http://www.wowace.com/wiki/LibStub for more info
-- LibStub is hereby placed in the Public Domain Credits: Kaelten, Cladhaire, ckknight, Mikk, Ammo, Nevcairiel, joshborke
-- LibStub developed for World of Warcraft by above members of the WowAce communi... | apache-2.0 |
sbates130272/likwid | src/applications/likwid-pin.lua | 10 | 7605 | #!<PREFIX>/bin/likwid-lua
--[[
* =======================================================================================
*
* Filename: likwid-pin.lua
*
* Description: An application to pin a program including threads
*
* Version: <VERSION>
* Released: <DATE>
*
* Author: Thomas ... | gpl-3.0 |
Insurgencygame/LivingDead | TheLivingDeadv0.1.sdd/units/tld/armlab/cornecro.lua | 1 | 2414 | return {
cornecro = {
acceleration = 0.20000000298023,
brakerate = 0.25,
buildcostenergy = 0,
buildcostmetal = 100,
builddistance = 96,
builder = true,
buildpic = "CORNECRO.DDS",
buildtime = 1000,
canassist = true,
canmove = true,
cancapture = true,
canresurrect = true,
canCloak = true,
min... | gpl-2.0 |
Insurgencygame/LivingDead | TheLivingDeadv0.1.sdd/luaui/widgets/unit_auto_group.lua | 1 | 8777 | -- $Id$
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
local versionNum = '2.22'
function widget:GetInfo()
return {
name = "Auto group",
desc = "v".. (versionNum) .." Alt+0-9 sets auto... | gpl-2.0 |
Anarchid/Zero-K | units/shieldcon.lua | 3 | 2762 | return { shieldcon = {
unitname = [[shieldcon]],
name = [[Convict]],
description = [[Shielded Construction Bot]],
acceleration = 1.5,
activateWhenBuilt = true,
brakeRate = 1.8,
buildCostMetal = 120,
buildDistance = 128,
builder ... | gpl-2.0 |
Anarchid/Zero-K | LuaRules/Gadgets/api_subdir_gadgets.lua | 7 | 1280 | -- $Id$
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--
-- author: jK
--
-- Copyright (C) 2010.
-- Licensed under the terms of the GNU GPL, v2 or later.
--
-------------------------------------------... | gpl-2.0 |
ggcrunchy/Old-Love2D-Demo | Scripts/Class/Control/Interpolator.lua | 1 | 7452 | -- See TacoShell Copyright Notice in main folder of distribution
-- Standard library imports --
local assert = assert
local type = type
-- Imports --
local Identity = funcops.Identity
local New = class.New
-- Resume commands --
local Commands = table_ex.MakeSet{ "continue", "flip", "forward", "reverse" }
-- Unique ... | mit |
Mutos/StarsOfCall-NAEV | dat/scripts/cargo_common.lua | 1 | 7762 | include "jumpdist.lua"
include "nextjump.lua"
-- Find an inhabited planet in specified range.
-- Defaults are minDistance = 1 and maxDistance = 9
-- Mutos 2013/06/13 : use sigma distribution and rounds up
function cargo_selectMissionDistance (minDistance, maxDistance)
-- Declare local variables
local meanDis... | gpl-3.0 |
pkumusic/AI | DeepMind-Atari-Deep-Q-Learner/dqn/initenv.lua | 5 | 4777 | --[[
Copyright (c) 2014 Google Inc.
See LICENSE file for full terms of limited license.
]]
dqn = {}
require 'torch'
require 'nn'
require 'nngraph'
require 'nnutils'
require 'image'
require 'Scale'
require 'NeuralQLearner'
require 'TransitionTable'
require 'Rectifier'
function torchSetup(_opt)
_opt = _opt or {}
... | mit |
Anarchid/Zero-K | LuaUI/Configs/missionTipOverride.lua | 8 | 1046 |
text = [[You will face the fearsome, fire-spewing Dante strider in this battle. Use Aspis area shields to deflect the assault, and Racketeer artillery to disarm the Dante.]]
tips = {
{
image = "unitpics/shieldarty.png",
text = [[Racketeers use long range disarm missiles to disable the weapons and abiliti... | gpl-2.0 |
cstroie/Pip | wx.lua | 1 | 2133 | -- Weather report from MQTT "wx/STATION/now|tod|tom..." "line1, line2"
require("config")
lcd = require("lcd")
local wx = {}
wx.wthr = {}
function wx:weather(id, msg)
msg = msg:gsub("\194\176", "\223") -- UTF8
msg = msg:gsub("\176", "\223") -- Latin1
local ln1, ln2 = string.match(msg, '^(.*), (.*)$')
se... | gpl-3.0 |
chiuan/slua | build/luajit-2.0.4/src/jit/dis_ppc.lua | 88 | 20319 | ----------------------------------------------------------------------------
-- LuaJIT PPC disassembler module.
--
-- Copyright (C) 2005-2015 Mike Pall. All rights reserved.
-- Released under the MIT/X license. See Copyright Notice in luajit.h
----------------------------------------------------------------------------... | mit |
Anarchid/Zero-K | LuaRules/Configs/float_defs.lua | 6 | 5500 | -- initialRiseSpeed: Velocity which unit "pushes off" the bottom
-- riseAccel: Acceleration while trying to surface
-- riseUpDrag: Drag on negative velocity while trying to surface
-- riseDownDrag: Drag on positive velocity while trying to surface
-- sinkAccel: Acceleration while ... | gpl-2.0 |
Anarchid/Zero-K | LuaRules/Configs/StartBoxes/IcySea-v2.lua | 17 | 2057 | return {
[0] = {
startpoints = {
{5120,2253},
},
boxes = {
{
{4915,2048},
{5325,2048},
{5325,2458},
{4915,2458},
},
},
},
[1] = {
startpoints = {
{5018,7987},
},
boxes = {
{
{4813,7782},
{5222,7782},
{5222,8192},
{4813,8192},
},
},
},
[2] = {
star... | gpl-2.0 |
amircheshme/megatron | plugins/img_google.lua | 660 | 3196 | do
local mime = require("mime")
local google_config = load_from_file('data/google.lua')
local cache = {}
--[[
local function send_request(url)
local t = {}
local options = {
url = url,
sink = ltn12.sink.table(t),
method = "GET"
}
local a, code, headers, status = http.request(options)
return tabl... | gpl-2.0 |
Anarchid/Zero-K | scripts/shiptorpraider.lua | 3 | 2342 | include "constants.lua"
include "pieceControl.lua"
local hull, torp, turret, sonar, wake1, wake2 = piece ('Hull', 'Torp', 'Turret', 'Sonar', 'Wake1', 'Wake2')
local SIG_Aim = 2
local stuns = {false, false, false}
local disarmed = false
local moving = false
local sfxNum = 2
function script.setSFXoccupy(num)
sfxNum ... | gpl-2.0 |
helingping/Urho3D | bin/Data/LuaScripts/23_Water.lua | 15 | 9916 | -- Water example.
-- This sample demonstrates:
-- - Creating a large plane to represent a water body for rendering
-- - Setting up a second camera to render reflections on the water surface
require "LuaScripts/Utilities/Sample"
local reflectionCameraNode = nil
local waterNode = nil
local waterPlane = Plane()
... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.