commit stringlengths 40 40 | old_file stringlengths 6 92 | new_file stringlengths 6 92 | old_contents stringlengths 0 2.22k | new_contents stringlengths 68 2.86k | subject stringlengths 19 253 | message stringlengths 20 711 | lang stringclasses 1
value | license stringclasses 11
values | repos stringlengths 10 33.5k |
|---|---|---|---|---|---|---|---|---|---|
88c67454575518bc47875fae6df5af9a83f148bd | hammerspoon/apps.lua | hammerspoon/apps.lua | --------------------------------------------------------------------------------
-- Launch applications
hs.hotkey.bind(mash.apps, '1', function () hs.application.launchOrFocus("Google Chrome") end)
hs.hotkey.bind(mash.apps, '2', function () hs.application.launchOrFocus("Xcode") end)
hs.hotkey.bind(mash.apps, '3', function () hs.application.launchOrFocus("Zalo") end)
hs.hotkey.bind(mash.apps, '4', function () hs.application.launchOrFocus("Reveal") end)
hs.hotkey.bind(mash.apps, 'i', function () hs.application.launchOrFocus("iTerm") end)
hs.hotkey.bind(mash.apps, 'c', function () hs.application.launchOrFocus("Visual Studio Code") end)
hs.hotkey.bind(mash.apps, 's', function () hs.application.launchOrFocus("SourceTree") end)
hs.hotkey.bind(mash.apps, 'd', function () hs.application.launchOrFocus("Dash") end)
hs.hotkey.bind(mash.apps, 't', function () hs.application.launchOrFocus("Trello") end)
hs.hotkey.bind(mash.apps, 'e', function () hs.application.launchOrFocus("Spark") end)
hs.hotkey.bind(mash.apps, 'm', function () hs.application.launchOrFocus("Spotify") end)
hs.hotkey.bind(mash.apps, 'l', function () hs.application.launchOrFocus("Slack") end) | --------------------------------------------------------------------------------
-- Launch applications
hs.hotkey.bind(mash.apps, '1', function () hs.application.launchOrFocus("Google Chrome") end)
hs.hotkey.bind(mash.apps, '2', function () hs.application.launchOrFocus("Xcode") end)
hs.hotkey.bind(mash.apps, '3', function () hs.application.launchOrFocus("Zalo") end)
hs.hotkey.bind(mash.apps, '4', function () hs.application.launchOrFocus("Reveal") end)
hs.hotkey.bind(mash.apps, 'i', function () hs.application.launchOrFocus("iTerm") end)
hs.hotkey.bind(mash.apps, 'c', function () hs.application.launchOrFocus("Visual Studio Code") end)
hs.hotkey.bind(mash.apps, 's', function () hs.application.launchOrFocus("SourceTree") end)
hs.hotkey.bind(mash.apps, 'd', function () hs.application.launchOrFocus("Dash") end)
hs.hotkey.bind(mash.apps, 't', function () hs.application.launchOrFocus("Trello") end)
hs.hotkey.bind(mash.apps, 'm', function () hs.application.launchOrFocus("Spotify") end)
hs.hotkey.bind(mash.apps, 'e', function () hs.application.launchOrFocus("Microsoft Outlook") end)
hs.hotkey.bind(mash.apps, 'l', function () hs.application.launchOrFocus("Slack") end)
| Change `My Apps` key binding map | Change `My Apps` key binding map
Pulled By: trungpnn
| Lua | mit | eldesperado/.dotfiles |
a452cbe545cbe420f6f21b32ab6c71c7ef801905 | item/beds.lua | item/beds.lua | --[[
Illarion Server
This program is free software: you can redistribute it and/or modify it under
the terms of the GNU Affero General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option) any
later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE. See the GNU Affero General Public License for more
details.
You should have received a copy of the GNU Affero General Public License along
with this program. If not, see <http://www.gnu.org/licenses/>.
]]
-- UPDATE items SET itm_script='item.beds' WHERE itm_id IN (740, 741, 742, 743, 744, 745, 746, 747, 967, 968, 969, 988, 989, 1911, 1912);
local traits = require("base.traits")
local common = require("base.common")
local M = {}
function M.UseItem(user, sourceItem, ltstate)
traits.traitsManagement(user)
end
return M | --[[
Illarion Server
This program is free software: you can redistribute it and/or modify it under
the terms of the GNU Affero General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option) any
later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE. See the GNU Affero General Public License for more
details.
You should have received a copy of the GNU Affero General Public License along
with this program. If not, see <http://www.gnu.org/licenses/>.
]]
-- UPDATE items SET itm_script='item.beds' WHERE itm_id IN (740, 741, 742, 743, 744, 745, 746, 747, 967, 968, 969, 988, 989, 1911, 1912);
local traits = require("base.traits")
local common = require("base.common")
local M = {}
function M.UseItem(user, sourceItem, ltstate)
--traits.traitsManagement(user)
end
return M | Comment out undone featuer call | Comment out undone featuer call
| Lua | agpl-3.0 | vilarion/Illarion-Content,Illarion-eV/Illarion-Content,KayMD/Illarion-Content |
bf0670a6914d58bf7d42d777f8c1b1345a0034c1 | lexers/tavi_make.lua | lexers/tavi_make.lua | local lexer = require('lexer')
local token, word_match = lexer.token, lexer.word_match
local P, S = lpeg.P, lpeg.S
local lex = lexer.new('tavi_make', { lex_by_line = true })
-- Whitespace.
--local ws = token(lexer.WHITESPACE, lexer.space^1)
--lex:add_rule('whitespace', ws)
local filename = token(lexer.VARIABLE, (lexer.any - lexer.space - ':')^1)
local colon = token(lexer.OPERATOR, P':')
local linenum = token(lexer.NUMBER, lexer.dec_num)
local line = token(lexer.STRING, lexer.any^1)
lex:add_rule('make_result', lexer.starts_line(filename * colon * linenum * colon * line))
return lex | local lexer = require('lexer')
local token, word_match = lexer.token, lexer.word_match
local P, S = lpeg.P, lpeg.S
local lex = lexer.new('tavi_make', { lex_by_line = true })
-- Whitespace.
local ws = token(lexer.WHITESPACE, lexer.space^1)
--lex:add_rule('whitespace', ws)
local filename = token(lexer.VARIABLE, (lexer.any - lexer.space - ':')^1)
local colon = token(lexer.OPERATOR, P':')
local linenum = token(lexer.NUMBER, lexer.dec_num)
local colnum = token(lexer.NUMBER, lexer.dec_num)
local line = token(lexer.STRING, lexer.any^1)
local error = token(lexer.ERROR, " error")
local warning = token(lexer.COMMENT, " warning")
lex:add_rule('make_warning', lexer.starts_line(filename * colon * linenum * ((colon * colnum) ^ 0) * colon * warning * line))
lex:add_rule('make_error', lexer.starts_line(filename * colon * linenum * ((colon * colnum) ^ 0) * colon * error * line))
lex:add_rule('make_result', lexer.starts_line(filename * colon * linenum * colon * line))
return lex | Improve the make lexer - recognise error/warning. | Improve the make lexer - recognise error/warning.
| Lua | mit | jugglerchris/textadept-vi,jugglerchris/textadept-vi |
36b59f29c8510c8a60c11cdef7ab3fc28b96dead | config/plugins.lua | config/plugins.lua | vim.cmd [[packadd packer.nvim]]
return require('packer').startup(function()
-- Packer can manage itself
use 'wbthomason/packer.nvim'
-- TComment
use 'tomtom/tcomment_vim'
-- Lots of color schemes
use 'flazz/vim-colorschemes'
-- EditorConfig
use 'editorconfig/editorconfig-vim'
-- Haskell special characters goodness
use 'enomsg/vim-haskellConcealPlus'
-- LeaderF fuzzy finder
use({ "Yggdroot/LeaderF", run = ":LeaderfInstallCExtension" })
-- Icons! Used in alpha-nvim
use {'kyazdani42/nvim-web-devicons', event = 'VimEnter'}
-- Alpha!
use {
'goolord/alpha-nvim',
config = [[require('alpha-nvim')]]
}
-- Floating terminal windows
use 'voldikss/vim-floaterm'
-- Ultisnips
use 'SirVer/ultisnips'
-- Little help with brackets, quotes, XML tags, parentheses, ...
use 'tpope/vim-surround'
-- Renders markdown within vim
use 'ellisonleao/glow.nvim'
end)
| vim.cmd [[packadd packer.nvim]]
return require('packer').startup(function()
-- Packer can manage itself
use 'wbthomason/packer.nvim'
-- TComment
use 'tomtom/tcomment_vim'
-- Lots of color schemes
use 'flazz/vim-colorschemes'
-- EditorConfig
use 'editorconfig/editorconfig-vim'
-- Haskell special characters goodness
use 'enomsg/vim-haskellConcealPlus'
-- LeaderF fuzzy finder
use({ "Yggdroot/LeaderF", run = ":LeaderfInstallCExtension" })
-- Icons! Used in alpha-nvim
use {'kyazdani42/nvim-web-devicons', event = 'VimEnter'}
-- Alpha!
use {
'goolord/alpha-nvim',
config = [[require('alpha-nvim')]]
}
-- Floating terminal windows
use 'voldikss/vim-floaterm'
-- Ultisnips
use 'SirVer/ultisnips'
-- Little help with brackets, quotes, XML tags, parentheses, ...
use 'tpope/vim-surround'
-- Renders markdown within vim
use 'ellisonleao/glow.nvim'
-- Emmet for html editing
use 'mattn/emmet-vim'
end)
| Add `emmet` plugin for writing HTML | Add `emmet` plugin for writing HTML
| Lua | mit | arthurvr/dotvim |
20e9d81cf6c1b11bac34ef60e34a0a274cb1b5b1 | pages/index/get.lua | pages/index/get.lua | require "paginator"
function get()
local page = 0
if http.getValues.page ~= nil then
page = math.floor(tonumber(http.getValues.page) + 0.5)
end
if page < 0 then
http:redirect("/subtopic/index")
return
end
local articleCount = db:singleQuery("SELECT COUNT(*) as total FROM castro_articles", true)
local pg = paginator(page, 5, tonumber(articleCount.total))
local data = {}
data.articles, cache = db:query("SELECT title, text, created_at FROM castro_articles ORDER BY id DESC LIMIT ?, ?", pg.offset, pg.limit, true)
data.paginator = pg
if data.articles == nil and page > 0 then
http:redirect("/subtopic/index")
return
end
if data.articles ~= nil then
if not cache then
for _, article in pairs(data.articles) do
article.created = time:parseUnix(article.created_at)
end
end
end
http:render("home.html", data)
end | require "paginator"
function get()
local page = 0
if http.getValues.page ~= nil then
page = math.floor(tonumber(http.getValues.page) + 0.5)
end
if page < 0 then
http:redirect("/subtopic/index")
return
end
local articleCount = db:singleQuery("SELECT COUNT(*) as total FROM castro_articles", true)
local pg = paginator(page, 5, tonumber(articleCount.total))
local data = {}
data.articles, cached = db:query("SELECT title, text, created_at FROM castro_articles ORDER BY id DESC LIMIT ?, ?", pg.offset, pg.limit, true)
data.paginator = pg
if data.articles == nil and page > 0 then
http:redirect("/subtopic/index")
return
end
if data.articles ~= nil then
if not cached then
for _, article in pairs(data.articles) do
article.created = time:parseUnix(article.created_at)
end
end
end
http:render("home.html", data)
end | Change cache variable name to fix possible conflicts | Change cache variable name to fix possible conflicts
| Lua | mit | Raggaer/castro,Raggaer/castro,Raggaer/castro |
8fff6720caccb754a1810eb7f9f198e06f30cb41 | src/conf.lua | src/conf.lua | function love.conf(t)
t.title = "Journey to the Center of Hawkthorne v0.0.4"
t.author = "Kyle Conroy"
t.version = "0.8.0"
t.identity = "hawkthorne"
t.screen.width = 456
t.screen.height = 264
t.consolne = false
t.modules.physics = false
t.modules.joystick = false
t.release = false
end
| function love.conf(t)
t.title = "Journey to the Center of Hawkthorne v0.0.5"
t.author = "Kyle Conroy"
t.version = "0.8.0"
t.identity = "hawkthorne"
t.screen.width = 456
t.screen.height = 264
t.consolne = false
t.modules.physics = false
t.modules.joystick = false
t.release = false
end
| Bump release version to v0.0.5 | Bump release version to v0.0.5
| Lua | mit | hawkthorne/hawkthorne-client-lua,hawkthorne/hawkthorne-server-lua,hawkthorne/hawkthorne-client-lua,hawkthorne/hawkthorne-server-lua |
b398d7886efb5fe56678d05afa4137cd81c204b6 | libs/snapshots.lua | libs/snapshots.lua | local jsonStringify = require('json').stringify
local snapshot = require('snapshot')
local i = 0
local S1 = snapshot()
local potential = {}
return function (_, res)
collectgarbage()
collectgarbage()
local memoryUsed = 1024 * collectgarbage("count")
local S2 = snapshot()
-- Find new heap objects since last snapshot
local c = 0
local details = {}
for k, v in pairs(potential) do
if S2[k] then
c = c + 1
details[c] = {tostring(k), v}
end
end
potential = {}
for k,v in pairs(S2) do
if S1[k] == nil then
potential[k] = v
end
end
S1 = S2
i = i + 1
res.code = 200
res.headers["Content-Type"] = "application/json"
res.body = jsonStringify{
id = i,
potential_count = c,
potential = details,
lua_heap = memoryUsed,
}
end
| local snapshot = require('snapshot')
local i = 0
local S1 = snapshot()
local potential = {}
return function (_, res)
collectgarbage()
collectgarbage()
local memoryUsed = 1024 * collectgarbage("count")
local S2 = snapshot()
-- Find new heap objects since last snapshot
local c = 0
local details = {}
for k, v in pairs(potential) do
if S2[k] then
c = c + 1
details[c] = v
end
end
table.sort(details)
potential = {}
local total = 0
local pot = 0
for k,v in pairs(S2) do
total = total + 1
if S1[k] == nil then
pot = pot + 1
potential[k] = v
end
end
S1 = S2
i = i + 1
res.code = 200
res.headers["Content-Type"] = "text/plain"
res.body = "id: " .. i ..
"\nheap bytes: " .. memoryUsed ..
"\nheap count: " .. total ..
"\npotential count: " .. pot ..
"\nleak count: " .. c ..
"\n\n" .. table.concat(details, "\n") ..
"\n"
end
| Clean up snapshot output format | Clean up snapshot output format
| Lua | apache-2.0 | luvit/luvit.io,luvit/luvit.io,luvit/luvit.io |
254d797100dff1c002d3d66396e25c763c35054e | __resource.lua | __resource.lua | server_script 'MySqlAsync.net.dll'
server_export 'mysql_configure'
server_export 'mysql_execute'
server_export 'mysql_sync_execute'
server_export 'mysql_fetch_all'
server_export 'mysql_sync_fetch_all'
server_export 'mysql_fetch_scalar'
server_export 'mysql_sync_fetch_scalar'
server_script 'lib/MySQL.lua'
server_script 'lib/init.lua'
--server_script 'example.lua'
| resource_manifest_version '44febabe-d386-4d18-afbe-5e627f4af937'
server_script 'MySqlAsync.net.dll'
server_script 'lib/MySQL.lua'
server_script 'lib/init.lua'
--server_script 'example.lua'
| Remove useless export, add manifest version | Remove useless export, add manifest version
| Lua | mit | brouznouf/fivem-mysql-async,brouznouf/fivem-mysql-async,brouznouf/fivem-mysql-async |
c73aa096086ab1fa80319bb05adc0f8ca407b9c4 | Source/premake5.lua | Source/premake5.lua | project("RenHook")
kind("StaticLib")
language("C++")
pchheader("RenHook/RenHook.hpp")
pchsource("RenHook/RenHook.cpp")
if buildpath ~= nil then
targetdir(buildpath())
end
filter({ "configurations:Debug" })
symbols("On")
filter({ "configurations:Release" })
symbols("Off")
filter({})
includedirs({ ".", "../Dependencies/Capstone/Capstone/include", "../Dependencies/ODLib/Source" })
links({ "Capstone", "ODLib" })
files({ "**.cpp", "**.hpp" }) | project("RenHook")
kind("StaticLib")
language("C++")
pchheader("RenHook/RenHook.hpp")
pchsource("RenHook/RenHook.cpp")
if buildpath ~= nil then
targetdir(buildpath())
end
filter({ "configurations:Debug" })
symbols("On")
filter({ "configurations:Release" })
symbols("Off")
filter({})
includedirs({ ".", "../Dependencies/Capstone/Capstone/include" })
links({ "Capstone" })
files({ "**.cpp", "**.hpp" }) | Remove ODLib include and link | Remove ODLib include and link
| Lua | mit | WopsS/RenHook |
642c0441177ba0bc474b070943794a948cc56853 | levels/myLevel/level_custom_effect.lua | levels/myLevel/level_custom_effect.lua | local gameConfig = require("gameConfig")
local Sublevel = require("Sublevel")
local MyEffect = require("levels.myLevel.MyEffect")
local util = require("util")
local myLevel = Sublevel.new("9999999-056", "custom effect", "author name", {duration = 1800})
function myLevel:addEffect(x)
local effect = MyEffect.new({ time = 500})
self:insert(effect)
--place the effect
effect.x = x
effect.y = -effect.height/2
effect:show()
effect:enablePhysics()
--move the effect with the stage speed
effect:setScaleLinearVelocity( 0, gameConfig.stageSpeed )
return effect
end
function myLevel:show(options)
self:addEffect(gameConfig.contentWidth*0.25)
self:addTimer(1000, function ()
self:addEffect(gameConfig.contentWidth*0.5)
end)
self:addTimer(1500, function ()
self:addEffect(gameConfig.contentWidth*0.75)
end)
self.enemy = enemy
end
return myLevel
| local gameConfig = require("gameConfig")
local Sublevel = require("Sublevel")
local MyEffect = require("levels.myLevel.MyEffect")
local util = require("util")
local myLevel = Sublevel.new("9999999-056", "custom effect", "author name", {duration = 1800})
function myLevel:addEffect(x)
local effect = MyEffect.new({ time = 1500})
self:insert(effect)
--place the effect
effect.x = x
effect.y = -effect.height/2
effect:start()
effect:enablePhysics()
--move the effect with the stage speed
effect:setScaleLinearVelocity( 0, gameConfig.stageSpeed )
return effect
end
function myLevel:show(options)
self:addEffect(gameConfig.contentWidth*0.25)
self:addTimer(1000, function ()
self:addEffect(gameConfig.contentWidth*0.5)
end)
self:addTimer(1500, function ()
self:addEffect(gameConfig.contentWidth*0.75)
end)
self.enemy = enemy
end
return myLevel
| Modify the bug of effect demo level | Modify the bug of effect demo level
| Lua | mit | keviner2004/shoot-em-up |
dba7035f3d7eb08abe21f1e28a8c2e1c0906fc16 | lua/Coroutine.lua | lua/Coroutine.lua | -- Copyright (c) 2010-14 Bifrost Entertainment AS and Tommy Nguyen
-- Distributed under the MIT License.
-- (See accompanying file LICENSE or copy at http://opensource.org/licenses/MIT)
local coroutine_create = coroutine.create
local coroutine_resume = coroutine.resume
local coroutine_yield = coroutine.yield
local table_remove = table.remove
local __coroutines = {}
local __count = 0
local __index = -1
local Coroutine = {
__index = nil,
start = nil,
wait = nil
}
Coroutine.__index = setmetatable(Coroutine, {
__update = function(dt)
for i = __count, 1, -1 do
if not coroutine_resume(__coroutines[i], dt) then
table_remove(__coroutines, i)
__count = __count - 1
end
end
end
})
--! Creates and starts a coroutine executing \p fn.
function Coroutine.start(fn)
__count = __count + 1
local co = coroutine_create(fn)
__coroutines[__count] = co
return coroutine_resume(co, dt)
end
--! Blocks execution for \p t milliseconds.
function Coroutine.wait(t)
t = t or 1
t = t > 0 and t or 1
local a = 0
while a < t do
a = a + coroutine_yield()
end
end
return rainbow.module.register(Coroutine)
| -- Copyright (c) 2010-14 Bifrost Entertainment AS and Tommy Nguyen
-- Distributed under the MIT License.
-- (See accompanying file LICENSE or copy at http://opensource.org/licenses/MIT)
local coroutine_create = coroutine.create
local coroutine_resume = coroutine.resume
local coroutine_yield = coroutine.yield
local table_remove = table.remove
local __coroutines = {}
local __count = 0
local __index = -1
local Coroutine = {
__index = nil,
start = nil,
wait = nil
}
Coroutine.__index = setmetatable(Coroutine, {
__update = function(dt)
for i = __count, 1, -1 do
if not coroutine_resume(__coroutines[i], dt) then
table_remove(__coroutines, i)
__count = __count - 1
end
end
end
})
--! Creates and starts a coroutine executing \p fn.
function Coroutine.start(fn, ...)
__count = __count + 1
local co = coroutine_create(fn)
__coroutines[__count] = co
return coroutine_resume(co, dt, ...)
end
--! Blocks execution for \p t milliseconds.
function Coroutine.wait(t)
t = t or 1
t = t > 0 and t or 1
local a = 0
while a < t do
a = a + coroutine_yield()
end
end
return rainbow.module.register(Coroutine)
| Allow passing parameters to coroutine. | Allow passing parameters to coroutine.
| Lua | mit | tn0502/rainbow,pandaforks/tido-rainbow,tn0502/rainbow,tn0502/rainbow,tn0502/rainbow,tn0502/rainbow,pandaforks/tido-rainbow,pandaforks/tido-rainbow,pandaforks/tido-rainbow,tn0502/rainbow,pandaforks/tido-rainbow |
491b2e45d43549c29d0ae5d51bc2e664fd0f3a55 | test/page3.lua | test/page3.lua | -- This test checks if a query string has been given.
-- It sends the file identified by the query string.
-- Do not use it in a real server in this way!
if not mg.request_info.query_string then
mg.write("HTTP/1.0 200 OK\r\n")
mg.write("Connection: close\r\n")
mg.write("Content-Type: text/html; charset=utf-8\r\n")
mg.write("\r\n")
mg.write("<html><head><title>Civetweb Lua script test page 3</title></head>\r\n")
mg.write("<body>No query string!</body></html>\r\n")
elseif mg.request_info.query_string:match("/") or mg.request_info.query_string:match("\\") then
mg.write("HTTP/1.0 403 Forbidden\r\n")
mg.write("Connection: close\r\n")
mg.write("Content-Type: text/html; charset=utf-8\r\n")
mg.write("\r\n")
mg.write("<html><head><title>Civetweb Lua script test page 3</title></head>\r\n")
mg.write("<body>No access!</body></html>\r\n")
else
filename = mg.document_root .. "/" .. mg.request_info.query_string
mg.send_file(filename)
end
| Add a test for mg.send_file | Add a test for mg.send_file
| Lua | mit | GerHobbelt/civet-webserver,GerHobbelt/civet-webserver,GerHobbelt/civet-webserver,GerHobbelt/civet-webserver,GerHobbelt/civet-webserver,GerHobbelt/civet-webserver | |
46ba257d0a8dc0886cb4eca280dd09009ec4f418 | test/tests/regex_cap.lua | test/tests/regex_cap.lua | local assertEq = test.assertEq
local function log(x) test.log(tostring(x) .. "\n") end
local vi_regex = require('regex.regex')
local compile = vi_regex.compile
local pat
pat = compile('a(.*)b')
assertEq(pat:match("axyzb"), {_start=1,_end=5, groups={{2,4}},})
assertEq(pat:match("axyzbb"), {_start=1,_end=6, groups={{2,5}},})
pat = compile('a(foo|bar)*b')
--log(test.tostring(vi_regex.parse('a(foo|bar)*b'), ''))
--log(test.tostring(vi_regex.parse('a(foo|bar)*b'), ''))
assertEq(pat:match("ab"), {_start=1,_end=2,})
assertEq(pat:match("afoob"), {_start=1,_end=5, groups={{2,4}},})
assertEq(pat:match("afoobarb"), {_start=1,_end=8, groups={{5,7}},})
pat = compile('a([a-z]*)z X([0-9]*)Y')
assertEq(pat:match('az XY'), {_start=1, _end=5})
assertEq(pat:match('aasdfz X123Y'), {_start=1, _end=12, groups={{2,5},{9,11}}}) | local assertEq = test.assertEq
local function log(x) test.log(tostring(x) .. "\n") end
local vi_regex = require('regex.regex')
local compile = vi_regex.compile
local pat
pat = compile('a(.*)b')
assertEq(pat:match("axyzb"), {_start=1,_end=5, groups={{2,4}},})
assertEq(pat:match("axyzbb"), {_start=1,_end=6, groups={{2,5}},})
pat = compile('a(foo|bar)*b')
--log(test.tostring(vi_regex.parse('a(foo|bar)*b'), ''))
assertEq(pat:match("ab"), {_start=1,_end=2,})
assertEq(pat:match("afoob"), {_start=1,_end=5, groups={{2,4}},})
assertEq(pat:match("afoobarb"), {_start=1,_end=8, groups={{5,7}},})
pat = compile('a([a-z]*)z X([0-9]*)Y')
assertEq(pat:match('az XY'), {_start=1, _end=5, groups={{2,1}, {5,4}}})
assertEq(pat:match('aasdfz X123Y'), {_start=1, _end=12, groups={{2,5},{9,11}}}) | Fix test, which is returning the correct results after all. | Fix test, which is returning the correct results after all.
| Lua | mit | jugglerchris/textadept-vi,jugglerchris/textadept-vi,erig0/textadept-vi |
3890e19308730dd0120aba3f5f34dfc20703af33 | Quadtastic/QuadExport.lua | Quadtastic/QuadExport.lua | local QuadExport = {}
local function export_quad(filehandle, quadtable)
filehandle:write(string.format(
"{x = %d, y = %d, w = %d, h = %d}",
quadtable.x, quadtable.y, quadtable.w, quadtable.h))
end
local function export_table_content(filehandle, table, indentation)
for k, v in pairs(table) do
filehandle:write(string.rep(" ", indentation))
if type(k) == "string" then
filehandle:write(string.format("%s = ", k))
elseif type(k) ~= "number" then
error("Cannot handle table keys of type "..type(k))
end
if type(v) == "table" then
-- Check if it is a quad table, in which case we use a simpler function
if v.x and v.y and v.w and v.h then
export_quad(filehandle, v)
else
filehandle:write("{\n")
export_table_content(filehandle, v, indentation+1)
filehandle:write(string.rep(" ", indentation))
filehandle:write("}")
end
elseif type(v) == "number" or type(v) == "string" then
-- Not sure why this is here, but sure, let's export it
filehandle:write(tostring(v))
else
error("Cannot handle table values of type "..type(v))
end
filehandle:write(",\n")
end
end
QuadExport.export = function(quads, filepath_or_filehandle)
assert(quads and type(quads) == "table")
local filehandle
-- Errors need to be handled upstream
if io.type(filepath_or_filehandle) == "file" then
filehandle = filepath_or_filehandle
elseif io.type(filepath_or_filehandle) == nil and
type(filepath_or_filehandle) == "string"
then
filehandle, more = io.open(filepath, "w")
if not filehandle then error(more) end
else
error("Cannot access filepath or filehandle")
end
filehandle:write("return {\n")
export_table_content(filehandle, quads, 1)
filehandle:write("}\n")
filehandle:close()
end
return QuadExport | Add function to export quad table as valid lua code | Add function to export quad table as valid lua code
| Lua | mit | 25A0/Quadtastic,25A0/Quadtastic | |
0ddc89d0f54ef6c97c492cf790e8cd50abfd8563 | .hammerspoon/init.lua | .hammerspoon/init.lua | require 'expandmode'
require 'movemode'
local screenmon = nil
local super = {'ctrl', 'alt', 'cmd', 'shift'}
function screensChangedCallback()
local screen1 = hs.screen.allScreens()[1]:name()
if screen1 == 'Color LCD' then
hs.notify.show('Switched KWM modes', '', 'Switched to floating window mode',''):withdraw()
hs.execute('kwmc space -t float', true)
end
end
screenmon = hs.screen.watcher.new(screensChangedCallback)
screenmon:start()
| require 'expandmode'
require 'movemode'
local super = {'ctrl', 'alt', 'cmd', 'shift'}
function screensChangedCallback()
local screens = hs.screen.allScreens()
if #screens < 2 then
hs.notify.show('Switched KWM modes', '', 'Switched to floating window mode',''):withdraw()
hs.execute('kwmc space -t float', true)
hs.execute('kwmc config focused-border off', true)
else
hs.notify.show('Switched KWM modes', '', 'Switched to bsp window mode',''):withdraw()
hs.execute('kwmc space -t bsp', true)
hs.execute('kwmc config focused-border on', true)
end
end
hs.screen.watcher.new(screensChangedCallback):start()
| Refactor screenmon to work better with multiscreen | Refactor screenmon to work better with multiscreen
| Lua | mit | paradox460/.dotfiles,paradox460/.dotfiles,paradox460/.dotfiles,paradox460/.dotfiles |
6244f5b65eb4fa94b55ad33078880f7577a85238 | src/main/resources/lua/server_to_players.lua | src/main/resources/lua/server_to_players.lua | -- This script needs all active proxies available specified as args.
local insert = table.insert
local call = redis.call
local serverToData = {}
for _, proxy in ipairs(ARGV) do
local players = call("SMEMBERS", "proxy:" .. proxy .. ":usersOnline")
for _, player in ipairs(players) do
local server = call("HGET", "player:" .. player, "server")
if server then
local map = serverToData[server]
if not map then
serverToData[server] = {}
map = serverToData[server]
end
insert(map, player)
end
end
end
-- Redis can't map a Lua table back, so we have to send it as JSON.
return cjson.encode(serverToData) | -- This script needs all active proxies available specified as args.
local insert = table.insert
local call = redis.call
local serverToData = {}
for _, proxy in ipairs(ARGV) do
local players = call("SMEMBERS", "proxy:" .. proxy .. ":usersOnline")
for _, player in ipairs(players) do
local server = call("HGET", "player:" .. player, "server")
if server then
local map = serverToData[server]
if not map then
serverToData[server] = {}
map = serverToData[server]
end
insert(map, player)
end
end
end
-- Redis can't map Lua associative tables back, so we have to send it as JSON.
return cjson.encode(serverToData) | Clarify that Redis does allow tables to be sent back, but not associative ones. | Clarify that Redis does allow tables to be sent back, but not associative ones.
| Lua | unknown | minecrafter/RedisBungee,thechunknetwork/RedisBungee |
a927d582ed2d9cd8e139f70337578b668e918f62 | features.lua | features.lua | bed_size_x = 210
bed_size_y = 297
bed_size_z = 10
z_offset = 0.0
nozzle_width = -0.2
| bed_size_x = 210
bed_size_y = 297
bed_size_z = 10
z_offset = 0.0
nozzle_width = -0.05
| Set a smaller nozzle (-0.05). | Set a smaller nozzle (-0.05).
| Lua | mit | loic-fejoz/icesl-svg-printer |
9a0e291916bdafa3f5356106f38c9f17b5762dc6 | sslobby/gamemode/modules/sh_link.lua | sslobby/gamemode/modules/sh_link.lua | SS.Lobby.Link = {}
--------------------------------------------------
--
--------------------------------------------------
SS.Lobby.Link.MinPlayers = 4
SS.Lobby.Link.MaxPlayers = 8
--------------------------------------------------
--
--------------------------------------------------
STATUS_LINK_READY = 1
STATUS_LINK_UNAVAILABLE = 2
STATUS_LINK_IN_PROGRESS = 3
STATUS_LINK_PREPARING = 4 | SS.Lobby.Link = {}
--------------------------------------------------
--
--------------------------------------------------
SS.Lobby.Link.MinPlayers = 2
SS.Lobby.Link.MaxPlayers = 8
--------------------------------------------------
--
--------------------------------------------------
STATUS_LINK_READY = 1
STATUS_LINK_UNAVAILABLE = 2
STATUS_LINK_IN_PROGRESS = 3
STATUS_LINK_PREPARING = 4 | Set min sass players to 2 for now | Set min sass players to 2 for now | Lua | bsd-3-clause | T3hArco/skeyler-gamemodes |
ff921b2341446c94f034ab948bc6855a346bb478 | main.lua | main.lua |
local _oldRequire = require
require = function(path, ...)
return _oldRequire("source/" .. path:gsub("%/", "."), ...)
end
require "main" |
local _oldRequire = require
require = function(path, ...)
return _oldRequire("source." .. path:gsub("%/", "."), ...)
end
require "main" | Replace the root '/' with '.' | Replace the root '/' with '.'
| Lua | mit | BryceMehring/Hexel |
3674d4dc634e48ca1bd169bb8da65390e5df0a39 | wow/30-Texture-Draw.lua | wow/30-Texture-Draw.lua | require "wow/Texture";
require "rainback/AnchoredBound";
require "rainback/wow-conversion";
local Delegate = OOP.Class();
function Delegate:Constructor(frame)
self.frame = frame;
end;
function Delegate:Draw(painter)
local frame = self.frame;
local bound = frame:GetDelegate("layout"):GetBounds();
if type(bound) ~= "table" or not bound:HasBounds() then
return;
end;
local x, y, width, height = bound:GetBounds();
if x == nil then
return;
end;
painter:position(x, y);
painter:setPenColor(0, 0, 0);
painter.joinStyle = "miter";
painter.penWidth = 1;
painter:setFillColor(WoW.Convert.ToRainbackColor(frame:GetColor()));
painter:drawRect(width, height);
end;
function Delegate:ToString()
return "[Rainback Texture-Draw Delegate]";
end;
WoW.SetFrameDelegate("Texture", "draw", Delegate, "New");
| require "wow/Texture";
require "rainback/AnchoredBound";
require "rainback/wow-conversion";
local Delegate = OOP.Class();
function Delegate:Constructor(frame)
self.frame = frame;
end;
function Delegate:Draw(painter)
painter:reset();
local frame = self.frame;
local bound = frame:GetDelegate("layout"):GetBounds();
if type(bound) ~= "table" or not bound:HasBounds() then
return;
end;
local x, y, width, height = bound:GetBounds();
if x == nil then
return;
end;
painter:position(x, y);
painter:setPenColor(0, 0, 0);
painter.joinStyle = "miter";
painter.penWidth = 1;
painter:setFillColor(WoW.Convert.ToRainbackColor(frame:GetColor()));
painter:drawRect(width, height);
end;
function Delegate:ToString()
return "[Rainback Texture-Draw Delegate]";
end;
WoW.SetFrameDelegate("Texture", "draw", Delegate, "New");
| Reset painter when drawing a texture | Reset painter when drawing a texture
| Lua | mit | Thonik/rainback |
994ac591084db71628222bf7837df5c355a14ba2 | packages/markdown.lua | packages/markdown.lua | SILE.processMarkdown = function (content)
local lunamark = require("lunamark")
local reader = lunamark.reader.markdown
local writer = lunamark.writer.ast.new()
local parse = reader.new(writer)
local output = parse(tostring(content[1]))
SILE.process(output)
end
SILE.registerCommand("processMarkdown", function (option, content)
SILE.processMarkdown(SU.contentToString(content))
end)
SILE.registerCommand("emphasis", function(options, content)
SILE.call("em", options, content)
end)
| Add a realy basic package to parse Markdown into normal content | Add a realy basic package to parse Markdown into normal content
| Lua | agpl-3.0 | alerque/casile,alerque/casile,alerque/casile,alerque/casile,alerque/casile | |
bee50e2f0b3e5cad03a38e051a7e07f12b4e7630 | pandoc-filters/withoutheadinglinks.lua | pandoc-filters/withoutheadinglinks.lua | -- Don't allow links in headings (notably drops auto verse links)
Header = function (element)
return pandoc.walk_block(element, {
Link = function (element)
return element.content
end
})
end
| Add filter for removing links from headings | Add filter for removing links from headings
| Lua | agpl-3.0 | alerque/casile,alerque/casile,alerque/casile,alerque/casile,alerque/casile | |
42fc425f6ed0ae1761d478e30a65bf27a718c2c8 | hammerspoon/microphone.lua | hammerspoon/microphone.lua | local message = require('status-message')
local messageMuting = message.new('muted 🎤')
local messageHot = message.new('hot 🎤')
local lastMods = {}
local recentlyClicked = false
local secondClick = false
displayStatus = function()
-- Check if the active mic is muted
if hs.audiodevice.defaultInputDevice():muted() then
messageMuting:notify()
else
messageHot:notify()
end
end
displayStatus()
toggle = function(device)
if device:muted() then
device:setMuted(false)
else
device:setMuted(true)
end
end
optionKeyHandler = function()
recentlyClicked = false
end
controlKeyTimer = hs.timer.delayed.new(0.3, optionKeyHandler)
optionHandler = function(event)
local device = hs.audiodevice.defaultInputDevice()
local newMods = event:getFlags()
-- alt keyDown
if newMods['alt'] == true then
toggle(device)
if recentlyClicked == true then
displayStatus()
secondClick = true
end
recentlyClicked = true
controlKeyTimer:start()
-- alt keyUp
elseif lastMods['alt'] == true and newMods['alt'] == nil then
if secondClick then
secondClick = false
else
toggle(device)
end
end
lastMods = newMods
end
optionKey = hs.eventtap.new({hs.eventtap.event.types.flagsChanged}, optionHandler)
optionKey:start()
| local message = require('status-message')
local messageMuting = message.new('muted 🎤')
local messageHot = message.new('hot 🎤')
local lastMods = {}
local recentlyClicked = false
local secondClick = false
displayStatus = function()
-- Check if the active mic is muted
if hs.audiodevice.defaultInputDevice():inputMuted() then
messageMuting:notify()
else
messageHot:notify()
end
end
displayStatus()
toggle = function(device)
if device:inputMuted() then
device:setInputMuted(false)
else
device:setInputMuted(true)
end
end
optionKeyHandler = function()
recentlyClicked = false
end
controlKeyTimer = hs.timer.delayed.new(0.3, optionKeyHandler)
optionHandler = function(event)
local device = hs.audiodevice.defaultInputDevice()
local newMods = event:getFlags()
-- alt keyDown
if newMods['alt'] == true then
toggle(device)
if recentlyClicked == true then
displayStatus()
secondClick = true
end
recentlyClicked = true
controlKeyTimer:start()
-- alt keyUp
elseif lastMods['alt'] == true and newMods['alt'] == nil then
if secondClick then
secondClick = false
else
toggle(device)
end
end
lastMods = newMods
end
optionKey = hs.eventtap.new({hs.eventtap.event.types.flagsChanged}, optionHandler)
optionKey:start()
| Adjust mic mute so it actually works | Adjust mic mute so it actually works
| Lua | mit | mkornblum/.dotfiles,mkornblum/.dotfiles,mkornblum/.dotfiles,mkornblum/.dotfiles |
33bcd9836edb9a914ab770f6a148075ae0d2eef8 | lua/basic_lua_examples.lua | lua/basic_lua_examples.lua | print(x) -- Does not fail! It's just nil
print(#"café") -- It's 5, because it counts UTF-8 bytes
if 0 then
print "0 is truthy"
else
print "0 is falsy"
end
function firstFewPrimes()
return {2, 3, 5, 7, 9, 11, 13}
end
assert(type(4.66E-2) == "number")
assert(type(true and false) == "boolean")
assert(type('message') == "string")
assert(type(nil) == "nil")
assert(type(firstFewPrimes) == "function")
assert(type(firstFewPrimes()) == "table")
| print(x) -- Does not fail! Just nil
s = "caf\u{e9}"
print(s)
assert(#s == 5) -- counts bytes
assert(utf8.len(s) == 4) -- counts characters
function firstFewPrimes()
return {2, 3, 5, 7, 9, 11, 13}
end
assert(type(4.66E-2) == "number")
assert(type(true and false) == "boolean")
assert(type('message') == "string")
assert(type(nil) == "nil")
assert(type(firstFewPrimes) == "function")
assert(type(firstFewPrimes()) == "table")
assert(type(coroutine.create(firstFewPrimes) == "thread"))
assert(0 and "" and 0/0) -- all of these are truthy!
assert(not(false or nil)) -- only false and nil are falsy | Upgrade to Lua 5.3 to use UTF-8, w00t | Upgrade to Lua 5.3 to use UTF-8, w00t
| Lua | mit | rtoal/ple,rtoal/ple,rtoal/ple,rtoal/polyglot,rtoal/ple,rtoal/polyglot,rtoal/ple,rtoal/ple,rtoal/ple,rtoal/polyglot,rtoal/polyglot,rtoal/ple,rtoal/polyglot,rtoal/polyglot,rtoal/ple,rtoal/polyglot,rtoal/polyglot,rtoal/ple,rtoal/ple,rtoal/ple,rtoal/polyglot,rtoal/polyglot,rtoal/ple,rtoal/polyglot,rtoal/ple,rtoal/polyglot,rtoal/polyglot,rtoal/ple,rtoal/polyglot,rtoal/ple,rtoal/polyglot |
cbb6172b0b97e3ba66aa6885f3be23ce6081a7f3 | package.lua | package.lua | return {
name = "luvit/blog.luvit.io",
version = "0.0.2",
private = true,
dependencies = {
-- hoedown ffi bindings for fast markdown compiling
"creationix/hoedown@1.1.2",
-- Web server framework
"creationix/weblit-app@2.1.0",
-- Core plugin for proper http headers
"creationix/weblit-auto-headers@2.0.1",
-- Serve static files from disk
"creationix/weblit-static@2.0.0",
-- Basic logger to stdout
"creationix/weblit-logger@2.0.0",
}
}
| return {
name = "luvit/blog.luvit.io",
version = "0.0.3",
private = true,
dependencies = {
-- hoedown ffi bindings for fast markdown compiling
"creationix/hoedown@1.1.2",
-- Web server framework
"creationix/weblit-app@2.1.0",
-- Core plugin for proper http headers
"creationix/weblit-auto-headers@2.0.1",
-- Serve static files from disk
"creationix/weblit-static@2.2.1",
-- Basic logger to stdout
"creationix/weblit-logger@2.0.0",
}
}
| Make sure to use latest weblit-static | Make sure to use latest weblit-static
| Lua | apache-2.0 | luvit/luvit.io,luvit/luvit.io,luvit/luvit.io |
c79639eeb32643dfcfdd861f723b009f3e6c6f10 | run_unit_tests.lua | run_unit_tests.lua |
require('test.test_luaunit')
LuaUnit = require('luaunit')
LuaUnit.LuaUnit.verbosity = 2
os.exit( LuaUnit.LuaUnit.run() )
|
require('test.test_luaunit')
LuaUnit.verbosity = 2
os.exit( LuaUnit.run() )
| Revert "Make unittest runnable with latest changes." | Revert "Make unittest runnable with latest changes."
This reverts commit 79a6ec311ea474f438533123cd1f38de1af64c15.
| Lua | bsd-2-clause | GuntherStruyf/luaunit,GuntherStruyf/luaunit |
b47821763edfc0b51b696cfb0dfcaebb52471c65 | lua/starfall/libs_sh/vmatrix.lua | lua/starfall/libs_sh/vmatrix.lua | -- Credits to Radon & Xandaros
SF.VMatrix = {}
local vmatrix_methods, vmatrix_metamethods = SF.Typedef("VMatrix") -- Define our own VMatrix based off of standard VMatrix
local wrap, unwrap = SF.CreateWrapper( vmatrix_metamethods, true, true )
SF.VMatrix.Methods = vmatrix_methods
SF.VMatrix.Metatable = vmatrix_metamethods
SF.VMatrix.Wrap = wrap
SF.VMatrix.Unwrap = unwrap
SF.DefaultEnvironment.Matrix = function()
return wrap(Matrix())
end
function vmatrix_methods:rotate( ang )
SF.CheckType( self, vmatrix_metamethods )
SF.CheckType( ang, "Angle")
local v = unwrap(self)
v:Rotate( ang )
end
function vmatrix_methods:translate( vec )
SF.CheckType( self, vmatrix_metamethods )
SF.CheckType( vec, "Vector" )
local v = unwrap(self)
v:Translate( vec )
end | -- Credits to Radon & Xandaros
SF.VMatrix = {}
local vmatrix_methods, vmatrix_metamethods = SF.Typedef("VMatrix") -- Define our own VMatrix based off of standard VMatrix
local wrap, unwrap = SF.CreateWrapper( vmatrix_metamethods, true, false )
SF.VMatrix.Methods = vmatrix_methods
SF.VMatrix.Metatable = vmatrix_metamethods
SF.VMatrix.Wrap = wrap
SF.VMatrix.Unwrap = unwrap
SF.DefaultEnvironment.Matrix = function()
return wrap(Matrix())
end
function vmatrix_methods:rotate( ang )
SF.CheckType( self, vmatrix_metamethods )
SF.CheckType( ang, "Angle")
local v = unwrap(self)
v:Rotate( ang )
end
function vmatrix_methods:translate( vec )
SF.CheckType( self, vmatrix_metamethods )
SF.CheckType( vec, "Vector" )
local v = unwrap(self)
v:Translate( vec )
end | Fix VMatrices being garbage collected | Fix VMatrices being garbage collected
They will still be garbage collected if there is no reference to the SF-type, but they won't if only the reference to the gmod type is missing
| Lua | bsd-3-clause | Ingenious-Gaming/Starfall,Jazzelhawk/Starfall,Xandaros/Starfall,INPStarfall/Starfall,Jazzelhawk/Starfall,Xandaros/Starfall,Ingenious-Gaming/Starfall,INPStarfall/Starfall |
838404eb63a567052abd2075a431387f08f3f319 | tests/test_weird.lua | tests/test_weird.lua | u = {['@!#'] = 'qbert', [{}] = 1729, [6.28] = 'tau'}
print(u[6.28]) -- prints "tau"
-- Key matching is basically by value for numbers
-- and strings, but by identity for tables.
a = u['@!#'] -- Now a = 'qbert'.
b = u[{}] -- We might expect 1729, but it's nil:
-- b = nil since the lookup fails. It fails
-- because the key we used is not the same object
-- as the one used to store the original value. So
-- strings & numbers are more portable keys.
-- A one-table-param function call needs no parens:
function h(x) print(x.key1) end
h{key1 = 'Sonmi~451'} -- Prints 'Sonmi~451'.
for key, val in pairs(u) do -- Table iteration.
print(key, val)
end
| u = {['@!#'] = 'qbert', [{}] = 1729, [6.28] = 'tau'}
print(u[6.28]) -- prints "tau"
-- Key matching is basically by value for numbers
-- and strings, but by identity for tables.
a = u['@!#'] -- Now a = 'qbert'.
b = u[{}] -- We might expect 1729, but it's nil:
-- b = nil since the lookup fails. It fails
-- because the key we used is not the same object
-- as the one used to store the original value. So
-- strings & numbers are more portable keys.
-- A one-table-param function call needs no parens:
function h(x) print(x.key1) end
h{key1 = 'Sonmi~451'} -- Prints 'Sonmi~451'.
for key, val in pairs(u) do -- Table iteration.
print(type(key), val)
end
| Change output in weird test | Change output in weird test
| Lua | mit | jirizoudun/lurun,jirizoudun/lurun,jirizoudun/lurun |
f3e2d0158614457fddba4071daff63f2a2d69f56 | tests/test_util_stanza.lua | tests/test_util_stanza.lua |
function deserialize(deserialize, st)
local stanza = st.stanza("message", { a = "a" });
local stanza2 = deserialize(st.preserialize(stanza));
assert_is(stanza2.last_add, "Deserialized stanza is missing last_add for adding child tags");
end
|
function preserialize(preserialize, st)
local stanza = st.stanza("message", { a = "a" });
local stanza2 = preserialize(stanza);
assert_is(stanza2 and stanza.name, "preserialize returns a stanza");
assert_is_not(stanza2.tags, "Preserialized stanza has no tag list");
assert_is_not(stanza2.last_add, "Preserialized stanza has no last_add marker");
assert_is_not(getmetatable(stanza2), "Preserialized stanza has no metatable");
end
function deserialize(deserialize, st)
local stanza = st.stanza("message", { a = "a" });
local stanza2 = deserialize(st.preserialize(stanza));
assert_is(stanza2 and stanza.name, "deserialize returns a stanza");
assert_is(stanza2.last_add, "Deserialized stanza is missing last_add for adding child tags");
assert_table(stanza2.attr, "Deserialized stanza has attributes");
assert_equal(stanza2.attr.a, "a", "Deserialized stanza retains attributes");
assert_table(getmetatable(stanza2), "Deserialized stanza has metatable");
end
| Add more tests for util/stanza.lua serialization routines | Add more tests for util/stanza.lua serialization routines
| Lua | mit | sarumjanuch/prosody,sarumjanuch/prosody |
ee2b234f89f7352d814a352129e3474523741e87 | src/conf.lua | src/conf.lua | function love.conf(t)
t.title = "Journey to the Center of Hawkthorne v0.0.36"
t.author = "Kyle Conroy"
t.version = "0.8.0"
t.identity = "hawkthorne"
t.screen.width = 912
t.screen.height = 528
t.screen.fullscreen = false
t.console = false
t.modules.physics = false
t.modules.joystick = false
t.release = false
end
| function love.conf(t)
t.title = "Journey to the Center of Hawkthorne v0.0.37"
t.author = "Kyle Conroy"
t.version = "0.8.0"
t.identity = "hawkthorne"
t.screen.width = 912
t.screen.height = 528
t.screen.fullscreen = false
t.console = false
t.modules.physics = false
t.modules.joystick = false
t.release = false
end
| Bump release version to v0.0.37 | Bump release version to v0.0.37
| Lua | mit | hawkthorne/hawkthorne-client-lua,hawkthorne/hawkthorne-client-lua,hawkthorne/hawkthorne-server-lua,hawkthorne/hawkthorne-server-lua |
cfc0540486748fd2b8a4f9fe373efde21abd420e | Modules/Shared/Events/StepUtils.lua | Modules/Shared/Events/StepUtils.lua | --- Binds animations into step, where the animation only runs as needed
-- @module StepUtils
-- @author Quenty
local RunService = game:GetService("RunService")
local StepUtils = {}
-- update should return true while it needs to update
function StepUtils.bindToRenderStep(update)
assert(type(update) == "function")
local conn = nil
local function disconnect()
if conn then
conn:Disconnect()
conn = nil
end
end
local function connect(...)
-- Ignore if we have an existing connection
if conn and conn.Connected then
return
end
-- Check to see if we even need to bind an update
if not update(...) then
return
end
-- Usually contains just the self arg!
local args = {...}
-- Bind to render stepped
conn = RunService.RenderStepped:Connect(function()
if not update(unpack(args)) then
disconnect()
end
end)
end
return connect, disconnect
end
return StepUtils | --- Binds animations into step, where the animation only runs as needed
-- @module StepUtils
-- @author Quenty
local HttpService = game:GetService("HttpService")
local RunService = game:GetService("RunService")
local StepUtils = {}
-- update should return true while it needs to update
function StepUtils.bindToRenderStep(update)
assert(type(update) == "function")
local conn = nil
local function disconnect()
if conn then
conn:Disconnect()
conn = nil
end
end
local function connect(...)
-- Ignore if we have an existing connection
if conn and conn.Connected then
return
end
-- Check to see if we even need to bind an update
if not update(...) then
return
end
-- Usually contains just the self arg!
local args = {...}
-- Bind to render stepped
conn = RunService.RenderStepped:Connect(function()
if not update(unpack(args)) then
disconnect()
end
end)
end
return connect, disconnect
end
function StepUtils.onceAtRenderPriority(priority, func)
assert(type(priority) == "number")
assert(type(func) == "function")
local key = ("StepUtils.onceAtPriority_%s"):format(HttpService:GenerateGUID(false))
local function cleanup()
RunService:UnbindFromRenderStep(key)
end
RunService:BindToRenderStep(key, priority, function()
cleanup()
func()
end)
return cleanup
end
return StepUtils | Add ability to execute once at render priority | Add ability to execute once at render priority
| Lua | mit | Quenty/NevermoreEngine,Quenty/NevermoreEngine,Quenty/NevermoreEngine |
5722f71d8ca26715e979ed03cdc08a52e2fa863b | layout-cep.lua | layout-cep.lua | local book = SILE.require("classes/book");
book:loadPackage("masters")
book:defineMaster({ id = "right", firstContentFrame = "content", frames = {
content = {left = "22.5mm", right = "100%-15mm", top = "20mm", bottom = "top(footnotes)" },
runningHead = {left = "left(content)", right = "right(content)", top = "top(content)-8mm", bottom = "top(content)-2mm" },
footnotes = { left="left(content)", right = "right(content)", height = "0", bottom="100%-15mm"}
}})
book:defineMaster({ id = "left", firstContentFrame = "content", frames = {}})
book:loadPackage("twoside", { oddPageMaster = "right", evenPageMaster = "left" });
book:mirrorMaster("right", "left")
SILE.call("switch-master-one-page", {id="right"})
| local book = SILE.require("classes/book");
book:defineMaster({ id = "right", firstContentFrame = "content", frames = {
content = {left = "20mm", right = "100%-12.5mm", top = "20mm", bottom = "100%-15mm" },
runningHead = {left = "left(content)", right = "right(content)", top = "top(content)-10mm", bottom = "top(content)-2mm" },
}})
book:defineMaster({ id = "left", firstContentFrame = "content", frames = {}})
book:loadPackage("twoside", { oddPageMaster = "right", evenPageMaster = "left" });
book:mirrorMaster("right", "left")
SILE.call("switch-master-one-page", {id="right"})
| Use narrower margins and no footer frame for pocket size | Use narrower margins and no footer frame for pocket size
| Lua | agpl-3.0 | alerque/casile,alerque/casile,alerque/casile,alerque/casile,alerque/casile |
bdb3352bb688a020bdc7f0458f52ab26cd421bb5 | src/lua/init.lua | src/lua/init.lua | dmp = require('src/lua/diff_match_patch')
_G.apply_patch = function(buf_text, patch_text)
local patches = dmp.patch_fromText(patch_text)
local text, results = dmp.patch_apply(patches, buf_text)
local clean_patch = true
for k,v in ipairs(results) do
if v == false then
clean_patch = false
break
end
end
return clean_patch, text
end
-- print(apply_patch([[dmp = require('diff_match_patch')
-- _G.apply_patch = function(buf_text, patch_text)
-- local patches = dmp.patch_fromText(patch_text)
-- local text, results = dmp.patch_apply(patches, buf_text)
-- local clean_patch = true
-- for k,v in ipairs(results) do
-- if v == false then
-- clean_patch = false
-- break
-- end
-- end
-- return clean_patch, text
-- end
-- apply_patch("123", "e")"]], "@@ -376,11 +376,9 @@\n %22, %22\n-1x3\n+e\n %22)%0A%0A\n"))
| Make a nice helper function that applies patches | Make a nice helper function that applies patches
| Lua | apache-2.0 | Floobits/diffshipper,Floobits/diffshipper | |
1a6fa0292724258d3fa08be7474b6359eeef074d | data/audio_config.lua | data/audio_config.lua | audio.open()
audio.channels(10)
audio.load_chunk('sfx/Pickup_Coin.wav')
audio.load_chunk('sfx/Jump.wav')
audio.load_music('sfx/FTL soundtrack - ColonialBATTLE.mp3')
| audio.open()
audio.channels(10)
audio.load_chunk('sfx/Pickup_Coin.wav')
audio.load_chunk('sfx/Jump.wav')
| Remove in config file too | Remove in config file too
| Lua | mit | n00bDooD/geng,n00bDooD/geng,n00bDooD/geng |
a27858e8b6feb255d4bed80fddd00ea4a9adea79 | test/package/extracttarball/extracttarball.lua | test/package/extracttarball/extracttarball.lua | require('buildsys')
bd = builddir()
bd:extract(bd:fetch { method = 'dl', uri = 'http://awpbuild.atlnz.lc/release_tarballs/dbus-1.2.16.tar.gz' })
| require('buildsys')
bd = builddir()
bd:extract(
bd:fetch {
method = 'dl',
uri = 'https://dbus.freedesktop.org/releases/dbus/dbus-1.2.16.tar.gz',
}
)
| Allow tests to run for GitHub clones | MAINT: Allow tests to run for GitHub clones
Change-Id: I3b21aecd557a63fc91cab58e98889888a24319ac
Reviewed-by: Scott Parlane <85029adc3fa41ef14594a57826619713bfe95f25@alliedtelesis.co.nz>
Signed-off-by: Matt Bennett <e3d8681cec70d3da741935b3385821001b249adc@alliedtelesis.co.nz>
| Lua | bsd-2-clause | alliedtelesis/buildsyspp,ATL-NZ/buildsyspp |
6195dd3252dfd4fc987458e484bfc7ec707190d3 | test/dev-app/index.lua | test/dev-app/index.lua | package.path = package.path .. ';'..(debug.getinfo(1).source):match('^@?(.-)/index.lua$')..'/../../src/?.lua'
require "sailor"
sailor.launch()
| package.path = package.path .. ';'..((debug.getinfo(1).source):match('^@?(.-)/index.lua$') or '')..'/../../src/?.lua'
require "sailor"
sailor.launch()
| Debug source returns nil on cgilua. | Debug source returns nil on cgilua.
| Lua | mit | hallison/sailor,felipedaragon/sailor,ignacio/sailor,mpeterv/sailor,ignacio/sailor,noname007/sailor,felipedaragon/sailor,mpeterv/sailor,sailorproject/sailor,Etiene/sailor,jeary/sailor,Etiene/sailor |
487bc7383c0e241f05760cfd86566bea8ee15d67 | build/scripts/tools/ndk_server.lua | build/scripts/tools/ndk_server.lua | TOOL.Name = "SDKServer"
TOOL.Directory = "../SDK"
TOOL.Kind = "Library"
TOOL.TargetDirectory = "../SDK/lib"
TOOL.Defines = {
"NDK_BUILD",
"NDK_SERVER"
}
TOOL.Includes = {
"../SDK/include",
"../SDK/src"
}
TOOL.Files = {
"../SDK/include/NDK/**.hpp",
"../SDK/include/NDK/**.inl",
"../SDK/src/NDK/**.hpp",
"../SDK/src/NDK/**.inl",
"../SDK/src/NDK/**.cpp"
}
-- Excludes client-only files
TOOL.FilesExcluded = {
"../SDK/**/CameraComponent.*",
"../SDK/**/Console.*",
"../SDK/**/GraphicsComponent.*",
"../SDK/**/LightComponent.*",
"../SDK/**/ListenerComponent.*",
"../SDK/**/ListenerSystem.*",
"../SDK/**/RenderSystem.*",
"../SDK/**/LuaBinding_Audio.*",
"../SDK/**/LuaBinding_Graphics.*",
"../SDK/**/LuaBinding_Renderer.*"
}
TOOL.Libraries = function()
local libraries = {}
for k,v in pairs(NazaraBuild.Modules) do
if (not v.ClientOnly) then
table.insert(libraries, "Nazara" .. v.Name)
end
end
return libraries
end
| TOOL.Name = "SDKServer"
TOOL.Directory = "../SDK"
TOOL.Kind = "Library"
TOOL.TargetDirectory = "../SDK/lib"
TOOL.Defines = {
"NDK_BUILD",
"NDK_SERVER"
}
TOOL.Includes = {
"../SDK/include",
"../SDK/src"
}
TOOL.Files = {
"../SDK/include/NDK/**.hpp",
"../SDK/include/NDK/**.inl",
"../SDK/src/NDK/**.hpp",
"../SDK/src/NDK/**.inl",
"../SDK/src/NDK/**.cpp"
}
-- Excludes client-only files
TOOL.FilesExcluded = {
"../SDK/**/CameraComponent.*",
"../SDK/**/Console.*",
"../SDK/**/GraphicsComponent.*",
"../SDK/**/LightComponent.*",
"../SDK/**/ListenerComponent.*",
"../SDK/**/ListenerSystem.*",
"../SDK/**/RenderSystem.*",
"../SDK/**/LuaBinding_Audio.*",
"../SDK/**/LuaBinding_Graphics.*",
"../SDK/**/LuaBinding_Renderer.*"
}
TOOL.Libraries = {
"NazaraCore",
"NazaraLua",
"NazaraNetwork",
"NazaraNoise",
"NazaraPhysics",
"NazaraUtility"
}
| Fix dependencies, allowing it to exists in server mode | Build/NDKServer: Fix dependencies, allowing it to exists in server mode
Former-commit-id: e917ce65aaea2567e4cb261777f458c3ea8ecdad [formerly a2f437b555af173f06b75f78bfe89ee14de7ba9f]
Former-commit-id: 83d69a7152c45f02ae5a344c7f8be574cded2318 | Lua | mit | DigitalPulseSoftware/NazaraEngine |
1e1a4626a6fb9761b4fda8581a138de9a4cb8601 | Video-decoder/test-stream.lua | Video-decoder/test-stream.lua | require("pl")
require("image")
local video = assert(require("libvideo_decoder"))
-- Options ---------------------------------------------------------------------
opt = lapp([[
-v, --videoPath (default '') path to video file
]])
-- load a video and extract frame dimensions
local status, height, width, length, fps = video.init(opt.videoPath)
if not status then
error("No video")
else
print('Video statistics: '..height..'x'..width..' ('..(length or 'unknown')..' frames)')
end
-- construct tensor
local dst = torch.ByteTensor(3, height, width)
-- play and save a stream
video.startrx("video.mp4", "mp4")
local win
local timer = torch.Timer()
while(true) do
video.frame_rgb(dst)
win = image.display{image = dst, win = win}
end
print('Time: ', timer:time().real/nb_frames)
video.stoprx()
-- free variables and close the video
video.exit()
| Add testing script for vidoe-decoder | Add testing script for vidoe-decoder
Testing script shows how to receive a stream and save as a file in
background.
| Lua | bsd-3-clause | e-lab/torch-toolbox,kaustubhcs/torch-toolbox,e-lab/torch-toolbox,vseledkin/torch-toolbox,e-lab/torch-toolbox,kaustubhcs/torch-toolbox,kaustubhcs/torch-toolbox,vseledkin/torch-toolbox,vseledkin/torch-toolbox | |
ff9cc19269b9838406400b03c18105745c37bae2 | modulefiles/beautifulsoup4/4.3.2.lua | modulefiles/beautifulsoup4/4.3.2.lua | --[[
module load gcc python
pip install --user --verbose beautifulsoup4==4.3.2
]]
local home = os.getenv("HOME")
local prefix = pathJoin(home, ".local")
local pythonpath = pathJoin(prefix, "lib/python2.7/site-packages")
prereq('python')
prepend_path("PYTHONPATH", prefix)
| --[[
module load gcc python/2.7.8
pip install --install-option="--prefix=/home/idhmc/apps/beautifulsoup4/4.3.2" --verbose beautifulsoup4==4.3.2
]]
local prefix = "/home/idhmc/apps/beautifulsoup4/4.3.2"
local pythonpath = pathJoin(prefix, "lib/python2.7/site-packages")
prereq('python')
prepend_path("PYTHONPATH", prefix)
| Update beautifulsoup4 to install to /home/idhmc/apps | Update beautifulsoup4 to install to /home/idhmc/apps
| Lua | apache-2.0 | Early-Modern-OCR/hOCR-De-Noising |
90f3e61dd37def3348670d87c8943e192f27d108 | .textadept/init.lua | .textadept/init.lua | -- 4 spaces FTW!
buffer.tab_width = 4
buffer.use_tabs = false
-- Turn on line wrapping:
buffer.wrap_mode = buffer.WRAP_WORD
-- Increase font size for GUI:
buffer:set_theme(
'light',
{
font = 'IBM Plex Mono',
fontsize = 18
}
)
-- Interpret PICO-8 files as Lua.
textadept.file_types.extensions.p8 = 'lua'
-- Make Alt have the same functionality as
-- Ctrl with word selection using Shift.
-- Since the default functionality
-- makes no sense.
keys.asleft = buffer.word_left_extend
keys.asright = buffer.word_right_extend
-- Increase the line number margin width, relatively:
events.connect(
events.FILE_OPENED,
function()
if type(buffer.line_count) == 'number' then
local lineCountLength = tostring(buffer.line_count):len()
local width = (lineCountLength + 1) * 12
buffer.margin_width_n[0] = width + (not CURSES and 4 or 0)
end
end
)
| -- 4 spaces FTW!
buffer.tab_width = 4
buffer.use_tabs = false
-- Turn on line wrapping:
buffer.wrap_mode = buffer.WRAP_WORD
-- Increase font size for GUI:
buffer:set_theme(
'light',
{
font = 'IBM Plex Mono',
fontsize = 18
}
)
-- Interpret PICO-8 files as Lua.
textadept.file_types.extensions.p8 = 'lua'
-- Make Alt have the same functionality as
-- Ctrl with word selection using Shift.
-- Since the default functionality
-- makes no sense.
keys.asleft = buffer.word_left_extend
keys.asright = buffer.word_right_extend
-- Increase the line number margin width, relatively:
events.connect(
events.FILE_OPENED,
function()
if type(buffer.line_count) == 'number' then
local lineCountLength = tostring(buffer.line_count):len()
local width = (lineCountLength + 2) * 12
buffer.margin_width_n[0] = width + (not CURSES and 4 or 0)
end
end
)
| Add two to line number margin width. | Add two to line number margin width. | Lua | mpl-2.0 | ryanpcmcquen/linuxTweaks |
6aca8daf16420766f2b197d16e7180398d9b73af | lua_modules/bh1750/bh1750_Example1.lua | lua_modules/bh1750/bh1750_Example1.lua | -- ***************************************************************************
-- BH1750 Example Program for ESP8266 with nodeMCU
-- BH1750 compatible tested 2015-1-30
--
-- Written by xiaohu
--
-- MIT license, http://opensource.org/licenses/MIT
-- ***************************************************************************
tmr.alarm(0, 10000, 1, function()
SDA_PIN = 6 -- sda pin, GPIO12
SCL_PIN = 5 -- scl pin, GPIO14
bh1750 = require("bh1750")
bh1750.init(SDA_PIN, SCL_PIN)
bh1750.read(OSS)
l = bh1750.getlux()
print("lux: "..(l / 100).."."..(l % 100).." lx")
-- release module
bh1750 = nil
package.loaded["bh1750"]=nil
end)
| Print LUX Data Every 10s | Print LUX Data Every 10s | Lua | mit | bhrt/nodeMCU,jmattsson/nodemcu-firmware,cal101/nodemcu-firmware,digitalloggers/nodemcu-firmware,funshine/nodemcu-firmware,flexiti/nodemcu-firmware,ekapujiw2002/nodemcu-firmware,noahchense/nodemcu-firmware,creationix/nodemcu-firmware,dnc40085/nodemcu-firmware,bogvak/nodemcu-firmware,zerog2k/nodemcu-firmware,luizfeliperj/nodemcu-firmware,kbeckmann/nodemcu-firmware,HEYAHONG/nodemcu-firmware,anusornc/nodemcu-firmware,nwf/nodemcu-firmware,yurenyong123/nodemcu-firmware,rickvanbodegraven/nodemcu-firmware,bhrt/nodeMCU,abgoyal/nodemcu-firmware,rowellx68/nodemcu-firmware-custom,anusornc/nodemcu-firmware,fetchbot/nodemcu-firmware,daned33/nodemcu-firmware,vsky279/nodemcu-firmware,remspoor/nodemcu-firmware,danronco/nodemcu-firmware,abgoyal/nodemcu-firmware,bhrt/nodeMCU,jrahlf/nodemcu-firmware,shangwudong/MyNodeMcu,HEYAHONG/nodemcu-firmware,filug/nodemcu-firmware,marcelstoer/nodemcu-firmware,nodemcu/nodemcu-firmware,shangwudong/MyNodeMcu,sowbug/nodemcu-firmware,ciufciuf57/nodemcu-firmware,iotcafe/nodemcu-firmware-lua5.3.0,romanchyla/nodemcu-firmware,nodemcu/nodemcu-firmware,funshine/nodemcu-firmware,xatanais/nodemcu-firmware,zhujunsan/nodemcu-firmware,fetchbot/nodemcu-firmware,devsaurus/nodemcu-firmware,vsky279/nodemcu-firmware,jmattsson/nodemcu-firmware,eku/nodemcu-firmware,yurenyong123/nodemcu-firmware,luizfeliperj/nodemcu-firmware,londry/nodemcu-firmware,digitalloggers/nodemcu-firmware,djphoenix/nodemcu-firmware,petrkr/nodemcu-firmware,marktsai0316/nodemcu-firmware,Kisaua/nodemcu-firmware,nodemcu/nodemcu-firmware,ekapujiw2002/nodemcu-firmware,dnc40085/nodemcu-firmware,zerog2k/nodemcu-firmware,vowstar/nodemcu-firmware,karrots/nodemcu-firmware,flexiti/nodemcu-firmware,kbeckmann/nodemcu-firmware,ktosiu/nodemcu-firmware,Andrew-Collins/nodemcu-firmware,comitservice/nodmcu,eku/nodemcu-firmware,Audumla/audiot-nodemcu-firmware,kbeckmann/nodemcu-firmware,gbox3d/nodemcu-firmware,HEYAHONG/nodemcu-firmware,vowstar/nodemcu-firmware,robertfoss/nodemcu-firmware,dan-cleinmark/nodemcu-firmware,petrkr/nodemcu-firmware,noahchense/nodemcu-firmware,chadouming/nodemcu-firmware,zhujunsan/nodemcu-firmware,mikeller/nodemcu-firmware,sowbug/nodemcu-firmware,SmartArduino/nodemcu-firmware,eku/nodemcu-firmware,gbox3d/nodemcu-firmware,dnc40085/nodemcu-firmware,remspoor/nodemcu-firmware,dscoolx6/MyESP8266,Dejvino/nodemcu-firmware,mikeller/nodemcu-firmware,petrkr/nodemcu-firmware,borromeotlhs/nodemcu-firmware,makefu/nodemcu-firmware,cal101/nodemcu-firmware,nwf/nodemcu-firmware,iotcafe/nodemcu-firmware,shangwudong/MyNodeMcu,rickvanbodegraven/nodemcu-firmware,ktosiu/nodemcu-firmware,benwolfe/nodemcu-firmware,raburton/nodemcu-firmware,vsky279/nodemcu-firmware,FrankX0/nodemcu-firmware,robertfoss/nodemcu-firmware,FrankX0/nodemcu-firmware,dnc40085/nodemcu-firmware,chadouming/nodemcu-firmware,Kisaua/nodemcu-firmware,gbox3d/nodemcu-firmware,luizfeliperj/nodemcu-firmware,kbeckmann/nodemcu-firmware,alonewolfx2/nodemcu-firmware,Alkorin/nodemcu-firmware,radiojam11/nodemcu-firmware,natetrue/nodemcu-firmware,fetchbot/nodemcu-firmware,petrkr/nodemcu-firmware,rowellx68/nodemcu-firmware-custom,comitservice/nodmcu,nodemcu/nodemcu-firmware,jmattsson/nodemcu-firmware,xatanais/nodemcu-firmware,nodemcu/nodemcu-firmware,HEYAHONG/nodemcu-firmware,benwolfe/nodemcu-firmware,marcelstoer/nodemcu-firmware,natetrue/nodemcu-firmware,bhrt/nodeMCU,Dejvino/nodemcu-firmware,AllAboutEE/nodemcu-firmware,nwf/nodemcu-firmware,christakahashi/nodemcu-firmware,filug/nodemcu-firmware,AllAboutEE/nodemcu-firmware,Alkorin/nodemcu-firmware,karrots/nodemcu-firmware,marcelstoer/nodemcu-firmware,oyooyo/nodemcu-firmware,TerryE/nodemcu-firmware,AllAboutEE/nodemcu-firmware,TerryE/nodemcu-firmware,karrots/nodemcu-firmware,rickvanbodegraven/nodemcu-firmware,daned33/nodemcu-firmware,oyooyo/nodemcu-firmware,shangwudong/MyNodeMcu,borromeotlhs/nodemcu-firmware,radiojam11/nodemcu-firmware,nwf/nodemcu-firmware,iotcafe/nodemcu-firmware,shangwudong/MyNodeMcu,petrkr/nodemcu-firmware,Andrew-Collins/nodemcu-firmware,chadouming/nodemcu-firmware,orlando3d/nodemcu-firmware,vsky279/nodemcu-firmware,FelixPe/nodemcu-firmware,klukonin/nodemcu-firmware,bhrt/nodeMCU,FrankX0/nodemcu-firmware,londry/nodemcu-firmware,eku/nodemcu-firmware,funshine/nodemcu-firmware,ojahan/node-mcu-firmware,flexiti/nodemcu-firmware,karrots/nodemcu-firmware,dan-cleinmark/nodemcu-firmware,ruisebastiao/nodemcu-firmware,remspoor/nodemcu-firmware,natetrue/nodemcu-firmware,ciufciuf57/nodemcu-firmware,devsaurus/nodemcu-firmware,devsaurus/nodemcu-firmware,marcelstoer/nodemcu-firmware,FrankX0/nodemcu-firmware,FrankX0/nodemcu-firmware,klukonin/nodemcu-firmware,weera00/nodemcu-firmware,remspoor/nodemcu-firmware,GeorgeHahn/nodemcu-firmware,dscoolx6/MyESP8266,devsaurus/nodemcu-firmware,orlando3d/nodemcu-firmware,Kisaua/nodemcu-firmware,marktsai0316/nodemcu-firmware,abgoyal/nodemcu-firmware,creationix/nodemcu-firmware,radiojam11/nodemcu-firmware,jmattsson/nodemcu-firmware,devsaurus/nodemcu-firmware,TerryE/nodemcu-firmware,SmartArduino/nodemcu-firmware,weera00/nodemcu-firmware,makefu/nodemcu-firmware,djphoenix/nodemcu-firmware,iotcafe/nodemcu-firmware-lua5.3.0,alonewolfx2/nodemcu-firmware,noahchense/nodemcu-firmware,vowstar/nodemcu-firmware,cs8425/nodemcu-firmware,Alkorin/nodemcu-firmware,ruisebastiao/nodemcu-firmware,Audumla/audiot-nodemcu-firmware,jrahlf/nodemcu-firmware,djphoenix/nodemcu-firmware,yurenyong123/nodemcu-firmware,creationix/nodemcu-firmware,christakahashi/nodemcu-firmware,funshine/nodemcu-firmware,digitalloggers/nodemcu-firmware,ruisebastiao/nodemcu-firmware,Audumla/audiot-nodemcu-firmware,FelixPe/nodemcu-firmware,oyooyo/nodemcu-firmware,djphoenix/nodemcu-firmware,filug/nodemcu-firmware,Andrew-Collins/nodemcu-firmware,Alkorin/nodemcu-firmware,karrots/nodemcu-firmware,zerog2k/nodemcu-firmware,SmartArduino/nodemcu-firmware,funshine/nodemcu-firmware,FelixPe/nodemcu-firmware,weera00/nodemcu-firmware,TerryE/nodemcu-firmware,chadouming/nodemcu-firmware,cs8425/nodemcu-firmware,christakahashi/nodemcu-firmware,FelixPe/nodemcu-firmware,TerryE/nodemcu-firmware,fetchbot/nodemcu-firmware,remspoor/nodemcu-firmware,jmattsson/nodemcu-firmware,zhujunsan/nodemcu-firmware,dnc40085/nodemcu-firmware,romanchyla/nodemcu-firmware,marktsai0316/nodemcu-firmware,GeorgeHahn/nodemcu-firmware,luizfeliperj/nodemcu-firmware,makefu/nodemcu-firmware,ojahan/node-mcu-firmware,londry/nodemcu-firmware,ktosiu/nodemcu-firmware,alonewolfx2/nodemcu-firmware,daned33/nodemcu-firmware,christakahashi/nodemcu-firmware,christakahashi/nodemcu-firmware,bogvak/nodemcu-firmware,cal101/nodemcu-firmware,marcelstoer/nodemcu-firmware,sowbug/nodemcu-firmware,iotcafe/nodemcu-firmware,romanchyla/nodemcu-firmware,ciufciuf57/nodemcu-firmware,oyooyo/nodemcu-firmware,Alkorin/nodemcu-firmware,klukonin/nodemcu-firmware,nwf/nodemcu-firmware,benwolfe/nodemcu-firmware,borromeotlhs/nodemcu-firmware,HEYAHONG/nodemcu-firmware,cs8425/nodemcu-firmware,danronco/nodemcu-firmware,dscoolx6/MyESP8266,xatanais/nodemcu-firmware,orlando3d/nodemcu-firmware,FelixPe/nodemcu-firmware,anusornc/nodemcu-firmware,vsky279/nodemcu-firmware,raburton/nodemcu-firmware,rowellx68/nodemcu-firmware-custom,robertfoss/nodemcu-firmware,ojahan/node-mcu-firmware,danronco/nodemcu-firmware,bogvak/nodemcu-firmware,mikeller/nodemcu-firmware,dan-cleinmark/nodemcu-firmware,kbeckmann/nodemcu-firmware,raburton/nodemcu-firmware | |
e5833ce961550042b7407e039f52068443edc9f8 | .config/nvim/lua/user/plugins/gitsigns.lua | .config/nvim/lua/user/plugins/gitsigns.lua | local status_ok, gitsigns = pcall(require, "gitsigns")
if not status_ok then
return
end
gitsigns.setup()
| local status_ok, gitsigns = pcall(require, "gitsigns")
if not status_ok then
return
end
gitsigns.setup({
signs = {
add = { text = "▎" },
change = { text = "▎" },
changedelete = { text = "▎" },
},
numhl = true,
})
| Update bar characters and enable numhl | Update bar characters and enable numhl
| Lua | isc | tarebyte/dotfiles,tarebyte/dotfiles |
854949759011632f994df6af14a583bb9d5238d2 | src/cosy/file/test.lua | src/cosy/file/test.lua | -- These lines are required to correctly run tests:
require "cosy.loader.busted"
require "busted.runner" ()
local File = require "cosy.file"
describe ("Module cosy.file", function ()
local expected_data
local filename
before_each (function ()
filename = os.tmpname ()
expected_data = {
"First line.",
}
end)
after_each (function ()
os.remove( filename )
end)
it ("should save then read data into a file", function ()
File.encode (filename, expected_data)
local result_data = File.decode (filename)
assert.are.same (expected_data, result_data)
end)
it ("should fail by trying to read a non existing file", function ()
os.remove (filename)
local data, err = File.decode (filename)
assert.is_nil (data)
print(err)
assert.is_not_nil (err)
end)
it ("should return nil when reading an empty file", function ()
local file = io.open (filename, "w")
file:close ()
local data, err = File.decode (filename)
assert.is_nil (data)
assert.is_nil (err)
end)
end)
| -- These lines are required to correctly run tests:
require "cosy.loader.busted"
require "busted.runner" ()
local File = require "cosy.file"
describe ("Module cosy.file", function ()
local expected_data
local filename
before_each (function ()
filename = os.tmpname ()
expected_data = {
"First line.",
}
end)
after_each (function ()
os.remove( filename )
end)
it ("should save then read data into a file", function ()
File.encode (filename, expected_data)
local result_data = File.decode (filename)
assert.are.same (expected_data, result_data)
end)
it ("should fail by trying to read a non existing file", function ()
os.remove (filename)
local data, err = File.decode (filename)
assert.is_nil (data)
assert.is_not_nil (err)
end)
it ("should return nil when reading an empty file", function ()
local file = io.open (filename, "w")
file:close ()
local data, err = File.decode (filename)
assert.is_nil (data)
assert.is_nil (err)
end)
end)
| Remove print that was used for debug. | Remove print that was used for debug.
| Lua | mit | CosyVerif/library,CosyVerif/library,CosyVerif/library |
5c0b6c9790358c3d42c45298b04efae6458663b5 | mock/asset/PhysicsBodyDef.lua | mock/asset/PhysicsBodyDef.lua | module 'mock'
CLASS: PhysicsBodyDef ()
:MODEL{
Field 'tag' :string();
'----';
Field 'bodyType' :enum( EnumPhysicsBodyType );
'----';
Field 'allowSleep' :boolean();
Field 'isBullet' :boolean();
Field 'fixedRotation' :boolean();
'----';
Field 'gravityScale' :number();
Field 'linearDamping' :number();
Field 'angularDamping' :number();
'----';
Field 'defaultMaterial' :asset( 'physics_material' )
}
function PhysicsBodyDef:__init()
self.tag = ''
self.bodyType = 'dynamic'
self.allowSleep = true
self.isBullet = false
self.fixedRotation = false
self.gravityScale = 1
self.linearDamping = 1
self.angularDamping = 1
self.defaultMaterial = false
end
local defaultBodyDef = PhysicsBodyDef()
defaultBodyDef.tag = '_default'
function getDefaultPhysicsBodyDef()
return defaultBodyDef
end
--------------------------------------------------------------------
local function loadPhysicsBodyDef( node )
local data = mock.loadAssetDataTable( node:getObjectFile('def') )
local def = mock.deserialize( nil, data )
return def
end
registerAssetLoader( 'physics_body_def', loadPhysicsBodyDef )
| module 'mock'
CLASS: PhysicsBodyDef ()
:MODEL{
Field 'tag' :string();
'----';
Field 'bodyType' :enum( EnumPhysicsBodyType );
'----';
Field 'allowSleep' :boolean();
Field 'isBullet' :boolean();
Field 'fixedRotation' :boolean();
'----';
Field 'gravityScale' :number();
Field 'linearDamping' :number();
Field 'angularDamping' :number();
'----';
Field 'defaultMaterial' :asset( 'physics_material' )
}
function PhysicsBodyDef:__init()
self.tag = ''
self.bodyType = 'dynamic'
self.allowSleep = true
self.isBullet = false
self.fixedRotation = false
self.gravityScale = 1
self.linearDamping = 1
self.angularDamping = 1
self.defaultMaterial = false
end
local defaultBodyDef = PhysicsBodyDef()
defaultBodyDef.tag = '_default'
function getDefaultPhysicsBodyDef()
return table.simplecopy(defaultBodyDef)
end
--------------------------------------------------------------------
local function loadPhysicsBodyDef( node )
local data = mock.loadAssetDataTable( node:getObjectFile('def') )
local def = mock.deserialize( nil, data )
return def
end
registerAssetLoader( 'physics_body_def', loadPhysicsBodyDef )
| Return copy of default body def | Return copy of default body def
| Lua | mit | tommo/mock |
ff47eda7d211315b1573e73cbd3692ed3ad49469 | build/scripts/tools/assimp.lua | build/scripts/tools/assimp.lua | TOOL.Name = "Assimp"
TOOL.Directory = "../plugins/Assimp"
TOOL.Kind = "Plugin"
TOOL.TargetDirectory = "../SDK/lib"
TOOL.Includes = {
"../include",
"../plugins/Assimp"
}
TOOL.Files = {
"../plugins/Assimp/**.hpp",
"../plugins/Assimp/**.inl",
"../plugins/Assimp/**.cpp"
}
TOOL.Libraries = {
"NazaraCore",
"NazaraUtility",
"assimp"
}
| TOOL.Name = "Assimp"
TOOL.Directory = "../plugins/Assimp"
TOOL.Kind = "Plugin"
TOOL.TargetDirectory = "../SDK/lib"
TOOL.Includes = {
"../extlibs/include",
"../include",
"../plugins/Assimp"
}
TOOL.Files = {
"../plugins/Assimp/**.hpp",
"../plugins/Assimp/**.inl",
"../plugins/Assimp/**.cpp"
}
TOOL.Libraries = {
"NazaraCore",
"NazaraUtility",
"assimp"
}
| Fix compilation error because of missing includes | Build/Assimp: Fix compilation error because of missing includes
Former-commit-id: dba6d044f3575ad69b03d56aa5a91c22671d97f5 [formerly b7093d6e2a1e21eccbe3ee6bb54265da98c49001]
Former-commit-id: d229e251df3032d9d60357fa12276c24eda8db27 | Lua | mit | DigitalPulseSoftware/NazaraEngine |
8d1f708bc2e4cd026f00f642064ee9b54b104cf5 | conf/nbsearch/update-index.lua | conf/nbsearch/update-index.lua | update_index = {
maxProcesses = 1,
delay = 1,
onCreate = "/opt/nbsearch/update-index ^pathname",
onModify = "/opt/nbsearch/update-index ^pathname",
onMove = "/opt/nbsearch/update-index ^d.pathname",
}
settings {
logfile = "/tmp/lsyncd.log",
statusFile = "/tmp/lsyncd.status",
nodaemon = false,
}
sync{update_index, source="/home/" .. os.getenv("NB_USER")}
| update_index = {
maxProcesses = 1,
delay = 1,
onCreate = "/opt/nbsearch/update-index ^pathname",
onModify = "/opt/nbsearch/update-index ^pathname",
onMove = "/opt/nbsearch/update-index ^d.pathname",
}
settings {
logfile = "/tmp/lsyncd.log",
statusFile = "/tmp/lsyncd.status",
nodaemon = false,
}
sync{update_index, source=os.getenv("NBSEARCHDB_BASE_DIR") or ("/home/" .. os.getenv("NB_USER"))}
| Fix lsyncd script to use NBSEARCHDB_BASE_DIR | Fix lsyncd script to use NBSEARCHDB_BASE_DIR
| Lua | bsd-3-clause | NII-cloud-operation/Jupyter-LC_docker,NII-cloud-operation/Jupyter-LC_docker |
318269c6f52030fced2997153db3d8abca5ad13b | gumbo/Buffer.lua | gumbo/Buffer.lua | local Buffer = {}
Buffer.__index = Buffer
function Buffer:write(...)
local n = #self
for i = 1, select("#", ...) do
self[n+i] = select(i, ...)
end
end
function Buffer:__tostring()
return table.concat(self)
end
return function()
return setmetatable({}, Buffer)
end
| local Buffer = {}
Buffer.__index = Buffer
function Buffer:write(...)
local length = self.length
for i = 1, select("#", ...) do
length = length + 1
self[length] = select(i, ...)
end
self.length = length
end
function Buffer:__tostring()
return table.concat(self)
end
return function()
return setmetatable({length = 0}, Buffer)
end
| Store buffer length in a field instead of using the length operator | Store buffer length in a field instead of using the length operator
| Lua | apache-2.0 | craigbarnes/lua-gumbo,craigbarnes/lua-gumbo,craigbarnes/lua-gumbo |
748d47daaaa70cafce3d49064b26aef930e571fb | modulefiles/Core/root/6.06-02-py34.lua | modulefiles/Core/root/6.06-02-py34.lua | help(
[[
This module loads ROOT 6.06-02 with python 3.4 support into the environment. ROOT is a
physics analysis application.
]])
whatis("Loads the ROOT data analysis environmemt")
local version = "6.06-02-py34"
local base = "/cvmfs/oasis.opensciencegrid.org/osg/modules/root/"..version
pushenv("ROOTSYS", base)
prepend_path("PATH", pathJoin(base, "bin"))
prepend_path("LD_LIBRARY_PATH", pathJoin(base, "lib/root"))
prepend_path("CPATH", pathJoin(base, "include"))
prepend_path("LIBRARY_PATH", pathJoin(base, "lib"))
prepend_path("PYTHONPATH", pathJoin(base, "lib", "root"))
d('fftw/3.3.4-gromacs')
load('gcc/4.9.2')
family('root')
| help(
[[
This module loads ROOT 6.06-02 with python 3.4 support into the environment. ROOT is a
physics analysis application.
]])
whatis("Loads the ROOT data analysis environmemt")
local version = "6.06-02-py34"
local base = "/cvmfs/oasis.opensciencegrid.org/osg/modules/root/"..version
pushenv("ROOTSYS", base)
prepend_path("PATH", pathJoin(base, "bin"))
prepend_path("LD_LIBRARY_PATH", pathJoin(base, "lib/root"))
prepend_path("CPATH", pathJoin(base, "include"))
prepend_path("LIBRARY_PATH", pathJoin(base, "lib"))
prepend_path("PYTHONPATH", pathJoin(base, "lib", "root"))
load('gcc/4.9.2')
family('root')
| Fix load in root 6.0.6 module | Fix load in root 6.0.6 module
| Lua | apache-2.0 | OSGConnect/modulefiles,OSGConnect/modulefiles,OSGConnect/modulefiles |
e5ec7063d29602e256bf9f6a64a975dd50c1bb33 | Modules/Shared/Utility/NumberRangeUtils.lua | Modules/Shared/Utility/NumberRangeUtils.lua | ---
-- @module NumberRangeUtils
-- @author Quenty
local require = require(game:GetService("ReplicatedStorage"):WaitForChild("Nevermore"))
local NumberRangeUtils = {}
function NumberRangeUtils.scale(range, scale)
return NumberRange.new(range.Min*scale, range.Max*scale)
end
return NumberRangeUtils | ---
-- @module NumberRangeUtils
local NumberRangeUtils = {}
function NumberRangeUtils.scale(range, scale)
return NumberRange.new(range.Min*scale, range.Max*scale)
end
return NumberRangeUtils | Fix number range lutils syntax | Fix number range lutils syntax
| Lua | mit | Quenty/NevermoreEngine,Quenty/NevermoreEngine,Quenty/NevermoreEngine |
84962c647f8a8d487e6e574bf3278fdb28af4d43 | .config/awesome/widgets/brightness.lua | .config/awesome/widgets/brightness.lua | local awful = require("awful")
local wibox = require("wibox")
local M = {}
function M.getBrightness()
return tonumber(awful.util.pread("xbacklight -get"))
end
function M.changeBrightness(x)
awful.util.pread("xbacklight -inc " .. tostring(x))
end
function M.update(reg)
-- reg.callback(reg.widget, M.getBrightness())
reg.widget:set_text(tostring(math.ceil(M.getBrightness())) .. "%")
end
local function creator(args)
local args = args or {}
local reg = {
widget = wibox.widget.textbox(),
-- callback = callback,
timer = timer({ timeout = args.interval or 5 })
}
reg.timer:connect_signal("timeout", function() M.update(reg) end)
reg.timer:start()
M.update(reg)
return reg
end
function M.attach(widget, reg)
widget:buttons(awful.util.table.join(
awful.button({}, 4, function()
M.changeBrightness(5)
M.update(reg)
end),
awful.button({}, 5, function()
M.changeBrightness(-5)
M.update(reg)
end)
))
end
return setmetatable(M, {__call = function(_,...) return creator(...) end})
| local awful = require("awful")
local wibox = require("wibox")
local M = {}
function M.getBrightness(device)
-- xbacklight causes lags
-- return tonumber(awful.util.pread("xbacklight -get"))
return tonumber(awful.util.pread("cat /sys/class/backlight/" .. device .. "/brightness")) / 10
end
function M.changeBrightness(x)
awful.util.pread("xbacklight -inc " .. tostring(x))
end
function M.update(reg)
-- reg.callback(reg.widget, M.getBrightness())
reg.widget:set_text(tostring(math.ceil(M.getBrightness(reg.device))) .. "%")
end
local function creator(args)
local args = args or {}
local reg = {
widget = wibox.widget.textbox(),
device = args.device or "intel_backlight",
-- callback = callback,
timer = timer({ timeout = args.interval or 11 })
}
reg.timer:connect_signal("timeout", function() M.update(reg) end)
reg.timer:start()
M.update(reg)
return reg
end
function M.attach(widget, reg)
widget:buttons(awful.util.table.join(
awful.button({}, 4, function()
M.changeBrightness(5)
M.update(reg)
end),
awful.button({}, 5, function()
M.changeBrightness(-5)
M.update(reg)
end)
))
end
return setmetatable(M, {__call = function(_,...) return creator(...) end})
| Fix periodic lags caused by xbacklight | Fix periodic lags caused by xbacklight
Seems like some update broke/changed something that causes xbacklight
to produce a short screen freeze when called.
To work around this issue the brightness value from /sys is used for
polling.
| Lua | mit | mphe/dotfiles,mphe/dotfiles,mall0c/dotfiles,mphe/dotfiles,mphe/dotfiles,mphe/dotfiles,mphe/dotfiles,mall0c/dotfiles |
ecda1e871740290f069938d55ebf2c5c523a564a | devilspie2/desktop-term.lua | devilspie2/desktop-term.lua | if (get_window_role() == "desktop-term") then
set_window_geometry(88,24,1536,1024);
undecorate_window();
set_skip_pager(true);
set_skip_tasklist(true);
set_window_type("WINDOW_TYPE_DESKTOP");
set_window_below();
pin_window();
stick_window();
end
| Add devilspie config for desktop terminal | Add devilspie config for desktop terminal
| Lua | mit | coderstephen/dotfiles,sagebind/dotfiles | |
6761bbfd17863083eed426510bb490a94d301073 | test/resources/prosody.cfg.lua | test/resources/prosody.cfg.lua | modules_enabled = {
"roster";
"saslauth";
"tls";
"dialback";
"disco";
"private";
"vcard";
"version";
"uptime";
"time";
"ping";
"pep";
"register";
"admin_adhoc";
"posix";
"bosh";
"websocket";
};
allow_registration = true;
daemonize = true;
consider_websocket_secure = true;
consider_bosh_secure = true;
pidfile = "/var/run/prosody/prosody.pid";
c2s_require_encryption = false
authentication = "internal_plain"
log = {
-- Log files (change 'info' to 'debug' for debug logs):
info = "/var/log/prosody/prosody.log";
error = "/var/log/prosody/prosody.err";
-- Syslog:
{ levels = { "error" }; to = "syslog"; };
}
VirtualHost "localhost"
enabled = true
ssl = {
key = "/etc/prosody/certs/example.com.key";
certificate = "/etc/prosody/certs/example.com.crt";
}
Component "component.localhost"
component_secret = "mysecretcomponentpassword"
| modules_enabled = {
"roster";
"saslauth";
"tls";
"dialback";
"disco";
"private";
"vcard";
"version";
"uptime";
"time";
"ping";
"pep";
"register";
"admin_adhoc";
"posix";
"bosh";
"websocket";
};
allow_registration = true;
daemonize = true;
consider_websocket_secure = true;
consider_bosh_secure = true;
cross_domain_bosh = true;
pidfile = "/var/run/prosody/prosody.pid";
c2s_require_encryption = false
authentication = "internal_plain"
log = {
-- Log files (change 'info' to 'debug' for debug logs):
info = "/var/log/prosody/prosody.log";
error = "/var/log/prosody/prosody.err";
-- Syslog:
{ levels = { "error" }; to = "syslog"; };
}
VirtualHost "localhost"
enabled = true
ssl = {
key = "/etc/prosody/certs/example.com.key";
certificate = "/etc/prosody/certs/example.com.crt";
}
Component "component.localhost"
component_secret = "mysecretcomponentpassword"
| Make prosody send CORS headers | Make prosody send CORS headers
| Lua | isc | xmppjs/xmpp.js,mweibel/node-xmpp-client,ggozad/node-xmpp,ggozad/node-xmpp,capablemonkey/node-xmpp-client,node-xmpp/node-xmpp,xmppjs/xmpp.js,capablemonkey/node-xmpp-client,node-xmpp/node-xmpp |
64b68fbc9346cd5edb0c40f220c7a0f3f2a02817 | src/conf.lua | src/conf.lua | function love.conf(t)
t.title = "Journey to the Center of Hawkthorne v0.0.34"
t.author = "Kyle Conroy"
t.version = "0.8.0"
t.identity = "hawkthorne"
t.screen.width = 912
t.screen.height = 528
t.screen.fullscreen = false
t.console = false
t.modules.physics = false
t.modules.joystick = false
t.release = false
end
| function love.conf(t)
t.title = "Journey to the Center of Hawkthorne v0.0.35"
t.author = "Kyle Conroy"
t.version = "0.8.0"
t.identity = "hawkthorne"
t.screen.width = 912
t.screen.height = 528
t.screen.fullscreen = false
t.console = false
t.modules.physics = false
t.modules.joystick = false
t.release = false
end
| Bump release version to v0.0.35 | Bump release version to v0.0.35
| Lua | mit | hawkthorne/hawkthorne-server-lua,hawkthorne/hawkthorne-client-lua,hawkthorne/hawkthorne-server-lua,hawkthorne/hawkthorne-client-lua |
617aa381a8ad85a94e56efeedb1082e36966a44a | src/conf.lua | src/conf.lua | function love.conf(t)
t.title = "Journey to the Center of Hawkthorne v0.0.35"
t.author = "Kyle Conroy"
t.version = "0.8.0"
t.identity = "hawkthorne"
t.screen.width = 912
t.screen.height = 528
t.screen.fullscreen = false
t.console = false
t.modules.physics = false
t.modules.joystick = false
t.release = false
end
| function love.conf(t)
t.title = "Journey to the Center of Hawkthorne v0.0.36"
t.author = "Kyle Conroy"
t.version = "0.8.0"
t.identity = "hawkthorne"
t.screen.width = 912
t.screen.height = 528
t.screen.fullscreen = false
t.console = false
t.modules.physics = false
t.modules.joystick = false
t.release = false
end
| Bump release version to v0.0.36 | Bump release version to v0.0.36
| Lua | mit | hawkthorne/hawkthorne-client-lua,hawkthorne/hawkthorne-server-lua,hawkthorne/hawkthorne-server-lua,hawkthorne/hawkthorne-client-lua |
36374c33fe67e06ff1c9bf0664b73cd28172e180 | perf/local_thr_poll.lua | perf/local_thr_poll.lua | -- Copyright (c) 2010 Aleksey Yeschenko <aleksey@yeschenko.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, distribute, sublicense, and/or sell
-- copies of the Software, and to permit persons to whom the Software is
-- furnished to do so, subject to the following conditions:
--
-- The above copyright notice and this permission notice shall be included in
-- all copies or substantial portions of the Software.
--
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-- THE SOFTWARE.
if not arg[3] then
print("usage: lua local_thr.lua <bind-to> <message-size> <message-count>")
os.exit()
end
local bind_to = arg[1]
local message_size = tonumber(arg[2])
local message_count = tonumber(arg[3])
local zmq = require"zmq"
local z_poller = require"zmq.poller"
local z_NOBLOCK = zmq.NOBLOCK
local poller = z_poller(64)
local ctx = zmq.init(1)
local s = ctx:socket(zmq.SUB)
s:setopt(zmq.SUBSCRIBE, "");
s:bind(bind_to)
print(string.format("message size: %i [B]", message_size))
print(string.format("message count: %i", message_count))
local msg
msg = zmq.zmq_msg_t()
local cnt = 0
poller:add(s, zmq.POLLIN, function(sock)
while s:recv_msg(msg, z_NOBLOCK) do
--assert(msg:size() == message_size, "Invalid message size")
cnt = cnt + 1
if cnt == message_count then
poller:stop()
end
end
end)
-- wait for first message
assert(s:recv_msg(msg))
cnt = 1
local timer = zmq.stopwatch_start()
poller:start()
local elapsed = timer:stop()
s:close()
ctx:term()
if elapsed == 0 then elapsed = 1 end
local throughput = message_count / (elapsed / 1000000)
local megabits = throughput * message_size * 8 / 1000000
print(string.format("mean throughput: %i [msg/s]", throughput))
print(string.format("mean throughput: %.3f [Mb/s]", megabits))
| Add zmq.poller version of local_thr.lua to perf/ folder. | Add zmq.poller version of local_thr.lua to perf/ folder.
| Lua | mit | Neopallium/lua-zmq,azukiapp/lua-zmq | |
bd991f3fc920eb7d5b7dd12546b9de4ee1b50a87 | test/array-nested-struct-access.lua | test/array-nested-struct-access.lua | #! /usr/bin/env lua
--
-- array-nested-struct-access.lua
-- Copyright (C) 2015 Adrian Perez <aperez@igalia.com>
--
-- Distributed under terms of the MIT license.
--
local triangle = require("eris").load("libtest").triangle
assert.Not.Nil(triangle)
assert.Equal(3, #triangle)
assert.Equal(1, triangle[1].x)
assert.Equal(1, triangle[1].y)
assert.Equal(2, triangle[2].x)
assert.Equal(3, triangle[2].y)
assert.Equal(1, triangle[3].x)
assert.Equal(3, triangle[3].y)
triangle[2].x = 3
assert.Equal(3, triangle[2].x)
| Add missing array-nested-struct-acess test case | Add missing array-nested-struct-acess test case
| Lua | mit | aperezdc/lua-eol,aperezdc/eris,aperezdc/eris,aperezdc/lua-eol | |
5e2142ba6d411d1f536cdcfeb5033a7cb25d0e13 | SVUI_Skins/components/blizzard/orderhalltalents.lua | SVUI_Skins/components/blizzard/orderhalltalents.lua | --[[
##############################################################################
S V U I By: Failcoder
Order Hall Talents By: JoeyMagz
##############################################################################
--]]
--[[ GLOBALS ]]--
local _G = _G;
local unpack = _G.unpack;
local select = _G.select;
local ipairs = _G.ipairs;
local pairs = _G.pairs;
local type = _G.type;
--[[ ADDON ]]--
local SV = _G['SVUI'];
local L = SV.L;
local MOD = SV.Skins;
local Schema = MOD.Schema;
--[[
##########################################################
OrderHallTalents
##########################################################
]]--
local function OrderHallTalents()
if SV.db.Skins.blizzard.enable ~= true or SV.db.Skins.blizzard.orderhalltalent ~= true then
return;
end
local frame = OrderHallTalentFrame;
-- Set API
SV.API:Set("Window", frame, true);
SV.API:Set("Button", frame.BackButton, nil, true);
--Reposition the back button slightly (if there is one)
--This should only occur inside the Chromie scenario
frame.BackButton:SetPoint("BOTTOMRIGHT", frame, "BOTTOMRIGHT", -15, 10);
-- Add the order hall resource icon if inside the order hall.
local inOrderHall = C_Garrison.IsPlayerInGarrison(LE_GARRISON_TYPE_7_0);
if (inOrderHall) then
frame.currencyButton = CreateFrame("Frame", nil, frame);
frame.currencyButton:SetPoint("TOPRIGHT", frame, "TOPRIGHT", -85, -35);
frame.currencyButton:SetHeight(20);
frame.currencyButton:SetWidth(20);
frame.currencyButton:CreateTexture("resources");
resources:SetAllPoints();
resources:SetTexture("Interface\\ICONS\\INV_Garrison_Resource");
end
-- Movable Window
frame:SetMovable(true);
frame:EnableMouse(true);
frame:RegisterForDrag("LeftButton");
frame:SetScript("OnDragStart", frame.StartMoving);
frame:SetScript("OnDragStop", frame.StopMovingOrSizing);
end
--[[
##########################################################
MOD LOADING
##########################################################
]]--
MOD:SaveBlizzardStyle("Blizzard_OrderHallUI",OrderHallTalents)
| Create - Order Hall Talent Skin | Create - Order Hall Talent Skin | Lua | mit | FailcoderAddons/supervillain-ui,finalsliver/supervillain-ui | |
e9a852e3207fa8c6f6f55aafba3a9dd45df72da2 | lua/queue_message.lua | lua/queue_message.lua | local ns, queue, id, message = ARGV[1], ARGV[2], ARGV[3], ARGV[4]
redis.call('SADD', ns..':queues', queue)
redis.call('HSET', ns..':'..queue..':messages', id, message)
if redis.call('SISMEMBER', ns..':'..queue..':queued_ids', id) == 0 then
redis.call('SADD', ns..':'..queue..':queued_ids', id)
redis.call('LPUSH', ns..':'..queue..':queue', id)
end
| local ns, queue, id, message = ARGV[1], ARGV[2], ARGV[3], ARGV[4]
redis.call('SADD', ns..':queues', queue)
redis.call('HSET', ns..':'..queue..':messages', id, message)
if redis.call('SISMEMBER', ns..':'..queue..':queued_ids', id) == 0 then
redis.call('ZREM', ns..':schedule', queue..'||'..id)
redis.call('SADD', ns..':'..queue..':queued_ids', id)
redis.call('LPUSH', ns..':'..queue..':queue', id)
end
| Remove message from schedule when queueing | Remove message from schedule when queueing
| Lua | mit | mgdigital/BusQue |
af81b5fe0e7de8496769414669b3d3b00ea2e6e1 | src/statistics.lua | src/statistics.lua | local Statsd = require "statsd"
local module = {}
local statsd
-- create statsd object, which will open up a persistent port
if statsd_host and statsd_port then
local namespace = statsd_namespace
if namespace then
statsd = Statsd({
host = statsd_host,
port = statsd_port,
namespace = namespace
})
else
statsd = Statsd({
host = statsd_host,
port = statsd_port
})
end
else
ngx.log(ngx.INFO, "==== Statsd logging not configured:")
end
--
-- log metrics to statsd
--
local function log(metric)
if statsd then
local met
if statsd_prefix then
met = statsd_prefix .. "." .. metric
else
met = metric
end
local status, err = pcall(function() statsd:increment( met, 1) end)
if status == false then
ngx.log(ngx.DEBUG, "==== unable to log to statsd: " .. err)
end
end
end
module.log = log
return module
| local Statsd = require "statsd"
local module = {}
local statsd
-- create statsd object, which will open up a persistent port
if statsd_host and statsd_port then
local namespace = statsd_namespace
if namespace then
statsd = Statsd({
host = statsd_host,
port = statsd_port,
namespace = namespace
})
else
statsd = Statsd({
host = statsd_host,
port = statsd_port
})
end
else
ngx.log(ngx.INFO, "==== Statsd logging not configured")
end
--
-- log metrics to statsd
--
local function log(metric)
if statsd then
local met
if statsd_prefix then
met = statsd_prefix .. "." .. metric
else
met = metric
end
local status, err = pcall(function() statsd:increment( met, 1) end)
if status == false then
ngx.log(ngx.DEBUG, "==== unable to log to statsd: " .. err)
end
end
end
module.log = log
return module
| Add Statsd Logging for Login Success/Failure | Add Statsd Logging for Login Success/Failure
Add Statsd Logging for Login Success/Failure
Also revert the Lua Nginx module to version prior to commit that is causing
random test failures
https://gist.github.com/wkimeria/e4d0686194e71eaefcd6
| Lua | mit | sdgdsffdsfff/ngx_borderpatrol,lookout/ngx_borderpatrol,trane/ngx_borderpatrol,rwygand/ngx_borderpatrol,trane/ngx_borderpatrol,sdgdsffdsfff/ngx_borderpatrol,rwygand/ngx_borderpatrol,rwygand/ngx_borderpatrol,lookout/ngx_borderpatrol,sdgdsffdsfff/ngx_borderpatrol,wkimeria/ngx_borderpatrol,trane/ngx_borderpatrol,wkimeria/ngx_borderpatrol,wkimeria/ngx_borderpatrol,lookout/ngx_borderpatrol |
a014cbcccafade3930dd00f3997ab2d386589641 | examples/fs-coroutines.lua | examples/fs-coroutines.lua | local FS = require('fs');
local co
co = coroutine.create(function (filename)
print("opening...")
local err, fd = FS.open(co, filename, 'r', "0644")
p("on_open", {err=err, fd=fd})
if (err) then return end
print("fstatting...")
local err, stat = FS.fstat(co, fd)
p("stat", {err=err, stat=stat})
if (err) then return end
print("reading...")
local offset = 0
repeat
local err, chunk = FS.read(co, fd, offset, 128)
local length = #chunk
p("on_read", {err=err, chunk=chunk, offset=offset, length=length})
if (err) then return end
offset = offset + length
until length == 0
print("closing...")
local err = FS.close(co, fd)
p("on_close", {err=err})
if (err) then return end
end)
coroutine.resume(co, "license.txt")
| local FS = require('fs');
-- Simple wrapper for coroutine steps
function fiber(fn)
local co = coroutine.create(fn)
assert(coroutine.resume(co, co))
end
fiber(function (co)
print("opening...")
local err, fd = FS.open(co, "license.txt", "r", "0644")
p("on_open", {err=err, fd=fd})
if (err) then return end
print("fstatting...")
local err, stat = FS.fstat(co, fd)
p("stat", {err=err, stat=stat})
if (err) then return end
print("reading...")
local offset = 0
repeat
local err, chunk = FS.read(co, fd, offset, 128)
local length = #chunk
p("on_read", {err=err, chunk=chunk, offset=offset, length=length})
if (err) then return end
offset = offset + length
until length == 0
print("closing...")
local err = FS.close(co, fd)
p("on_close", {err=err})
if (err) then return end
end)
| Add a saner coroutine wrapper in the example | Add a saner coroutine wrapper in the example
Change-Id: I71132ca8b51219a1619a46c9f1e63da9bcacee02
| Lua | apache-2.0 | DBarney/luvit,kaustavha/luvit,rjeli/luvit,kaustavha/luvit,DBarney/luvit,sousoux/luvit,bsn069/luvit,luvit/luvit,zhaozg/luvit,rjeli/luvit,boundary/luvit,GabrielNicolasAvellaneda/luvit-upstream,GabrielNicolasAvellaneda/luvit-upstream,kaustavha/luvit,sousoux/luvit,boundary/luvit,bsn069/luvit,boundary/luvit,sousoux/luvit,GabrielNicolasAvellaneda/luvit-upstream,bsn069/luvit,luvit/luvit,boundary/luvit,zhaozg/luvit,sousoux/luvit,AndrewTsao/luvit,DBarney/luvit,sousoux/luvit,GabrielNicolasAvellaneda/luvit-upstream,sousoux/luvit,AndrewTsao/luvit,connectFree/lev,AndrewTsao/luvit,boundary/luvit,connectFree/lev,rjeli/luvit,brimworks/luvit,rjeli/luvit,DBarney/luvit,boundary/luvit |
a1a7b7d7f85a6ee0f06637ed199c14aba5c6e37e | spec/wrap_spec.lua | spec/wrap_spec.lua | local wrap = require "wrap"
local wrapDefs = wrap.wrapMachineDefs
describe("Unit definition wrapper", function()
it("should error if no processing function is provided", function()
local noProcessingUnit = {
name = 'Bad Unit',
knobs = {}
}
assert.has_error(function() wrapDefs(noProcessingUnit) end,
"Unit `Bad Unit` has no processing function")
end)
end)
| local wrap = require "wrap"
local wrapDefs = wrap.wrapMachineDefs
describe("Unit definition wrapper", function()
it("should error if no processing function is provided", function()
local noProcessingUnit = {
name = 'Bad Unit',
knobs = {}
}
assert.has_error(function() wrapDefs(noProcessingUnit) end,
"Unit `Bad Unit` has no processing function")
end)
it("should correctly wrap a mono effect", function()
local inverterDefs = {
name = 'Inverter',
knobs = {},
processOneSample = function(state, sample) return -sample end
}
local inverterUnit = wrapDefs(inverterDefs).new()
local samples = {0,-0.5,-1,-5, 0.5, 1}
local expected = {0, 0.5, 1, 5,-0.5,-1}
inverterUnit.process(samples)
assert.are.same(samples, expected)
end)
it("should correctly wrap a stereo effect", function()
local swapperDefs = {
name = 'Stereo Swapper',
knobs = {},
processSamplePair = function(state, l, r) return r, l end
}
local swapperUnit = wrapDefs(swapperDefs).new()
local samples = {0, 1, 0.25, 0.5, -1, 0}
local expected = {1, 0, 0.5, 0.25, 0, -1}
swapperUnit.process(samples)
assert.are.same(samples, expected)
end)
pending("test knob value clamping (max/min)", function() end)
pending("test onChange callbacks", function() end)
end)
| Add two more wrapper tests and placeholders | Add two more wrapper tests and placeholders
One test for wrapping a mono effect and one for a stereo effect.
| Lua | mit | graue/luasynth |
daa0021c16e782a2869fd29cbae0634e0bedadfa | home/.config/nvim/lua/plugins/browsing.lua | home/.config/nvim/lua/plugins/browsing.lua | return function(use)
use {
'kyazdani42/nvim-tree.lua',
requires = 'kyazdani42/nvim-web-devicons',
setup = function()
vim.g.nvim_tree_window_picker_chars = 'aoeuidhtnsgcrld;qjkxbmwv'
vim.g.nvim_tree_highlight_opened_files = 0 -- breaks icon color
vim.g.nvim_tree_indent_markers = 1
vim.g.nvim_tree_add_trailing = 1
end,
config = function()
local tree_cb = require'nvim-tree.config'.nvim_tree_callback
-- https://github.com/kyazdani42/nvim-tree.lua/blob/master/doc/nvim-tree-lua.txt#L505
require'nvim-tree'.setup {
open_on_setup = false,
open_on_tab = false,
update_to_buf_dir = {
enable = false,
auto_open = false
},
filters = {
custom = { '.git', 'node_modules', '.cache', 'dist', 'tmp', 'declarations' }
},
diagnostics = {
-- lsp info
enable = true,
},
view = {
width = 40,
auto_resize = true,
mappings = {
list = {
{ key = "<Tab>", cb = tree_cb("preview") }
}
}
}
}
end
}
end
| return function(use)
use {
'kyazdani42/nvim-tree.lua',
requires = 'kyazdani42/nvim-web-devicons',
setup = function()
vim.g.nvim_tree_highlight_opened_files = 0 -- breaks icon color
vim.g.nvim_tree_add_trailing = 1
end,
config = function()
local tree_cb = require'nvim-tree.config'.nvim_tree_callback
-- https://github.com/kyazdani42/nvim-tree.lua/blob/master/doc/nvim-tree-lua.txt#L505
require'nvim-tree'.setup {
open_on_setup = false,
open_on_tab = false,
update_to_buf_dir = {
enable = false,
auto_open = false
},
filters = {
custom = { '.git', 'node_modules', '.cache', 'dist', 'tmp', 'declarations' }
},
diagnostics = {
-- lsp info
enable = true,
},
view = {
width = 40,
auto_resize = true,
mappings = {
list = {
{ key = "<Tab>", cb = tree_cb("preview") }
}
}
},
renderer = {
indent_markers = {
enable = true
}
},
actions = {
open_file = {
window_picker = {
chars = "aoeuidhtnsgcrld;qjkxbmwv"
}
}
}
}
end
}
end
| Update config to not use deprecated nvim-tree options | Update config to not use deprecated nvim-tree options
| Lua | mit | NullVoxPopuli/dotfiles,NullVoxPopuli/dotfiles,NullVoxPopuli/dotfiles |
3a8c1b131c2aa65fb71f2728d4b7252a4d178bd6 | nn/LogSoftMaxInplace.lua | nn/LogSoftMaxInplace.lua | -- Authors: Tomas Kocisky
--
-- Customizes the nn.LogSoftMax to be computed inplace
--
local LogSoftMaxInplace, parent = torch.class('oxnn.LogSoftMaxInplace', 'nn.LogSoftMax')
function LogSoftMaxInplace:__init(outputInplace, gradInputInplace)
parent.__init(self)
self.outputInplace = outputInplace
self.gradInputInplace = gradInputInplace
end
function LogSoftMaxInplace:updateOutput(input)
if self.outputInplace then
assert(input:isContiguous())
self.output = input
end
return input.nn.LogSoftMax_updateOutput(self, input)
end
function LogSoftMaxInplace:updateGradInput(input, gradOutput)
if self.gradInputInplace then
assert(gradOutput:isContiguous())
self.gradInput = gradOutput
end
return input.nn.LogSoftMax_updateGradInput(self, input, gradOutput)
end
| -- Authors: Tomas Kocisky
--
-- Customizes the nn.LogSoftMax to be computed inplace
--
local LogSoftMaxInplace, parent = torch.class('oxnn.LogSoftMaxInplace', 'nn.LogSoftMax')
function LogSoftMaxInplace:__init(outputInplace, gradInputInplace)
parent.__init(self)
self.outputInplace = outputInplace
self.gradInputInplace = gradInputInplace
end
function LogSoftMaxInplace:updateOutput(input)
if self.outputInplace then
assert(input:isContiguous())
self.output = input
end
input.THNN.LogSoftMax_updateOutput(
input:cdata(),
self.output:cdata()
)
return self.output
end
function LogSoftMaxInplace:updateGradInput(input, gradOutput)
if self.gradInputInplace then
assert(gradOutput:isContiguous())
self.gradInput = gradOutput
end
input.THNN.LogSoftMax_updateGradInput(
input:cdata(),
gradOutput:cdata(),
self.gradInput:cdata(),
self.output:cdata()
)
return self.gradInput
end
| Update LogSoftMaxInPlace to work with THNN | Update LogSoftMaxInPlace to work with THNN
| Lua | bsd-3-clause | paidi/oxnn,paidi/oxnn,tkocisky/oxnn,tkocisky/oxnn,paidi/oxnn,tkocisky/oxnn |
96d9b360eec01b533e959daedec0813af1d76643 | extensions/sqlite3/init.lua | extensions/sqlite3/init.lua | module = require("hs.sqlite3.lsqlite3")
return module
| --- === hs.sqlite3 ==
---
--- Interact with SQLite databases
---
--- Notes:
--- * This module is LSQLite 0.9.4 as found at http://lua.sqlite.org/index.cgi/index
--- * It is unmodified apart from removing `db:load_extension()` as this feature is not available in Apple's libsqlite3.dylib
--- * For API documentation please see [http://lua.sqlite.org](http://lua.sqlite.org)
module = require("hs.sqlite3.lsqlite3")
return module
| Add minimal documentation for hs.sqlite3 | Add minimal documentation for hs.sqlite3
| Lua | mit | Hammerspoon/hammerspoon,latenitefilms/hammerspoon,Hammerspoon/hammerspoon,zzamboni/hammerspoon,Hammerspoon/hammerspoon,CommandPost/CommandPost-App,asmagill/hammerspoon,bradparks/hammerspoon,latenitefilms/hammerspoon,Habbie/hammerspoon,zzamboni/hammerspoon,Hammerspoon/hammerspoon,latenitefilms/hammerspoon,knu/hammerspoon,cmsj/hammerspoon,knu/hammerspoon,Hammerspoon/hammerspoon,cmsj/hammerspoon,knu/hammerspoon,bradparks/hammerspoon,latenitefilms/hammerspoon,knu/hammerspoon,zzamboni/hammerspoon,bradparks/hammerspoon,cmsj/hammerspoon,bradparks/hammerspoon,zzamboni/hammerspoon,bradparks/hammerspoon,CommandPost/CommandPost-App,latenitefilms/hammerspoon,cmsj/hammerspoon,CommandPost/CommandPost-App,Habbie/hammerspoon,asmagill/hammerspoon,cmsj/hammerspoon,Habbie/hammerspoon,asmagill/hammerspoon,knu/hammerspoon,Habbie/hammerspoon,Habbie/hammerspoon,asmagill/hammerspoon,zzamboni/hammerspoon,Hammerspoon/hammerspoon,CommandPost/CommandPost-App,CommandPost/CommandPost-App,latenitefilms/hammerspoon,CommandPost/CommandPost-App,asmagill/hammerspoon,knu/hammerspoon,cmsj/hammerspoon,Habbie/hammerspoon,asmagill/hammerspoon,zzamboni/hammerspoon |
a24452461418d7c8796997bb8c77eabd34363d07 | CircuitsUI_0.1.0/prototypes/crafts.lua | CircuitsUI_0.1.0/prototypes/crafts.lua | data:extend({
{
type = "recipe",
name = "ui-combinator",
enabled = true,
ingredients =
{
{"advanced-circuit", 5},
{"lamp", 3}
},
result = "ui-combinator"
}
})
| data:extend({
{
type = "recipe",
name = "ui-combinator",
enabled = true,
ingredients =
{
{"advanced-circuit", 5},
{"small-lamp", 3}
},
result = "ui-combinator"
}
})
| Fix costs entity name for lamp --> small-lamp | CircuitsUI: Fix costs entity name for lamp --> small-lamp
| Lua | mit | Zomis/FactorioMods |
f030c1c71ed8b9797b15d711f455756fc172da8e | test/page5.lua | test/page5.lua | mg.write("HTTP/1.0 200 OK\r\n")
mg.write("Content-Type: text/html\r\n")
mg.write("\r\n")
mg.write([[<html><body><p>
Hello world!
</p>
</body></html>
]])
| Add very simple test page (created by Lua) | Add very simple test page (created by Lua)
| Lua | mit | GerHobbelt/civet-webserver,GerHobbelt/civet-webserver,GerHobbelt/civet-webserver,GerHobbelt/civet-webserver,GerHobbelt/civet-webserver,GerHobbelt/civet-webserver | |
effb57247caefa89476b64824fa57bf08052aa42 | lua_modules/yeelink/Example_for_Yeelink_Lib.lua | lua_modules/yeelink/Example_for_Yeelink_Lib.lua | -- ***************************************************************************
-- Example for Yeelink Lib
--
-- Written by Martin
--
--
-- MIT license, http://opensource.org/licenses/MIT
-- ***************************************************************************
wifi.setmode(wifi.STATION) --Step1: Connect to Wifi
wifi.sta.config("SSID","Password")
dht = require("dht_lib") --Step2: "Require" the libs
yeelink = require("yeelink_lib")
yeelink.init(23333,23333,"You api-key",function() --Step3: Register the callback function
print("Yeelink Init OK...")
tmr.alarm(1,60000,1,function() --Step4: Have fun~ (Update your data)
dht.read(4)
yeelink.update(dht.getTemperature())
end)
end)
| Add Example to yeelink lib | Add Example to yeelink lib | Lua | mit | shangwudong/MyNodeMcu,flexiti/nodemcu-firmware,christakahashi/nodemcu-firmware,eku/nodemcu-firmware,iotcafe/nodemcu-firmware,karrots/nodemcu-firmware,zhujunsan/nodemcu-firmware,bhrt/nodeMCU,digitalloggers/nodemcu-firmware,FelixPe/nodemcu-firmware,nwf/nodemcu-firmware,marcelstoer/nodemcu-firmware,flexiti/nodemcu-firmware,iotcafe/nodemcu-firmware,abgoyal/nodemcu-firmware,Alkorin/nodemcu-firmware,yurenyong123/nodemcu-firmware,jmattsson/nodemcu-firmware,HEYAHONG/nodemcu-firmware,radiojam11/nodemcu-firmware,remspoor/nodemcu-firmware,vowstar/nodemcu-firmware,rickvanbodegraven/nodemcu-firmware,dnc40085/nodemcu-firmware,benwolfe/nodemcu-firmware,vsky279/nodemcu-firmware,nodemcu/nodemcu-firmware,petrkr/nodemcu-firmware,anusornc/nodemcu-firmware,Audumla/audiot-nodemcu-firmware,ruisebastiao/nodemcu-firmware,zhujunsan/nodemcu-firmware,oyooyo/nodemcu-firmware,fetchbot/nodemcu-firmware,remspoor/nodemcu-firmware,nodemcu/nodemcu-firmware,sowbug/nodemcu-firmware,filug/nodemcu-firmware,devsaurus/nodemcu-firmware,jmattsson/nodemcu-firmware,kbeckmann/nodemcu-firmware,FrankX0/nodemcu-firmware,devsaurus/nodemcu-firmware,danronco/nodemcu-firmware,robertfoss/nodemcu-firmware,nodemcu/nodemcu-firmware,danronco/nodemcu-firmware,ciufciuf57/nodemcu-firmware,bhrt/nodeMCU,dnc40085/nodemcu-firmware,bogvak/nodemcu-firmware,TerryE/nodemcu-firmware,dan-cleinmark/nodemcu-firmware,TerryE/nodemcu-firmware,jmattsson/nodemcu-firmware,djphoenix/nodemcu-firmware,luizfeliperj/nodemcu-firmware,romanchyla/nodemcu-firmware,makefu/nodemcu-firmware,noahchense/nodemcu-firmware,Kisaua/nodemcu-firmware,digitalloggers/nodemcu-firmware,benwolfe/nodemcu-firmware,bogvak/nodemcu-firmware,oyooyo/nodemcu-firmware,christakahashi/nodemcu-firmware,SmartArduino/nodemcu-firmware,vowstar/nodemcu-firmware,nwf/nodemcu-firmware,romanchyla/nodemcu-firmware,mikeller/nodemcu-firmware,SmartArduino/nodemcu-firmware,jmattsson/nodemcu-firmware,vsky279/nodemcu-firmware,shangwudong/MyNodeMcu,sowbug/nodemcu-firmware,natetrue/nodemcu-firmware,dnc40085/nodemcu-firmware,eku/nodemcu-firmware,eku/nodemcu-firmware,fetchbot/nodemcu-firmware,cs8425/nodemcu-firmware,nwf/nodemcu-firmware,bhrt/nodeMCU,marktsai0316/nodemcu-firmware,dan-cleinmark/nodemcu-firmware,flexiti/nodemcu-firmware,remspoor/nodemcu-firmware,marktsai0316/nodemcu-firmware,robertfoss/nodemcu-firmware,Andrew-Collins/nodemcu-firmware,weera00/nodemcu-firmware,xatanais/nodemcu-firmware,dnc40085/nodemcu-firmware,dscoolx6/MyESP8266,kbeckmann/nodemcu-firmware,noahchense/nodemcu-firmware,nwf/nodemcu-firmware,klukonin/nodemcu-firmware,ruisebastiao/nodemcu-firmware,makefu/nodemcu-firmware,shangwudong/MyNodeMcu,ktosiu/nodemcu-firmware,daned33/nodemcu-firmware,funshine/nodemcu-firmware,dscoolx6/MyESP8266,anusornc/nodemcu-firmware,FrankX0/nodemcu-firmware,shangwudong/MyNodeMcu,kbeckmann/nodemcu-firmware,iotcafe/nodemcu-firmware,filug/nodemcu-firmware,raburton/nodemcu-firmware,petrkr/nodemcu-firmware,funshine/nodemcu-firmware,djphoenix/nodemcu-firmware,vsky279/nodemcu-firmware,FelixPe/nodemcu-firmware,devsaurus/nodemcu-firmware,vsky279/nodemcu-firmware,oyooyo/nodemcu-firmware,mikeller/nodemcu-firmware,mikeller/nodemcu-firmware,bhrt/nodeMCU,natetrue/nodemcu-firmware,petrkr/nodemcu-firmware,marcelstoer/nodemcu-firmware,petrkr/nodemcu-firmware,borromeotlhs/nodemcu-firmware,raburton/nodemcu-firmware,jmattsson/nodemcu-firmware,ciufciuf57/nodemcu-firmware,Alkorin/nodemcu-firmware,luizfeliperj/nodemcu-firmware,FrankX0/nodemcu-firmware,radiojam11/nodemcu-firmware,ktosiu/nodemcu-firmware,borromeotlhs/nodemcu-firmware,funshine/nodemcu-firmware,karrots/nodemcu-firmware,zerog2k/nodemcu-firmware,bhrt/nodeMCU,natetrue/nodemcu-firmware,remspoor/nodemcu-firmware,remspoor/nodemcu-firmware,karrots/nodemcu-firmware,marcelstoer/nodemcu-firmware,karrots/nodemcu-firmware,FelixPe/nodemcu-firmware,dan-cleinmark/nodemcu-firmware,FelixPe/nodemcu-firmware,Audumla/audiot-nodemcu-firmware,zerog2k/nodemcu-firmware,borromeotlhs/nodemcu-firmware,FrankX0/nodemcu-firmware,Alkorin/nodemcu-firmware,karrots/nodemcu-firmware,zhujunsan/nodemcu-firmware,danronco/nodemcu-firmware,Andrew-Collins/nodemcu-firmware,eku/nodemcu-firmware,nwf/nodemcu-firmware,ruisebastiao/nodemcu-firmware,yurenyong123/nodemcu-firmware,funshine/nodemcu-firmware,funshine/nodemcu-firmware,marcelstoer/nodemcu-firmware,weera00/nodemcu-firmware,rickvanbodegraven/nodemcu-firmware,filug/nodemcu-firmware,FelixPe/nodemcu-firmware,shangwudong/MyNodeMcu,weera00/nodemcu-firmware,Andrew-Collins/nodemcu-firmware,digitalloggers/nodemcu-firmware,fetchbot/nodemcu-firmware,HEYAHONG/nodemcu-firmware,yurenyong123/nodemcu-firmware,sowbug/nodemcu-firmware,luizfeliperj/nodemcu-firmware,fetchbot/nodemcu-firmware,Kisaua/nodemcu-firmware,djphoenix/nodemcu-firmware,FrankX0/nodemcu-firmware,nodemcu/nodemcu-firmware,TerryE/nodemcu-firmware,ciufciuf57/nodemcu-firmware,devsaurus/nodemcu-firmware,xatanais/nodemcu-firmware,oyooyo/nodemcu-firmware,Alkorin/nodemcu-firmware,devsaurus/nodemcu-firmware,marcelstoer/nodemcu-firmware,marktsai0316/nodemcu-firmware,raburton/nodemcu-firmware,ktosiu/nodemcu-firmware,daned33/nodemcu-firmware,HEYAHONG/nodemcu-firmware,daned33/nodemcu-firmware,romanchyla/nodemcu-firmware,HEYAHONG/nodemcu-firmware,luizfeliperj/nodemcu-firmware,radiojam11/nodemcu-firmware,abgoyal/nodemcu-firmware,benwolfe/nodemcu-firmware,Alkorin/nodemcu-firmware,vowstar/nodemcu-firmware,noahchense/nodemcu-firmware,Kisaua/nodemcu-firmware,rickvanbodegraven/nodemcu-firmware,robertfoss/nodemcu-firmware,zerog2k/nodemcu-firmware,SmartArduino/nodemcu-firmware,Audumla/audiot-nodemcu-firmware,xatanais/nodemcu-firmware,klukonin/nodemcu-firmware,anusornc/nodemcu-firmware,abgoyal/nodemcu-firmware,cs8425/nodemcu-firmware,petrkr/nodemcu-firmware,kbeckmann/nodemcu-firmware,bogvak/nodemcu-firmware,dnc40085/nodemcu-firmware,christakahashi/nodemcu-firmware,TerryE/nodemcu-firmware,makefu/nodemcu-firmware,HEYAHONG/nodemcu-firmware,klukonin/nodemcu-firmware,djphoenix/nodemcu-firmware,TerryE/nodemcu-firmware,dscoolx6/MyESP8266,kbeckmann/nodemcu-firmware,cs8425/nodemcu-firmware,nodemcu/nodemcu-firmware,christakahashi/nodemcu-firmware,christakahashi/nodemcu-firmware,vsky279/nodemcu-firmware | |
1f395c66eeaabdc36f11cb333529d271ed4566a0 | lib/resty/auto-ssl/utils/shell_execute.lua | lib/resty/auto-ssl/utils/shell_execute.lua | local shell = require "resty.auto-ssl.vendor.shell"
local start_sockproc = require "resty.auto-ssl.utils.start_sockproc"
return function(command)
-- Make sure the sockproc has started before trying to execute any commands
-- (since it's started by only a single worker in init_worker, it's possible
-- other workers have already finished their init_worker phases before the
-- process is actually started).
if not ngx.shared.auto_ssl:get("sockproc_started") then
start_sockproc()
local wait_time = 0
local sleep_time = 0.01
local max_time = 5
while not ngx.shared.auto_ssl:get("sockproc_started") do
ngx.sleep(sleep_time)
wait_time = wait_time + sleep_time
if wait_time > max_time then
break
end
end
end
local status, out, err = shell.execute(command)
-- If the script fails due to a missing sockproc socket, try starting up
-- the sockproc process again and then retry.
if status ~= 0 and err == "no such file or directory" then
ngx.log(ngx.ERR, "auto-ssl: sockproc unexpectedly not available, trying to restart")
start_sockproc(true)
status, out, err = shell.execute(command)
end
return status, out, err
end
| local shell = require "resty.auto-ssl.vendor.shell"
local start_sockproc = require "resty.auto-ssl.utils.start_sockproc"
return function(command)
-- Make sure the sockproc has started before trying to execute any commands
-- (since it's started by only a single worker in init_worker, it's possible
-- other workers have already finished their init_worker phases before the
-- process is actually started).
if not ngx.shared.auto_ssl:get("sockproc_started") then
start_sockproc()
local wait_time = 0
local sleep_time = 0.01
local max_time = 5
while not ngx.shared.auto_ssl:get("sockproc_started") do
ngx.sleep(sleep_time)
wait_time = wait_time + sleep_time
if wait_time > max_time then
break
end
end
end
local status, out, err = shell.execute(command)
-- If the script fails due to a missing sockproc socket, try starting up
-- the sockproc process again and then retry.
if status ~= 0 and err == "no such file or directory" then
ngx.log(ngx.ERR, "auto-ssl: sockproc unexpectedly not available, trying to restart")
start_sockproc(true)
status, out, err = shell.execute(command, { timeout = 60 })
end
return status, out, err
end
| Increase default timeout for calling letsencrypt.sh to 60 seconds. | Increase default timeout for calling letsencrypt.sh to 60 seconds.
This attempts to workaround potential slowdowns on Let's Encrypt's end
without dropping the initial request while registering the cert.
The previous default timeout builtin to resty-shell was 15 seconds.
Hopefully certificate registrations won't actually take that long, but
this should hopefully help with random slowness (or at least provide a
better error message from letsencrypt.sh, rather than timing out while
the letsencrypt.sh script continues to run).
See: https://github.com/GUI/lua-resty-auto-ssl/issues/11
| Lua | mit | UseFedora/lua-resty-auto-ssl,UseFedora/lua-resty-auto-ssl,GUI/lua-resty-auto-ssl |
bd019d4297f65eb8b55f19b8813405511fff6737 | test/tests/undo_redo.lua | test/tests/undo_redo.lua | test.open('words.txt')
local lineno = test.lineno
local colno = test.colno
local assertEq = test.assertEq
test.keys('dd')
assertEq(buffer:get_line(0), 'hey bee cee dee ee eff\n')
test.keys('u')
assertEq(buffer:get_line(0), 'one two three four five\n')
test.key('c-r')
assertEq(buffer:get_line(0), 'hey bee cee dee ee eff\n')
| Add a very basic undo/redo test. | Add a very basic undo/redo test.
| Lua | mit | jugglerchris/textadept-vi,erig0/textadept-vi,jugglerchris/textadept-vi | |
c11029927e41d4f12f579511e992826a2e414471 | src/main/resources/workerScripts/jesque_pop.lua | src/main/resources/workerScripts/jesque_pop.lua | local queueKey = KEYS[1]
local inFlightKey = KEYS[2]
local freqKey = KEYS[3]
local now = ARGV[1]
local payload = nil
local not_empty = function(x)
return (type(x) == 'table') and (not x.err) and (#x ~= 0)
end
local ok, queueType = next(redis.call('TYPE', queueKey))
if queueType == 'zset' then
local i, lPayload = next(redis.call('ZRANGEBYSCORE', queueKey, '-inf', now, 'WITHSCORES'))
if lPayload then
payload = lPayload
local frequency = redis.call('HGET', freqKey, payload)
if frequency then
redis.call('ZINCRBY', queueKey, frequency, payload)
else
redis.call('ZREM', queueKey, payload)
end
end
elseif queueType == 'list' then
payload = redis.call('LPOP', queueKey)
if payload then
redis.call('LPUSH', inFlightKey, payload)
end
end
return payload
| local queueKey = KEYS[1]
local inFlightKey = KEYS[2]
local freqKey = KEYS[3]
local now = ARGV[1]
local payload = nil
local not_empty = function(x)
return (type(x) == 'table') and (not x.err) and (#x ~= 0)
end
local ok, queueType = next(redis.call('TYPE', queueKey))
if queueType == 'zset' then
redis.call('ZRANGEBYSCORE', queueKey, '-inf', now, 'WITHSCORES', 'LIMIT' , '0' , '1')
if lPayload then
payload = lPayload
local frequency = redis.call('HGET', freqKey, payload)
if frequency then
redis.call('ZINCRBY', queueKey, frequency, payload)
else
redis.call('ZREM', queueKey, payload)
end
end
elseif queueType == 'list' then
payload = redis.call('LPOP', queueKey)
if payload then
redis.call('LPUSH', inFlightKey, payload)
end
end
return payload
| Add LIMIT to Lua pop server side script | Add LIMIT to Lua pop server side script | Lua | apache-2.0 | argvk/jesque,gresrun/jesque |
2b8a3a7a000baae3e084e9df07470c5280df87e8 | spec/parser.lua | spec/parser.lua | describe('Test the ini parser', function()
local ini = require 'ini'
setup(function()
end)
it('basic test', function()
assert.same(ini.parse('a_key = this is the value for this set'), {'a_key', 'this is the value for this set'})
assert.same(ini.parse('[this_is_a_section_test]'), {'this_is_a_section_test'})
assert.same(ini.parse('; this is a comment test'), {';',' this is a comment test'})
end)
it('section', function()
assert.same(ini.parse('[section_test]'),{'section_test'})
assert.same(ini.parse('[section_test1]'),{'section_test1'}) -- test digit
assert.same(ini.parse('[section1_test]'),{'section1_test'}) -- test digit
assert.same(ini.parse('[ section_test ] '), {'section_test'}) -- test space
assert.is_nil(ini.parse('[test_section'))
-- assert.is_nil(ini.parse('test_section]'))
assert.is_nil(ini.parse('[1my_section_test]')) -- fail because starts with a digit
end)
it('Multi-lines string',function()
local t = ini.parse[[
; this is a comment
[opengl]
fullscreen = true
window = 200,200
]]
assert.same(t,{
';',
' this is a comment',
'opengl',
'fullscreen',
'true',
'window',
'200,200'
})
end)
end)
| describe('Test the parser', function()
local ini = require 'ini'
it('basic test', function()
assert.same({'a_key', 'this is the value for this set'}, ini.parse('a_key = this is the value for this set'))
assert.same({'this_is_a_section_test'}, ini.parse('[this_is_a_section_test]'))
assert.same({';',' this is a comment test'},ini.parse('; this is a comment test'))
end)
it('section', function()
assert.same({'section_test'}, ini.parse('[section_test]'))
assert.same({'section_test1'}, ini.parse('[section_test1]')) -- test digit
assert.same({'s1ection_test'}, ini.parse('[s1ection_test]')) -- test digit
-- assert.same(ini.parse('[ section_test ] '), {'section_test'}) -- test space
-- assert.is_nil(ini.parse('[test_section'))
-- -- assert.is_nil(ini.parse('test_section]'))
-- assert.is_nil(ini.parse('[1my_section_test]')) -- fail because starts with a digit
end)
it('Multi-lines string',function()
local t = ini.parse[[
; this is a comment
[opengl]
fullscreen = true
window = 200,200
]]
assert.same(t,{
';',
' this is a comment',
'opengl',
'fullscreen',
'true',
'window',
'200,200'
})
end)
end)
| Fix inverted expected and passed parameter | Fix inverted expected and passed parameter
| Lua | mit | lzubiaur/ini.lua |
60b99a893546296ac0012b74eafed5288eb2592d | .config/awesome/widgets/rounded_bar.lua | .config/awesome/widgets/rounded_bar.lua | local gears = require("gears")
local wibox = require("wibox")
local beautiful = require("beautiful")
return function(active_color, background_color, icon)
local bar = wibox.widget{
max_value = 1,
value = .5,
forced_height = dpi(10),
margins = {
top = dpi(8),
bottom = dpi(8),
},
forced_width = dpi(100),
shape = gears.shape.rounded_bar,
bar_shape = gears.shape.rounded_bar,
color = active_color,
background_color = background_color,
border_width = 0,
border_color = beautiful.border_color,
widget = wibox.widget.progressbar,
}
local imagebox = wibox.widget.imagebox(icon)
local box = wibox.widget{
imagebox,
bar,
layout = wibox.layout.fixed.horizontal,
}
return {
icon = imagebox,
bar = bar,
widget = box,
}
end
| local gears = require("gears")
local wibox = require("wibox")
local beautiful = require("beautiful")
local user = require('user')
return function(active_color, background_color, icon)
local bar = wibox.widget{
max_value = 1,
value = .5,
forced_height = dpi(10),
margins = {
top = dpi(8),
bottom = dpi(8),
},
forced_width = dpi(user.gauge_width or 100),
shape = gears.shape.rounded_bar,
bar_shape = gears.shape.rounded_bar,
color = active_color,
background_color = background_color,
border_width = 0,
border_color = beautiful.border_color,
widget = wibox.widget.progressbar,
}
local imagebox = wibox.widget.imagebox(icon)
local box = wibox.widget{
imagebox,
bar,
layout = wibox.layout.fixed.horizontal,
}
return {
icon = imagebox,
bar = bar,
widget = box,
}
end
| Allow width to be configured by user variables | Allow width to be configured by user variables
| Lua | mit | sarumont/dotfiles,sarumont/dotfiles,sarumont/dotfiles |
ed537c0c42ba2ab323e0faaee866c501fa506ddb | .hammerspoon/init.lua | .hammerspoon/init.lua | require 'modules.loader'
-- watches Lua files
-- provides short-cuts to reload Hammerspoon config
loader = ModuleLoader()
loader.addWatcher('init.lua')
-- for all notifications and messaging needs
messenger = loader.loadModule('modules', 'messenger')
-- prevent Mac from sleeping,
-- it should also create Moon-like menu icon
loader.loadModule('modules', 'caffeinator')
-- performs actions upon screen lock:
-- mute audio, remove identities from SSH-agent, etc.
loader.loadModule('modules', 'screenLockWatcher')
-- Controls focused window size and movement
-- though several keyboard combinations
loader.loadModule('modules', 'windowController')
-- Automatically load any modules added to auto_dir
auto_dir = 'autoload'
local iterFn, dirObj = hs.fs.dir(os.getenv('HOME') .. '/.hammerspoon/' .. auto_dir)
if iterFn then
for file in iterFn, dirObj do
if file:sub(-4) == ".lua" then
loader.loadModule(auto_dir, file:sub(0,-5))
end
end
end
hs.hotkey.bind({'ctrl','alt','cmd'}, 'R', hs.reload)
-- display alert when config is loaded
-- if Hammerspoon crashes, you won't see message
messenger.message('Hammerspoon config - OK', 1)
| require 'modules.loader'
-- watches Lua files
-- provides short-cuts to reload Hammerspoon config
loader = ModuleLoader()
loader.addWatcher('init.lua')
-- for all notifications and messaging needs
messenger = loader.loadModule('modules', 'messenger')
-- prevent Mac from sleeping,
-- it should also create Moon-like menu icon
loader.loadModule('modules', 'caffeinator')
-- performs actions upon screen lock:
-- mute audio, remove identities from SSH-agent, etc.
loader.loadModule('modules', 'screenLockWatcher')
-- Controls focused window size and movement
-- though several keyboard combinations
loader.loadModule('modules', 'windowController')
-- Automatically load any modules added to auto_dir
auto_dir = 'autoload'
local iterFn, dirObj = hs.fs.dir(os.getenv('HOME') .. '/.hammerspoon/' .. auto_dir)
if iterFn then
for file in iterFn, dirObj do
if file:sub(-4) == ".lua" then
loader.loadModule(auto_dir, file:sub(0,-5))
end
end
end
-- Key combination to reload config
hs.hotkey.bind({'ctrl','alt','cmd'}, 'R', hs.reload)
-- display alert when config is loaded
-- if Hammerspoon crashes, you won't see message
messenger.message('Hammerspoon config - OK', 1)
| Add comment for hammerspoon ctrl+alt+cmd+R reload functionality | Add comment for hammerspoon ctrl+alt+cmd+R reload functionality
| Lua | apache-2.0 | antontsv/apple.bin,antontsv/apple.bin |
6169e5f0b95f01a05659809128483f2a1ffe4044 | src/conf.lua | src/conf.lua | function love.conf(t)
t.title = "Journey to the Center of Hawkthorne v0.0.9"
t.author = "Kyle Conroy"
t.version = "0.8.0"
t.identity = "hawkthorne"
t.screen.width = 456
t.screen.height = 264
t.consolne = false
t.modules.physics = false
t.modules.joystick = false
t.release = false
end
| function love.conf(t)
t.title = "Journey to the Center of Hawkthorne v0.0.10"
t.author = "Kyle Conroy"
t.version = "0.8.0"
t.identity = "hawkthorne"
t.screen.width = 456
t.screen.height = 264
t.consolne = false
t.modules.physics = false
t.modules.joystick = false
t.release = false
end
| Bump release version to v0.0.10 | Bump release version to v0.0.10
| Lua | mit | hawkthorne/hawkthorne-server-lua,hawkthorne/hawkthorne-client-lua,hawkthorne/hawkthorne-server-lua,hawkthorne/hawkthorne-client-lua |
8c0f22e5042bcfdad8a6a3cbadd97f70717c94e3 | lua/autorun/menubar/mp_options.lua | lua/autorun/menubar/mp_options.lua | hook.Add( "PopulateMenuBar", "MediaPlayerOptions_MenuBar", function( menubar )
local m = menubar:AddOrGetMenu( "Media Player" )
m:AddCVar( "Fullscreen", "mediaplayer_fullscreen", "1", "0" )
end )
| hook.Add( "PopulateMenuBar", "MediaPlayerOptions_MenuBar", function( menubar )
local m = menubar:AddOrGetMenu( "Media Player" )
m:AddCVar( "Fullscreen", "mediaplayer_fullscreen", "1", "0" )
m:AddSpacer()
m:AddOption( "Turn Off All", function()
for _, mp in ipairs(MediaPlayer.GetAll()) do
MediaPlayer.RequestListen( mp )
end
end )
end )
| Add 'Turn Off All' menubar action for Sandbox-based gamemodes | Add 'Turn Off All' menubar action for Sandbox-based gamemodes
| Lua | mit | pixeltailgames/gm-mediaplayer,pixeltailgames/gm-mediaplayer |
9828617a84d734e7570bdefee50406ea32b4ac9e | Modules/Shared/Players/GroupUtils.lua | Modules/Shared/Players/GroupUtils.lua | ---
-- @module GroupUtils
-- @author Quenty
local require = require(game:GetService("ReplicatedStorage"):WaitForChild("Nevermore"))
local Promise = require("Promise")
local GroupUtils = {}
function GroupUtils.promiseRankInGroup(player, groupId)
assert(typeof(player) == "Instance" and player:IsA("Player"))
assert(type(groupId) == "number")
return Promise.spawn(function(resolve, reject)
local rank = nil
local ok, err = pcall(function()
rank = player:GetRankInGroup(groupId)
end)
if not ok then
return reject(err)
end
if type(rank) ~= "number" then
return reject("Rank is not a number")
end
return resolve(rank)
end)
end
return GroupUtils | ---
-- @module GroupUtils
-- @author Quenty
local require = require(game:GetService("ReplicatedStorage"):WaitForChild("Nevermore"))
local GroupService = game:GetService("GroupService")
local Promise = require("Promise")
local GroupUtils = {}
function GroupUtils.promiseRankInGroup(player, groupId)
assert(typeof(player) == "Instance" and player:IsA("Player"))
assert(type(groupId) == "number")
return Promise.spawn(function(resolve, reject)
local rank = nil
local ok, err = pcall(function()
rank = player:GetRankInGroup(groupId)
end)
if not ok then
return reject(err)
end
if type(rank) ~= "number" then
return reject("Rank is not a number")
end
return resolve(rank)
end)
end
function GroupUtils.promiseGroupInfo(groupId)
assert(groupId)
return Promise.spawn(function(resolve, reject)
local groupInfo = nil
local ok, err = pcall(function()
groupInfo = GroupService:GetGroupInfoAsync(groupId)
end)
if not ok then
return reject(err)
end
if type(groupInfo) ~= "table" then
return reject("Rank is not a number")
end
return resolve(groupInfo)
end)
end
function GroupUtils.promiseGroupRoleInfo(groupId, rankId)
assert(groupId)
assert(rankId)
return GroupUtils.promiseGroupInfo(groupId)
:Then(function(groupInfo)
if type(groupInfo.Roles) ~= "table" then
return Promise.rejected("No Roles table")
end
for _, rankInfo in pairs(groupInfo.Roles) do
if rankInfo.Rank == rankId then
return rankInfo
end
end
return Promise.rejected("No rank with given id")
end)
end
return GroupUtils | Add more to group utils | Add more to group utils
| Lua | mit | Quenty/NevermoreEngine,Quenty/NevermoreEngine,Quenty/NevermoreEngine |
d752469a0af3923dc80e5f9faf97683d449a7e62 | modulefiles/python/3.4.1/pax/4.6.1.lua | modulefiles/python/3.4.1/pax/4.6.1.lua | help(
[[
This module loads Python 3.4.1 with a set of packages needed for
the Xenon1T PAX 4.6.1
]])
local version = "3.4.1"
local base = "/cvmfs/oasis.opensciencegrid.org/osg/modules/virtualenv-3.4/pax-4.6.1"
pushenv("VIRTUAL_ENV", base)
prepend_path("PATH", pathJoin(base, "bin"))
load('atlas/3.10.1', 'lapack', 'hdf5/1.8.13', 'llvm/3.6', 'gcc/4.9.2', 'root/5.34-32-py34', 'snappy/1.1.3', 'cblosc/1.7.1')
-- Setup Modulepath for packages built by this python stack
local mroot = os.getenv("MODULEPATH_ROOT")
local mdir = pathJoin(mroot,"Python",version)
prepend_path("MODULEPATH", mdir)
| help(
[[
This module loads Python 3.4.1 with a set of packages needed for
the Xenon1T PAX 4.6.1
]])
local version = "3.4.1"
local base = "/cvmfs/oasis.opensciencegrid.org/osg/modules/virtualenv-3.4/pax-4.6.1"
pushenv("VIRTUAL_ENV", base)
prepend_path("PATH", pathJoin(base, "bin"))
load('atlas/3.10.1', 'lapack', 'hdf5/1.8.13', 'llvm/3.6', 'gcc/4.9.2', 'root/6.06-02-py34', 'snappy/1.1.3', 'cblosc/1.7.1')
-- Setup Modulepath for packages built by this python stack
local mroot = os.getenv("MODULEPATH_ROOT")
local mdir = pathJoin(mroot,"Python",version)
prepend_path("MODULEPATH", mdir)
| Load the right version of ROOT | Load the right version of ROOT
| Lua | apache-2.0 | OSGConnect/modulefiles,OSGConnect/modulefiles,OSGConnect/modulefiles |
2dbd5573c7f7f382d09f751095bbfdece244c979 | src/Editor/Editor.Client/Editor.Client.lua | src/Editor/Editor.Client/Editor.Client.lua | EditorClient = {}
EditorClient.name = "Editor.Client"
project "Editor.Client"
kind "SharedLib"
language "C#"
location "."
SetupAddinResources()
files
{
"Editor.Client.lua",
"**.cs",
}
links
{
"System",
"System.Drawing",
"EngineManaged",
"EngineBindings",
"Editor.Shared",
"Editor.Server",
"ServerManaged",
"Mono.Addins"
} | EditorClient = {}
EditorClient.name = "Editor.Client"
project "Editor.Client"
kind "SharedLib"
language "C#"
location "."
flags { "Unsafe" }
SetupAddinResources()
files
{
"Editor.Client.lua",
"**.cs",
}
links
{
"System",
"System.Drawing",
"EngineManaged",
"EngineBindings",
"Editor.Shared",
"Editor.Server",
"ServerManaged",
"Mono.Addins"
} | Enable the usage of unsafe code in the editor client. | Enable the usage of unsafe code in the editor client.
| Lua | bsd-2-clause | FloodProject/flood,FloodProject/flood,FloodProject/flood |
483bf7ad7eac5c6f56dba365ebc8ac0bd4caf8fc | .hammerspoon/init.lua | .hammerspoon/init.lua | require 'modules.loader'
-- watches Lua files
-- provides short-cuts to reload Hammerspoon config
loader = ModuleLoader('modules')
loader.addWatcher('init.lua')
-- for all notifications and messaging needs
messenger = loader.loadModule('messenger')
-- prevent Mac from sleeping,
-- it should also create Moon-like menu icon
loader.loadModule('caffeinator')
-- performs actions upon screen lock:
-- mute audio, remove identities from SSH-agent, etc.
loader.loadModule('screenLockWatcher')
-- Controls focused window size and movement
-- though several keyboard combinations
loader.loadModule('windowController')
-- Automatically load any modules added to auto_dir
auto_dir = 'autoload'
local iterFn, dirObj = hs.fs.dir(os.getenv('HOME') .. '/.hammerspoon/' .. auto_dir)
if iterFn then
autoloader = ModuleLoader(auto_dir)
for file in iterFn, dirObj do
if file:sub(-4) == ".lua" then
autoloader.loadModule(file:sub(0,-5))
end
end
end
-- Key combination to reload config
hs.hotkey.bind({'ctrl','alt','cmd'}, 'R', hs.reload)
-- display alert when config is loaded
-- if Hammerspoon crashes, you won't see message
messenger.message('Hammerspoon config - OK', 1)
| -- Make sure we are in ~/.hammerspoon since
hs.fs.chdir(os.getenv('HOME') .. '/.hammerspoon/')
require 'modules.loader'
-- watches Lua files
-- provides short-cuts to reload Hammerspoon config
loader = ModuleLoader('modules')
loader.addWatcher('init.lua')
-- for all notifications and messaging needs
messenger = loader.loadModule('messenger')
-- prevent Mac from sleeping,
-- it should also create Moon-like menu icon
loader.loadModule('caffeinator')
-- performs actions upon screen lock:
-- mute audio, remove identities from SSH-agent, etc.
loader.loadModule('screenLockWatcher')
-- Controls focused window size and movement
-- though several keyboard combinations
loader.loadModule('windowController')
-- Automatically load any modules added to auto_dir
auto_dir = 'autoload'
local iterFn, dirObj = hs.fs.dir(os.getenv('HOME') .. '/.hammerspoon/' .. auto_dir)
if iterFn then
autoloader = ModuleLoader(auto_dir)
for file in iterFn, dirObj do
if file:sub(-4) == ".lua" then
autoloader.loadModule(file:sub(0,-5))
end
end
end
-- Key combination to reload config
hs.hotkey.bind({'ctrl','alt','cmd'}, 'R', hs.reload)
-- display alert when config is loaded
-- if Hammerspoon crashes, you won't see message
messenger.message('Hammerspoon config - OK', 1)
| Set workdir in hammespoon to ~/.hammerspoon | Set workdir in hammespoon to ~/.hammerspoon
init.lua can be actually symlinked, making v0.9.80
follow symlinks and thus breaking ability to find certain modules
under ~/.hammerspoon
| Lua | apache-2.0 | antontsv/apple.bin,antontsv/apple.bin |
0f223747c251e2aba4fa7614187ed6e0a727e321 | samples/01.hello-world/lua/game.lua | samples/01.hello-world/lua/game.lua | function init()
-- Set the title of the main window
Window.set_title("Hello world!")
end
function frame(dt)
end
function shutdown()
end | function init()
-- Set the title of the main window
Window.set_title("Hello world!")
end
function frame(dt)
-- Stop the engine when any key is released
if Keyboard.any_released() then
Device.stop()
end
end
function shutdown()
end | Exit the hello world sample when any key is released | Exit the hello world sample when any key is released
| Lua | mit | mikymod/crown,mikymod/crown,galek/crown,taylor001/crown,taylor001/crown,galek/crown,dbartolini/crown,mikymod/crown,galek/crown,galek/crown,dbartolini/crown,taylor001/crown,mikymod/crown,dbartolini/crown,taylor001/crown,dbartolini/crown |
feda69cd476b5af21f340f4c22081baa69eb3a0e | src/api-umbrella/cli/run.lua | src/api-umbrella/cli/run.lua | local path = require "pl.path"
local setup = require "api-umbrella.cli.setup"
local status = require "api-umbrella.cli.status"
local unistd = require "posix.unistd"
local function start_perp(config, options)
local running, _ = status()
if running then
print "api-umbrella is already running"
if options and options["background"] then
os.exit(0)
else
os.exit(1)
end
end
local perp_base = path.join(config["etc_dir"], "perp")
local args = {
"-0", "api-umbrella",
"-P", path.join(config["run_dir"], "perpboot.pid"),
"perpboot",
}
if options and options["background"] then
table.insert(args, 1, "-d")
end
table.insert(args, perp_base)
unistd.execp("runtool", args)
-- execp should replace the current process, so we've gotten this far it
-- means execp failed, likely due to the "runtool" command not being found.
print("Error: runtool command was not found")
os.exit(1)
end
return function(options)
local config = setup()
start_perp(config, options)
end
| local path = require "pl.path"
local setup = require "api-umbrella.cli.setup"
local status = require "api-umbrella.cli.status"
local unistd = require "posix.unistd"
local function start_perp(config, options)
local running, _ = status()
if running then
print "api-umbrella is already running"
if options and options["background"] then
os.exit(0)
else
os.exit(1)
end
end
local perp_base = path.join(config["etc_dir"], "perp")
local args = {
"-0", "api-umbrella",
"-P", path.join(config["run_dir"], "perpboot.pid"),
}
-- perpboot won't work if we try to log to the console (since it expects the
-- perp/.boot/rc.log to always be executable). So revert to the lower-level
-- perpd startup if we want to log everything to stdout/stderr.
if config["log"]["destination"] == "console" then
table.insert(args, "perpd")
else
table.insert(args, "perpboot")
end
if options and options["background"] then
table.insert(args, 1, "-d")
end
table.insert(args, perp_base)
unistd.execp("runtool", args)
-- execp should replace the current process, so we've gotten this far it
-- means execp failed, likely due to the "runtool" command not being found.
print("Error: runtool command was not found")
os.exit(1)
end
return function(options)
local config = setup()
start_perp(config, options)
end
| Add ability to log output to stdout/stderr instead of files. | Add ability to log output to stdout/stderr instead of files.
| Lua | mit | NREL/api-umbrella,NREL/api-umbrella,NREL/api-umbrella,NREL/api-umbrella |
3def45a49c5750d289b3a702077cd80e45948e44 | conf.lua | conf.lua | function love.conf(t)
t.name = "EmuFun"
t.author = "Ben 'ToxicFrog' Kelly"
t.identity = "emufun"
t.version = "0.8.0"
t.screen.width = 800
t.screen.height = 600
t.screen.fullscreen = false
t.screen.vsync = true
t.screen.fsaa = 0
t.modules.graphics = true
t.modules.image = true -- for loading the default filetype images
t.modules.joystick = true
t.modules.keyboard = true
t.modules.event = true -- or none of the event handlers work
t.modules.timer = true -- for framerate limiting
t.modules.mouse = true -- for mouse.setVisible
t.modules.audio = false
t.modules.sound = false
t.modules.physics = false
end
| function love.conf(t)
t.name = "EmuFun"
t.author = "Ben 'ToxicFrog' Kelly"
t.identity = "emufun"
t.version = "0.8.0"
t.console = true -- enable console on windows for debug logging
t.screen.width = 800
t.screen.height = 600
t.screen.fullscreen = false
t.screen.vsync = true
t.screen.fsaa = 0
t.modules.graphics = true
t.modules.image = true -- for loading the default filetype images
t.modules.joystick = true
t.modules.keyboard = true
t.modules.event = true -- or none of the event handlers work
t.modules.timer = true -- for framerate limiting
t.modules.mouse = true -- for mouse.setVisible
t.modules.audio = false
t.modules.sound = false
t.modules.physics = false
end
| Enable console on windows version | Enable console on windows version
| Lua | mit | ToxicFrog/EmuFun |
6c1d91f66d848ef99a19ba4d53162d5f3b58c0c1 | modules/vim/installed-config/plugin/fzf-lua.lua | modules/vim/installed-config/plugin/fzf-lua.lua | local fzf_lua = require('fzf-lua')
fzf_lua.setup({
fzf_bin = 'sk',
fzf_opts = {
['--layout'] = 'default',
},
files = {
fd_opts = "--color=never --type f --hidden --no-ignore --exclude .git"
},
lsp = {
jump_to_single_result = true
}
})
vim.cmd("FzfLua register_ui_select")
| local fzf_lua = require('fzf-lua')
fzf_lua.setup({
fzf_bin = 'sk',
fzf_opts = {
['--layout'] = 'default',
},
files = {
fd_opts = "--color=never --type f --hidden --no-ignore --exclude .git"
},
git = {
files = {
cmd = 'git ls-files --exclude-standard --others --cached'
}
},
lsp = {
jump_to_single_result = true
}
})
vim.cmd("FzfLua register_ui_select")
| Fix vim GitFiles to include unstaged files | Fix vim GitFiles to include unstaged files
| Lua | mit | justinhoward/dotfiles,justinhoward/dotfiles |
b26d0d92d5f3ca36eee44d9448e076a04552ea20 | build/config.lua | build/config.lua | -- This file contains special configurations values, such as directories to extern libraries (Qt)
-- Editing this file is not required to use/compile the engine, as default values should be enough
-- Additionnal compilation options
--AdditionalCompilationOptions = "-fsanitize=address" -- Enable ASan
-- Builds Nazara extern libraries (such as lua/STB)
BuildDependencies = true
-- Builds Nazara examples
BuildExamples = true
-- Setup configurations array (valid values: Debug, Release, ReleaseWithDebug)
Configurations = "Debug,Release" -- "Debug,Release,ReleaseWithDebug"
-- Setup additionnals install directories, separated by a semi-colon ; (library binaries will be copied there)
--InstallDir = "/usr/local/lib64"
-- Adds a project which will recall premake with its original arguments when built (only works on Windows for now)
PremakeProject = true
-- Excludes client-only modules/tools/examples
ServerMode = false
-- Builds modules as one united library (useless on POSIX systems)
UniteModules = false
| -- This file contains special configurations values, such as directories to extern libraries (Qt)
-- Editing this file is not required to use/compile the engine, as default values should be enough
-- Additionnal compilation options
--AdditionalCompilationOptions = "-fsanitize=address" -- Enable ASan
-- Builds Nazara extern libraries (such as lua/STB)
BuildDependencies = true
-- Builds Nazara examples
BuildExamples = true
-- Setup configurations array (valid values: Debug, Release, ReleaseWithDebug)
Configurations = "Debug,Release" -- "Debug,Release,ReleaseWithDebug"
-- Setup additionnals install directories, separated by a semi-colon ; (library binaries will be copied there)
--InstallDir = "/usr/local/lib64"
-- Adds a project which will recall premake with its original arguments when built (only works on Windows for now)
PremakeProject = false
-- Excludes client-only modules/tools/examples
ServerMode = false
-- Builds modules as one united library (useless on POSIX systems)
UniteModules = false
| Disable premake project by default | Build: Disable premake project by default
| Lua | mit | DigitalPulseSoftware/NazaraEngine |
c81b98b33cf26f01fb1963daa974d0922ebdd2f9 | empty-drills_0.0.1/styles/main.lua | empty-drills_0.0.1/styles/main.lua | --- Location view gui
data.raw["gui-style"].default["lv_location_view"] =
{
type = "button_style",
parent = "button_style",
width = 100,
height = 100,
top_padding = 65,
right_padding = 0,
bottom_padding = 0,
left_padding = 0,
font = "font-mb",
default_font_color = {r=0.98, g=0.66, b=0.22},
default_graphical_set =
{
type = "monolith",
monolith_image =
{
filename = "location.png",
priority = "extra-high-no-scale",
width = 100,
height = 100,
x = 0
}
},
hovered_graphical_set =
{
type = "monolith",
monolith_image =
{
filename = "location-hover.png",
priority = "extra-high-no-scale",
width = 100,
height = 100,
x = 0
}
},
clicked_graphical_set =
{
type = "monolith",
monolith_image =
{
filename = "location-hover.png",
width = 100,
height = 100,
x = 0
}
}
}
| --- Location view gui
data.raw["gui-style"].default["lv_location_view"] =
{
type = "button_style",
parent = "button_style",
width = 100,
height = 100,
top_padding = 65,
right_padding = 0,
bottom_padding = 0,
left_padding = 0,
font = "font-mb",
default_font_color = {r=0.98, g=0.66, b=0.22},
default_graphical_set =
{
type = "monolith",
monolith_image =
{
filename = "__empty-drills__/styles/location.png",
priority = "extra-high-no-scale",
width = 100,
height = 100,
x = 0
}
},
hovered_graphical_set =
{
type = "monolith",
monolith_image =
{
filename = "__empty-drills__/styles/location-hover.png",
priority = "extra-high-no-scale",
width = 100,
height = 100,
x = 0
}
},
clicked_graphical_set =
{
type = "monolith",
monolith_image =
{
filename = "__empty-drills__/styles/location-hover.png",
width = 100,
height = 100,
x = 0
}
}
}
| Fix empty drills bug because of moved resource location | Fix empty drills bug because of moved resource location
| Lua | mit | Zomis/FactorioMods |
ddc8fffed15bf85ba48ac0d0f8dbfc4ec0e91f61 | build/scripts/modules/physics3d.lua | build/scripts/modules/physics3d.lua | MODULE.Name = "Physics3D"
MODULE.Defines = {
"_NEWTON_STATIC_LIB"
}
MODULE.OsDefines.Windows = {
"_WINDOWS"
}
MODULE.Libraries = {
"NazaraCore",
"newton" -- Newton Game Dynamics
}
MODULE.Custom = function()
vectorextensions("SSE3")
filter({"architecture:x86_64", "system:linux"})
defines("_POSIX_VER_64")
filter({"architecture:x86", "system:linux"})
defines("_POSIX_VER")
end
| MODULE.Name = "Physics3D"
MODULE.Defines = {
"_NEWTON_STATIC_LIB"
}
MODULE.OsDefines.Windows = {
"_WINDOWS"
}
MODULE.Libraries = {
"NazaraCore",
"newton" -- Newton Game Dynamics
}
MODULE.Custom = function()
vectorextensions("SSE3")
filter({"architecture:x86_64", "system:linux"})
defines("_POSIX_VER_64")
filter({"architecture:x86", "system:linux"})
defines("_POSIX_VER")
filter({"architecture:x86_64", "system:macosx"})
defines("_POSIX_VER_64")
filter({"architecture:x86", "system:macosx"})
defines("_POSIX_VER")
end
| Add the required defines for Newton in Physics3D | Add the required defines for Newton in Physics3D | Lua | mit | DigitalPulseSoftware/NazaraEngine |
49e4b108671099c2af217793e4bb89190ee32b40 | includes/common.lua | includes/common.lua | function page_set_title(title)
ophal.title = (title and title .. [[ | ]] or [[]]) .. settings.site_name
end | function page_set_title(header_title, title)
if title == nil then title = header_title end
ophal.title = title
ophal.header_title = (header_title and header_title .. [[ | ]] or [[]]) .. settings.site_name
end | Add support for Header title and Body title to function page_set_title(). | Add support for Header title and Body title to function page_set_title().
| Lua | agpl-3.0 | coinzen/coinage,ophal/core,ophal/core,coinzen/coinage,ophal/core,coinzen/coinage |
24f41a3aa4ed9c2d057bb4c4cfc6e7f85252e72c | home/.config/nvim/lua/plugin-config/treesitter.lua | home/.config/nvim/lua/plugin-config/treesitter.lua | require'nvim-treesitter.configs'.setup {
ensure_installed = "maintained",
highlight = {
enable = true
},
playground = {
enable = true,
disable = {},
updatetime = 25, -- Debounced time for highlighting nodes in the playground from source code
persist_queries = false -- Whether the query persists across vim sessions
}
}
if vim.env.GLIMMER_DEBUG == 'true' then
local parser_config = require "nvim-treesitter.parsers".get_parser_configs()
parser_config.glimmer = {
install_info = {
url = "~/Development/OpenSource/tree-sitter-glimmer",
files = {
"src/parser.c",
"src/scanner.c"
}
},
filetype = "hbs",
used_by = {
"handlebars",
"html.handlebars"
}
}
end
| require'nvim-treesitter.configs'.setup {
ensure_installed = {
"javascript", "typescript", "jsdoc", "tsx",
"regex", "bash", "json",
"html", "glimmer", "lua"
},
highlight = {
enable = true
},
playground = {
enable = true,
disable = {},
updatetime = 25, -- Debounced time for highlighting nodes in the playground from source code
persist_queries = false -- Whether the query persists across vim sessions
}
}
if vim.env.GLIMMER_DEBUG == 'true' then
local parser_config = require "nvim-treesitter.parsers".get_parser_configs()
parser_config.glimmer = {
install_info = {
url = "~/Development/OpenSource/tree-sitter-glimmer",
files = {
"src/parser.c",
"src/scanner.c"
}
},
filetype = "hbs",
used_by = {
"handlebars",
"html.handlebars"
}
}
end
| Use explicit languages to speed up update/install time | Use explicit languages to speed up update/install time
| Lua | mit | NullVoxPopuli/dotfiles,NullVoxPopuli/dotfiles,NullVoxPopuli/dotfiles |
4f8eff96292144ed7a17582d5d327433d405dcbb | EXAMPLE.lua | EXAMPLE.lua | local monitorSide = "left"
if peripheral.isPresent(monitorSide) and peripheral.getType(monitorSide) == "monitor" then
term.redirect(peripheral.wrap(monitorSide))
else
print("No monitor found")
return
end
function explode(inSplitPattern, str)
local outResults = { }
local theStart = 1
local theSplitStart, theSplitEnd = string.find( str, inSplitPattern, theStart )
while theSplitStart do
local sub = string.sub( str, theStart, theSplitStart-1 )
table.insert( outResults, sub)
theStart = theSplitEnd + 1
theSplitStart, theSplitEnd = string.find( str, inSplitPattern, theStart )
end
table.insert( outResults, string.sub( str, theStart ) )
return outResults
end
function printColouredBars(str, first)
parts = explode("|", str)
local l = #parts
for k = 1, l do
if first then
term.setTextColor(colors.blue)
end
io.write(parts[k])
if first then
term.setTextColor(colors.white)
end
if k ~= l then
term.setTextColor(colors.red)
io.write("|")
term.setTextColor(colors.white)
end
end
end
function profile()
local file = fs.open("profile.txt", "r")
local text = file.readAll()
file.close()
local tables = explode("\n\n", text)
term.clear()
local i, j
for i = 1, #tables do
lines = explode("\n", tables[i] .. "")
for j = 1, #lines do
printColouredBars(lines[j] .. "\n", j == 1)
end
if i ~= #tables then
io.write("\n")
end
end
end
while true do
sleep(60)
profile()
end
term.restore()
| Add example CC lua file for profiling on a monitor. | Add example CC lua file for profiling on a monitor.
Signed-off-by: Ross Allan <ca2c77e14df1e7ee673215c1ef658354e220f471@gmail.com>
| Lua | mit | nallar/TickProfiler | |
e080fde00efb1ede7f29bf1570ae72eecc7f83d6 | neovim/.config/nvim/lua/toggleterm-setup.lua | neovim/.config/nvim/lua/toggleterm-setup.lua | require"toggleterm".setup{
size = 20,
open_mapping = [[<c-s>]],
shade_terminals = false,
start_in_insert = true,
persist_size = true,
direction = 'horizontal',
}
| require"toggleterm".setup{
open_mapping = [[<c-s>]],
shade_terminals = false,
start_in_insert = true,
persist_size = true,
direction = 'window',
}
| Switch to full screen toggle term | Switch to full screen toggle term
| Lua | mit | bronzehedwick/dotfiles,bronzehedwick/dotfiles,bronzehedwick/dotfiles,bronzehedwick/dotfiles |
d64f17a5110efeee580cb2fd2c106fa3c4578762 | tests/func/print-hook-name.lua | tests/func/print-hook-name.lua | client_socket( function () print('TRACE:client_socket') end )
client_sendmsg( function () print('TRACE:client_sendmsg') end )
client_recvmsg( function () print('TRACE:client_recvmsg') end )
client_recverr( function () print('TRACE:client_recverr') end )
client_close( function () print('TRACE:client_close') end )
server_socket( function () print('TRACE:server_socket') end )
server_sendmsg( function () print('TRACE:server_sendmsg') end )
server_recvmsg( function () print('TRACE:server_recvmsg') end )
server_recverr( function () print('TRACE:server_recverr') end )
server_close( function () print('TRACE:server_close') end )
| client_socket( function () print('TRACE:client_socket') end )
client_sendmsg( function () print('TRACE:client_sendmsg'); return 0 end )
client_recvmsg( function () print('TRACE:client_recvmsg'); return 0 end )
client_recverr( function () print('TRACE:client_recverr'); return 0 end )
client_close( function () print('TRACE:client_close') end )
server_socket( function () print('TRACE:server_socket') end )
server_sendmsg( function () print('TRACE:server_sendmsg'); return 0 end )
server_recvmsg( function () print('TRACE:server_recvmsg'); return 0 end )
server_recverr( function () print('TRACE:server_recverr'); return 0 end )
server_close( function () print('TRACE:server_close') end )
| Return a value from packet hooks to silence errors | tests: Return a value from packet hooks to silence errors
| Lua | apache-2.0 | jsitnicki/rushit,jsitnicki/rushit |
094e86423e192c39921f8941bcf379dbcbc3e3bd | detectem/script.lua | detectem/script.lua | function main(splash)
splash.images_enabled = false
splash.response_body_enabled = true
local url = splash.args.url
assert(splash:go(url))
assert(splash:wait(5))
local detectFunction = [[
detect = function(){
var rs = [];
softwareData.forEach(function(s) {
var matchers = s.matchers;
for (var i in matchers) {
if (eval(matchers[i].check)){
var version = eval(matchers[i].version);
if (version) {
rs.push({'name': s.name, 'version': version});
}
}
}
});
return rs;
}
]]
splash:runjs('softwareData = $js_data;')
splash:runjs(detectFunction)
local softwares = splash:evaljs('detect()')
local scripts = splash:select_all('script')
local sources = {}
for _, s in ipairs(scripts) do
sources[#sources+1] = s.node.innerHTML
end
return {
har = splash:har(),
softwares=softwares,
scripts=sources,
}
end
| function main(splash)
splash.images_enabled = false
splash.response_body_enabled = true
local url = splash.args.url
assert(splash:go(url))
assert(splash:wait(5))
local detectFunction = [[
detect = function(){
var rs = [];
softwareData.forEach(function(s) {
var matchers = s.matchers;
for (var i in matchers) {
if (eval(matchers[i].check)){
var version = eval(matchers[i].version);
if (version) {
rs.push({'name': s.name, 'version': version});
}
}
}
});
return rs;
}
]]
splash:runjs('softwareData = $js_data;')
splash:runjs(detectFunction)
local softwares = {}
local scripts = {}
local errors = {}
local ok, res = pcall(splash.evaljs, self, 'detect()')
if ok then
softwares = res
else
errors['evaljs'] = res
end
local ok, res = pcall(splash.select_all, self, 'script')
if ok then
if res then
for _, s in ipairs(res) do
scripts[#scripts+1] = s.node.innerHTML
end
end
else
errors['select_all'] = res
end
return {
har = splash:har(),
softwares=softwares,
scripts=scripts,
errors=errors,
}
end
| Handle errors when running JavaScript on the sites | Handle errors when running JavaScript on the sites
If the Content Security Policy directive is enabled in the site, then
the JavaScript detection function cannot be evaluated, and Splash will
fail with a Lua script error.
But even if the JavaScript matchers cannot be used, the HAR can still be
processed, so let Splash return the HAR normally in case of errors when
evaluating the JavaScript detection function.
The possible error messages are returned as parte of the output
dictionary, in case they are needed.
| Lua | mit | spectresearch/detectem |
8630a263b6c5f86d57eb0f3a49ddce163c8378c1 | spec/fs_spec.lua | spec/fs_spec.lua | local test_env = require("test/test_environment")
test_env.unload_luarocks()
local fs = require("luarocks.fs")
local is_win = test_env.TEST_TARGET_OS == "windows"
describe("Luarocks fs test #whitebox #w_fs", function()
describe("fs.Q", function()
it("simple argument", function()
assert.are.same(is_win and '"foo"' or "'foo'", fs.Q("foo"))
end)
it("argument with quotes", function()
assert.are.same(is_win and [["it's \"quoting\""]] or [['it'\''s "quoting"']], fs.Q([[it's "quoting"]]))
end)
it("argument with special characters", function()
assert.are.same(is_win and [["\\"%" \\\\" \\\\\\"]] or [['\% \\" \\\']], fs.Q([[\% \\" \\\]]))
end)
end)
end)
| Add a few tests for fs.Q | Add a few tests for fs.Q
| Lua | mit | keplerproject/luarocks,tarantool/luarocks,tarantool/luarocks,xpol/luavm,xpol/luainstaller,robooo/luarocks,luarocks/luarocks,robooo/luarocks,luarocks/luarocks,keplerproject/luarocks,xpol/luainstaller,xpol/luarocks,xpol/luavm,luarocks/luarocks,xpol/luainstaller,xpol/luarocks,xpol/luarocks,xpol/luainstaller,robooo/luarocks,xpol/luarocks,xpol/luavm,xpol/luavm,keplerproject/luarocks,tarantool/luarocks,xpol/luavm,robooo/luarocks,keplerproject/luarocks | |
efae3dec4780df224f004a817386dfa2cdf870e2 | test/fib.lua | test/fib.lua | --
-- fib.lua
-- test script for mruby-lua.
--
function fib(k)
if k == 0 then
return 0
elseif k == 1 then
return 1
end
return fib(k - 2) + fib(k - 1)
end
for i=1, 10, 1 do
print(fib(i))
end
| Add Lua script for test. | Add Lua script for test.
| Lua | mit | dyama/mruby-lua,dyama/mruby-lua | |
44844f46716da4585a1d2360f3b5afd65114fd22 | util/jid.lua | util/jid.lua |
local match = string.match;
local tostring = tostring;
local print = print
module "jid"
function split(jid)
if not jid then return; end
-- TODO verify JID, and return; if invalid
local node, nodelen = match(jid, "^([^@]+)@()");
local host, hostlen = match(jid, "^([^@/]+)()", nodelen)
if node and not host then return nil, nil, nil; end
local resource = match(jid, "^/(.+)$", hostlen);
if (not host) or ((not resource) and #jid >= hostlen) then return nil, nil, nil; end
return node, host, resource;
end
function bare(jid)
local node, host = split(jid);
if node and host then
return node.."@"..host;
elseif host then
return host;
end
return nil;
end
return _M;
|
local match = string.match;
module "jid"
function split(jid)
if not jid then return; end
-- TODO verify JID, and return; if invalid
local node, nodelen = match(jid, "^([^@]+)@()");
local host, hostlen = match(jid, "^([^@/]+)()", nodelen)
if node and not host then return nil, nil, nil; end
local resource = match(jid, "^/(.+)$", hostlen);
if (not host) or ((not resource) and #jid >= hostlen) then return nil, nil, nil; end
return node, host, resource;
end
function bare(jid)
local node, host = split(jid);
if node and host then
return node.."@"..host;
elseif host then
return host;
end
return nil;
end
return _M;
| Remove some declarations I added while debugging | Remove some declarations I added while debugging
| Lua | mit | sarumjanuch/prosody,sarumjanuch/prosody |
6a9c3b871c9aaa8c13e8069e99efeb27b890f5d5 | extensions/pathwatcher/init.lua | extensions/pathwatcher/init.lua | --- === hs.pathwatcher ===
---
--- Watch paths recursively for changes
---
--- This simple example watches your Hammerspoon directory for changes, and when it sees a change, reloads your configs:
---
--- hs.pathwatcher.new(os.getenv("HOME") .. "/.Hammerspoon/", hs.reload):start()
---
--- This module is based primarily on code from the previous incarnation of Mjolnir by [Steven Degutis](https://github.com/sdegutis/).
local module = require("hs.pathwatcher.internal")
-- private variables and methods -----------------------------------------
-- Public interface ------------------------------------------------------
-- Return Module Object --------------------------------------------------
return module
| --- === hs.pathwatcher ===
---
--- Watch paths recursively for changes
---
--- This simple example watches your Hammerspoon directory for changes, and when it sees a change, reloads your configs:
---
--- hs.pathwatcher.new(os.getenv("HOME") .. "/.hammerspoon/", hs.reload):start()
---
--- This module is based primarily on code from the previous incarnation of Mjolnir by [Steven Degutis](https://github.com/sdegutis/).
local module = require("hs.pathwatcher.internal")
-- private variables and methods -----------------------------------------
-- Public interface ------------------------------------------------------
-- Return Module Object --------------------------------------------------
return module
| Fix a tiny typo in hs.pathwatcher docs | Fix a tiny typo in hs.pathwatcher docs
| Lua | mit | junkblocker/hammerspoon,peterhajas/hammerspoon,Habbie/hammerspoon,joehanchoi/hammerspoon,chrisjbray/hammerspoon,wsmith323/hammerspoon,Hammerspoon/hammerspoon,chrisjbray/hammerspoon,trishume/hammerspoon,hypebeast/hammerspoon,cmsj/hammerspoon,ocurr/hammerspoon,zzamboni/hammerspoon,heptal/hammerspoon,TimVonsee/hammerspoon,cmsj/hammerspoon,cmsj/hammerspoon,chrisjbray/hammerspoon,latenitefilms/hammerspoon,heptal/hammerspoon,wvierber/hammerspoon,emoses/hammerspoon,peterhajas/hammerspoon,emoses/hammerspoon,nkgm/hammerspoon,peterhajas/hammerspoon,dopcn/hammerspoon,bradparks/hammerspoon,TimVonsee/hammerspoon,TimVonsee/hammerspoon,cmsj/hammerspoon,junkblocker/hammerspoon,latenitefilms/hammerspoon,zzamboni/hammerspoon,wvierber/hammerspoon,Habbie/hammerspoon,chrisjbray/hammerspoon,lowne/hammerspoon,kkamdooong/hammerspoon,knl/hammerspoon,lowne/hammerspoon,Habbie/hammerspoon,zzamboni/hammerspoon,nkgm/hammerspoon,wsmith323/hammerspoon,asmagill/hammerspoon,CommandPost/CommandPost-App,knl/hammerspoon,Hammerspoon/hammerspoon,heptal/hammerspoon,bradparks/hammerspoon,kkamdooong/hammerspoon,latenitefilms/hammerspoon,kkamdooong/hammerspoon,nkgm/hammerspoon,joehanchoi/hammerspoon,wsmith323/hammerspoon,zzamboni/hammerspoon,chrisjbray/hammerspoon,wvierber/hammerspoon,wsmith323/hammerspoon,asmagill/hammerspoon,chrisjbray/hammerspoon,knu/hammerspoon,lowne/hammerspoon,knu/hammerspoon,CommandPost/CommandPost-App,latenitefilms/hammerspoon,dopcn/hammerspoon,emoses/hammerspoon,hypebeast/hammerspoon,ocurr/hammerspoon,Stimim/hammerspoon,emoses/hammerspoon,knu/hammerspoon,bradparks/hammerspoon,ocurr/hammerspoon,zzamboni/hammerspoon,asmagill/hammerspoon,latenitefilms/hammerspoon,knl/hammerspoon,nkgm/hammerspoon,dopcn/hammerspoon,CommandPost/CommandPost-App,Habbie/hammerspoon,cmsj/hammerspoon,asmagill/hammerspoon,trishume/hammerspoon,Hammerspoon/hammerspoon,CommandPost/CommandPost-App,Habbie/hammerspoon,joehanchoi/hammerspoon,Stimim/hammerspoon,TimVonsee/hammerspoon,trishume/hammerspoon,junkblocker/hammerspoon,Habbie/hammerspoon,knl/hammerspoon,tmandry/hammerspoon,latenitefilms/hammerspoon,Hammerspoon/hammerspoon,peterhajas/hammerspoon,kkamdooong/hammerspoon,kkamdooong/hammerspoon,joehanchoi/hammerspoon,Stimim/hammerspoon,wvierber/hammerspoon,hypebeast/hammerspoon,ocurr/hammerspoon,bradparks/hammerspoon,Hammerspoon/hammerspoon,dopcn/hammerspoon,emoses/hammerspoon,hypebeast/hammerspoon,knu/hammerspoon,zzamboni/hammerspoon,lowne/hammerspoon,CommandPost/CommandPost-App,dopcn/hammerspoon,junkblocker/hammerspoon,Hammerspoon/hammerspoon,wsmith323/hammerspoon,junkblocker/hammerspoon,ocurr/hammerspoon,bradparks/hammerspoon,wvierber/hammerspoon,knl/hammerspoon,cmsj/hammerspoon,lowne/hammerspoon,tmandry/hammerspoon,nkgm/hammerspoon,asmagill/hammerspoon,hypebeast/hammerspoon,heptal/hammerspoon,heptal/hammerspoon,tmandry/hammerspoon,TimVonsee/hammerspoon,CommandPost/CommandPost-App,peterhajas/hammerspoon,knu/hammerspoon,asmagill/hammerspoon,Stimim/hammerspoon,Stimim/hammerspoon,joehanchoi/hammerspoon,knu/hammerspoon |
8bca6712f72cea6452d5ce737fbcc60823fefed4 | modulefiles/Core/circos/0.68.lua | modulefiles/Core/circos/0.68.lua | help(
[[
This module loads Circos 0.68
Circos is a software package for visualizing data and information. It visualizes
data in a circular layout — this makes Circos ideal for exploring relationships
between objects or positions. There are other reasons why a circular layout is
advantageous, not the least being the fact that it is attractive.
]])
whatis("Loads Circos")
local version = "0.68"
local base = "/cvmfs/oasis.opensciencegrid.org/osg/modules/circos/"..version
prepend_path("PATH", pathJoin(base, "bin"))
prepend_path("PERL5LIB", pathJoin(base,"/lib"))
family('circos')
| help(
[[
This module loads Circos 0.68
Circos is a software package for visualizing data and information. It visualizes
data in a circular layout — this makes Circos ideal for exploring relationships
between objects or positions. There are other reasons why a circular layout is
advantageous, not the least being the fact that it is attractive.
]])
whatis("Loads Circos")
local version = "0.68"
local base = "/cvmfs/oasis.opensciencegrid.org/osg/modules/circos/"..version
prepend_path("PATH", pathJoin(base, "bin"))
prepend_path("PERL5LIB", pathJoin(base,"lib"))
load('cpan/perl-5.10')
family('circos')
| Fix lab and add requires | Fix lab and add requires
| Lua | apache-2.0 | OSGConnect/modulefiles,OSGConnect/modulefiles,OSGConnect/modulefiles |
26620e179dad8b12ac2ccef018706803b7c713c7 | doc/examples/update-desc.rbxmk.lua | doc/examples/update-desc.rbxmk.lua | -- Update stored copy of descriptors. Include dump.desc-patch.json.
--
-- Usage:
-- rbxmk run --desc-latest update-desc.rbxmk.lua OUTPUT
assert(rbxmk.globalDesc, "must run with --desc-latest option")
local patch = fs.read(path.expand("$sd/dump-patch/dump.desc-patch.json"))
rbxmk.globalDesc:Patch(patch)
local output = ...
if type(output) ~= "string" then
print(rbxmk.encodeFormat("desc.json", rbxmk.globalDesc))
return
end
fs.write(output, rbxmk.globalDesc, "desc.json")
| Add example to update descriptor file. | Add example to update descriptor file.
| Lua | mit | Anaminus/rbxmk,Anaminus/rbxmk | |
be1b873c5533eb0da14f095a11bba25d3567a388 | tests/testREPL.lua | tests/testREPL.lua | require 'dok'
require 'dokx'
local tester = torch.Tester()
local myTests = {}
function assertHaveDoc(name, symbol)
local doc = dok.help(symbol, true)
tester:assertne(nil, doc, "REPL couldn't get doc for " .. name)
end
function myTests:testREPL()
assertHaveDoc('dokx', dokx)
for name, func in pairs(dokx) do
assertHaveDoc('dokx.' .. name, func)
end
end
tester:add(myTests)
tester:run()
| require 'dok'
require 'dokx'
--[[
This test checks whether it's possible to access the docs for torch-dokx from the torch REPL (using the torch 'dok' system).
This relies on the Markdown docs having been installed in the correct place in the torch rocks tree - for example `~/usr/local/share/lua/5.1/dokx/doc`.
These could be installed by, for example:
dokx-build-package-docs -o /tmp/testDocs/ /path/to/dokx/repository --repl ~/usr/local/share/lua/5.1/dokx/doc
--]]
local tester = torch.Tester()
local myTests = {}
function myTests:testREPL()
local succeeded = {}
local failed = {}
if dok.help(dokx, true) == nil then
table.insert(failed, 'dokx')
end
for name, func in pairs(dokx) do
-- We'll check docs for everything in the global dokx table, except for private functions and the logger object.
if name:sub(1,1) ~= "_" and name ~= 'logger' then
-- This is equivalent to calling the help() function from the REPL, except that it returns a string.
local doc = dok.help(func, true)
-- For reporting the results, we keep track of which item had or did not have docs
local symbol = 'dokx.' .. name
if doc == nil then
table.insert(failed, symbol)
else
table.insert(succeeded, symbol)
end
end
end
-- Fail if any items were missing docs
tester:asserteq(#failed, 0, "REPL couldn't get doc for some functions")
if #failed ~= 0 then
print("Suceeded: ", succeeded)
print("Failed: ", failed)
end
end
tester:add(myTests)
tester:run()
| Adjust REPL doc test. Passes except for package level help | Adjust REPL doc test. Passes except for package level help | Lua | bsd-3-clause | deepmind/torch-dokx,Gueust/torch-dokx,yozw/torch-dokx,deepmind/torch-dokx,deepmind/torch-dokx,Gueust/torch-dokx,yozw/torch-dokx,yozw/torch-dokx,Gueust/torch-dokx |
30f0125622226423bafb6d47efac85e8a446c28b | upstream_config.lua | upstream_config.lua | local router = require "resty.router"
local r = router:new("resty.router.redis_dns")
local method = ngx.req.get_method()
if method == ngx.HTTP_GET then
local ok, err = r:set_route(ngx.var.arg_location,ngx.var.arg_upstream,ngx.var.arg_ttl)
end
if method == ngx.HTTP_DELETE then
local ok, err = r:unset_route(ngx.var.arg_location)
end
if not ok then
ngx.status = 500
ngx.say(err)
return ngx.exit(500)
end
ngx.var.rr_status = ok
| local router = require "resty.router"
local r = router:new("resty.router.redis_dns")
local method = ngx.req.get_method()
local ok = nil
local err = nil
if method == ngx.HTTP_GET then
ok, err = r:set_route(ngx.var.arg_location,ngx.var.arg_upstream,ngx.var.arg_ttl)
end
if method == ngx.HTTP_DELETE then
ok, err = r:unset_route(ngx.var.arg_location)
end
if not ok then
ngx.status = 500
ngx.say(err)
return ngx.exit(500)
end
ngx.var.rr_status = ok
| Fix issue that make configure api return 404 | Fix issue that make configure api return 404
The ok and err variable are out of scope when we check for the error, fixed now | Lua | apache-2.0 | dhiaayachi/dynx,dhiaayachi/dynx |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.