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
9bd95770e430f80f5562878d10b7ce25cd5fa728
sendHttpResponse.lua
sendHttpResponse.lua
local function sendHttpResponse(connection, data) connection:send("HTTP/1.1 200 OK\r\nConnection: close\r\nContent-Type: text/html; charset=ISO-8859-4\r\nContent-Length: " .. data:len() .. "\r\n\r\n" .. data) end return sendHttpResponse
local function sendHttpResponse(connection, data) connection:send("HTTP/1.1 200 OK\r\nAccess-Control-Allow-Origin: *\r\nConnection: close\r\nContent-Type: text/html; charset=ISO-8859-4\r\nContent-Length: " .. data:len() .. "\r\n\r\n" .. data) end return sendHttpResponse
Set CORS header in http response to allow calling the modules' API from web applications other than its built-in demo html
Set CORS header in http response to allow calling the modules' API from web applications other than its built-in demo html
Lua
mit
tjclement/esp-common
b3c91e4e7e404964cb2c393decce064decb5ef44
hammerspoon/init.lua
hammerspoon/init.lua
hs.window.animationDuration = 0 -- disable animations require('microphone') require('windows') local message = require('status-message') function reloadConfig(files) doReload = false for _,file in pairs(files) do if file:sub(-4) == ".lua" then doReload = true end end if doReload then hs.reload() end end myWatcher = hs.pathwatcher.new(os.getenv("HOME") .. "/.hammerspoon/", reloadConfig):start() message.new("Config loaded"):notify()
hs.window.animationDuration = 0 -- disable animations require('microphone') require('windows') local message = require('status-message') hs.hotkey.bind({"command", "control"}, "return", function() message.new("Starting Screensaver"):notify() hs.caffeinate.startScreensaver() end) function reloadConfig(files) doReload = false for _,file in pairs(files) do if file:sub(-4) == ".lua" then doReload = true end end if doReload then hs.reload() end end myWatcher = hs.pathwatcher.new(os.getenv("HOME") .. "/.hammerspoon/", reloadConfig):start() message.new("Config loaded"):notify()
Add hotkey for locking screen
Add hotkey for locking screen
Lua
mit
mkornblum/.dotfiles,mkornblum/.dotfiles,mkornblum/.dotfiles,mkornblum/.dotfiles
3721ba59f384ff51120fead911d3b409ec7d52fc
extensions/experimental/init.lua
extensions/experimental/init.lua
-- Buildat: extension/experimental/init.lua -- http://www.apache.org/licenses/LICENSE-2.0 -- Copyright 2014 Perttu Ahola <celeron55@gmail.com> local log = buildat.Logger("extension/experimental") local M = {safe = {}} local subs_tick = {} function __buildat_tick(dtime) for _, cb in ipairs(subs_tick) do cb(dtime) end end function M.safe.sub_tick(cb) table.insert(subs_tick, cb) end function M.safe.unsub_tick(cb) for i=#subs_tick,1,-1 do if subs_tick[i] == cb then table.remove(subs_tick, i) end end end local polybox = require("buildat/extension/polycode_sandbox") --[[ local function SomeUI(scene) local self = {} local function on_button_click() log:info("SomeUI: on_button_click()") end self.button = UIButton("Foo", 100, 50) scene:addEventListener(self, on_button_click, UIEvent.CLICK_EVENT) return self end --]] --[[ class "SomeUI" (UIElement) function SomeUI:SomeUI() UIElement.UIElement(self) self:Resize(100, 60) self:setPosition(640-100, 0) self.button = UIButton("Foo", 100, 30) self:addChild(self.button) end function SomeUI:on_button(e) end M.things = {} function M.safe.do_stuff(scene2d_safe) CoreServices.getInstance():getConfig():setNumericValue("Polycode", "uiButtonFontSize", 20) local scene2d = polybox.check_type(scene2d_safe, "Scene") scene2d.rootEntity.processInputEvents = true local some_ui = SomeUI() scene2d:addEntity(some_ui) table.insert(M.things, some_ui) end ]] return M
-- Buildat: extension/experimental/init.lua -- http://www.apache.org/licenses/LICENSE-2.0 -- Copyright 2014 Perttu Ahola <celeron55@gmail.com> local log = buildat.Logger("extension/experimental") local M = {safe = {}} local subs_tick = {} function __buildat_tick(dtime) for _, cb in ipairs(subs_tick) do cb(dtime) end end function M.safe.sub_tick(cb) table.insert(subs_tick, cb) end function M.safe.unsub_tick(cb) for i=#subs_tick,1,-1 do if subs_tick[i] == cb then table.remove(subs_tick, i) end end end return M
Remove accidentally added unused test code
extensions/experimental: Remove accidentally added unused test code
Lua
apache-2.0
celeron55/buildat,celeron55/buildat,celeron55/buildat,celeron55/buildat
6cbe11e35b9982aad367e30d7cf98b34bf1cd6f3
modulefiles/Core/atlas.lua
modulefiles/Core/atlas.lua
help( [[ This module loads ATLAS 3.10.1 ]]) local version = "3.10.1" local base = "/cvmfs/oasis.opensciencegrid.org/osg/modules/atlas/"..version prepend_path("LD_LIBRARY_PATH", pathJoin(base, "lib64","atlas")) family('atlas')
help( [[ This module loads the ATLAS 3.10.1 libraries. ATLAS is a library that provides support for linear algebra operations. ]]) whatis("Loads ATLAS 3.10.1 libraries for linear algebra operations") local version = "3.10.1" local base = "/cvmfs/oasis.opensciencegrid.org/osg/modules/atlas/"..version prepend_path("LD_LIBRARY_PATH", pathJoin(base, "lib64","atlas")) family('atlas')
Improve help message for ATLAS library module
Improve help message for ATLAS library module
Lua
apache-2.0
OSGConnect/modulefiles,OSGConnect/modulefiles,OSGConnect/modulefiles
d021da19fc81dbe4bc4eb892d9f3a9a4855f57af
scripts/genie.lua
scripts/genie.lua
solution "EasyWindow" location (_ACTION) language "C++" configurations { "Debug", "Release" } platforms { "x32", "x64" } objdir ("../Intermediate/".._ACTION) flags { "StaticRuntime" } project "EasyWindowSample" uuid "f3501d7f-3f2d-476b-b9e2-d6c629e327da" kind "WindowedApp" targetdir "../Output/" files { "../**.cpp", "../**.h", } includedirs { ".." } platforms{} configuration "Debug" targetsuffix "_d" flags { "Symbols" } configuration "Release" targetsuffix "_r" flags { "Optimize" }
solution "EasyWindow" location (_ACTION) language "C++" configurations { "Debug", "Release" } platforms { "x32", "x64" } objdir ("../Intermediate/".._ACTION) flags { "StaticRuntime" } project "EasyWindowSample" uuid "f3501d7f-3f2d-476b-b9e2-d6c629e327da" kind "ConsoleApp" targetdir "../Output/" files { "../**.cpp", "../**.h", } includedirs { ".." } platforms{} configuration "Debug" targetsuffix "_d" flags { "Symbols" } configuration "Release" targetsuffix "_r" flags { "Optimize" }
Set sample project as ConsoleApp for see the output
Set sample project as ConsoleApp for see the output
Lua
mit
thennequin/EasyWindow
75be0dd7a4939119b21909ccd2e85189b2df5c4f
src/cosy/cli/test.lua
src/cosy/cli/test.lua
local Runner = require "busted.runner" require "cosy.loader" Runner () describe ("Module cosy.cli", function () describe("method configure", function() local Cli before_each(function() package.loaded["cosy.cli"] = nil Cli = require "cosy.cli" end) for _, key in ipairs { "server", "color", } do it("should detect the --" .. key, function() Cli.configure { "--debug=true", "--".. key .. "=any_value", } assert.are.equal(Cli.server, "any_value") end) it("should detect --" .. key .. " is missing", function() Cli.configure { "--debug=true", "-".. key .. "=any_value", } assert.is_nil( Cli.server) end) it("should fail by detecting several --" .. key, function() assert.has.errors( function () Cli.configure { "--debug=true", "--".. key .. "=any_value", "--".. key .. "=any_value", } end) end) end end) end)
local Runner = require "busted.runner" require "cosy.loader" Runner () describe ("Module cosy.cli", function () describe("method configure", function() local Cli before_each(function() package.loaded["cosy.cli"] = nil Cli = require "cosy.cli" end) for _, key in ipairs { "server", "color", } do it("should detect the --" .. key, function() Cli.configure { "--debug=true", "--".. key .. "=any_value", } assert.are.equal(Cli[key], "any_value") end) it("should detect --" .. key .. " is missing", function() Cli.configure { "--debug=true", "-".. key .. "=any_value", } assert.is_nil( Cli[key]) end) it("should fail by detecting several --" .. key, function() assert.has.errors( function () Cli.configure { "--debug=true", "--".. key .. "=any_value", "--".. key .. "=any_value", } end) end) end end) end)
Fix bug replacing server by generic key.
Fix bug replacing server by generic key.
Lua
mit
CosyVerif/library,CosyVerif/library,CosyVerif/library
36af436e8207b9be84a43c7507520f3eba98a972
cli.lua
cli.lua
-- require('mobdebug').start() io.stdout:setvbuf('no') local path = require 'pl.path' local emu = require 'emu' -- local dir = ... local dir = '/home/cpup/code/lua/cc-emu/dev' dir = path.normpath(path.join(path.currentdir(), dir)) emu(dir)
-- require('mobdebug').start() io.stdout:setvbuf('no') local path = require 'pl.path' local emu = require 'emu' local dir = ... -- local dir = '/home/cpup/code/lua/cc-emu/dev' dir = path.normpath(path.join(path.currentdir(), dir)) emu(dir)
Enable passing the directory as an argument
Enable passing the directory as an argument
Lua
mit
CoderPuppy/cc-emu,CoderPuppy/cc-emu,CoderPuppy/cc-emu
ec65023f8a8c01bee8e76d21a4e5b69cb19e9c4e
npc/base/consequence/gemcraft.lua
npc/base/consequence/gemcraft.lua
require("base.class") require("npc.base.consequence.consequence") require("item.gems") module("npc.base.consequence.gemcraft", package.seeall) craft = base.class.class(npc.base.consequence.consequence.consequence, function(self) npc.base.consequence.consequence.consequence:init(self); self["perform"] = _craft_helper; end); function _craft_helper(self, npcChar, player) if (self["craftNPC"] == nil) then player:inform("This gem crafting NPC has a bug. Please inform a developer so he can beat the person responsible."); return; end; item.gems.gemCraft:showDialog(player, npcChar) end;
require("base.class") require("npc.base.consequence.consequence") require("item.gems") module("npc.base.consequence.gemcraft", package.seeall) gemcraft = base.class.class(npc.base.consequence.consequence.consequence, function(self) npc.base.consequence.consequence.consequence:init(self); self["perform"] = _craft_helper; end); function _craft_helper(self, npcChar, player) if (self["craftNPC"] == nil) then player:inform("This gem crafting NPC has a bug. Please inform a developer so he can beat the person responsible."); return; end; item.gems.gemCraft:showDialog(player, npcChar) end;
Fix consequence for gem crafting
Fix consequence for gem crafting
Lua
agpl-3.0
Illarion-eV/Illarion-Content,vilarion/Illarion-Content,Baylamon/Illarion-Content,LaFamiglia/Illarion-Content,KayMD/Illarion-Content
5bbdda8968da0aac5a6fde7a95ab7f559905adaf
apicast/src/oauth.lua
apicast/src/oauth.lua
local env = require 'resty.env' local router = require 'router' local oauth local _M = { _VERSION = '0.0.2' } function _M.new() local keycloak = env.get('RHSSO_ENDPOINT') if keycloak then oauth = require 'oauth.keycloak' oauth.init(keycloak) else oauth = require 'oauth.apicast_oauth' end return oauth.new() end function _M.router() -- TODO: use configuration to customize urls local r = router:new() oauth = _M.new() r:get('/authorize', function() oauth:authorize() end) r:post('/authorize', function() oauth:authorize() end) -- TODO: only applies to apicast oauth... r:post('/callback', function() oauth:callback() end) r:get('/callback', function() oauth:callback() end) r:post('/oauth/token', function() oauth:get_token() end) return r end function _M.call(method, uri, ...) local r = _M.router() local f, params = r:resolve(method or ngx.req.get_method(), uri or ngx.var.uri, unpack(... or {})) return f, params end return _M
local env = require 'resty.env' local router = require 'router' local apicast_oauth = require 'oauth.apicast_oauth' local keycloak = require 'oauth.keycloak' local _M = { _VERSION = '0.0.2' } function _M.new() local oauth if keycloak.configured then oauth = keycloak.new() else oauth = apicast_oauth.new() end return oauth end function _M.router() -- TODO: use configuration to customize urls local r = router:new() oauth = _M.new() r:get('/authorize', function() oauth:authorize() end) r:post('/authorize', function() oauth:authorize() end) -- TODO: only applies to apicast oauth... r:post('/callback', function() oauth:callback() end) r:get('/callback', function() oauth:callback() end) r:post('/oauth/token', function() oauth:get_token() end) return r end function _M.call(method, uri, ...) local r = _M.router() local f, params = r:resolve(method or ngx.req.get_method(), uri or ngx.var.uri, unpack(... or {})) return f, params end return _M
Revert changes to require libraries every request
Revert changes to require libraries every request Revert changes to require libraries every request
Lua
mit
3scale/apicast,3scale/docker-gateway,3scale/apicast,3scale/apicast,3scale/docker-gateway,3scale/apicast
00b30ff541751967e1b96c4a0a3593a56ee01bdc
hqnes.lua
hqnes.lua
-- hqnes.lua -- Load the hqnes library and adds ffi functions. local core = require "hqnes.core" local ffi = require "ffi" local hqn = ffi.load("hqnes") ffi.cdef[[ int32_t *hqn_lua_emu_getpixels(const int32_t *); double hqn_lua_emu_getfps(); const int32_t *hqn_lua_emu_defaultpalette(); ]] core.emu.getpixels = function(palette) if not palette then palette = hqn.hqn_lua_emu_defaultpalette() end return hqn.hqn_lua_emu_getpixels(palette) end core.emu.getfps = function() return hqn.hqn_lua_emu_getfps() end core.emu.defaultpalette = function() return hqn.hqn_lua_emu_defaultpalette() end return core
-- hqnes.lua -- Load the hqnes library and adds ffi functions. local core = require "hqnes.core" local ffi = require "ffi" local err,hqn = pcall(ffi.load, "hqnes") if not err then error("Failed to load hqnes library. Did you forget to set LD_LIBRARY_PATH?") end ffi.cdef[[ int32_t *hqn_lua_emu_getpixels(const int32_t *); double hqn_lua_emu_getfps(); const int32_t *hqn_lua_emu_defaultpalette(); ]] core.emu.getpixels = function(palette) if not palette then palette = hqn.hqn_lua_emu_defaultpalette() end return hqn.hqn_lua_emu_getpixels(palette) end core.emu.getfps = function() return hqn.hqn_lua_emu_getfps() end core.emu.defaultpalette = function() return hqn.hqn_lua_emu_defaultpalette() end return core
Add useful error message when library doesn't load
Add useful error message when library doesn't load
Lua
mit
Bindernews/HeadlessQuickNes,Bindernews/HeadlessQuickNes,Bindernews/HeadlessQuickNes
32a58b2029dc86a85b4bade41bfb7124571c596f
build/scripts/tools/unittests.lua
build/scripts/tools/unittests.lua
TOOL.Name = "UnitTests" TOOL.Directory = "../tests" TOOL.EnableConsole = true TOOL.Kind = "Application" TOOL.TargetDirectory = TOOL.Directory TOOL.Defines = { } TOOL.Includes = { "../include" } TOOL.Files = { "../tests/main.cpp", "../tests/Engine/**.cpp" } TOOL.Libraries = { "NazaraCore", "NazaraAudio", "NazaraLua", "NazaraNoise", "NazaraPhysics", "NazaraUtility", "NazaraRenderer", "NazaraGraphics" }
TOOL.Name = "UnitTests" TOOL.Directory = "../tests" TOOL.EnableConsole = true TOOL.Kind = "Application" TOOL.TargetDirectory = TOOL.Directory TOOL.Defines = { } TOOL.Includes = { "../include" } TOOL.Files = { "../tests/main.cpp", "../tests/Engine/**.cpp" } TOOL.Libraries = { "NazaraCore", "NazaraAudio", "NazaraLua", "NazaraGraphics", "NazaraRenderer", "NazaraNetwork", "NazaraNoise", "NazaraPhysics", "NazaraUtility" }
Fix linking against Network module
Build/UnitTest: Fix linking against Network module Former-commit-id: 17370ab2dbe2f9f6b6c3ec84ba2c9d45de832ee0 [formerly a07cdfb9393322e9a145b171835a4270fcf2953d] Former-commit-id: c88597b66d47ecdcbc9a279b96fa840de859634b
Lua
mit
DigitalPulseSoftware/NazaraEngine
2db471328e60378ae602cd745ec76697c13900f0
onmt/modules/WordEmbedding.lua
onmt/modules/WordEmbedding.lua
--[[ nn unit. Maps from word ids to embeddings. Slim wrapper around nn.LookupTable to allow fixed and pretrained embeddings. --]] local WordEmbedding, parent = torch.class('onmt.WordEmbedding', 'onmt.Network') --[[ Parameters: * `vocabSize` - size of the vocabulary * `vecSize` - size of the embedding * `preTrainined` - path to a pretrained vector file * `fix` - keep the weights of the embeddings fixed. --]] function WordEmbedding:__init(vocabSize, vecSize, preTrained, fix) self.vocabSize = vocabSize parent.__init(self, nn.LookupTable(vocabSize, vecSize, onmt.Constants.PAD)) -- If embeddings are given. Initialize them. if preTrained and preTrained:len() > 0 then local vecs = torch.load(preTrained) self.net.weight:copy(vecs) end self.fix = fix if self.fix then self.net.gradWeight = nil end end function WordEmbedding:postParametersInitialization() self.net.weight[onmt.Constants.PAD]:zero() end function WordEmbedding:accGradParameters(input, gradOutput, scale) if not self.fix then self.net:accGradParameters(input, gradOutput, scale) self.net.gradWeight[onmt.Constants.PAD]:zero() end end function WordEmbedding:parameters() if not self.fix then return parent.parameters(self) end end
--[[ nn unit. Maps from word ids to embeddings. Slim wrapper around nn.LookupTable to allow fixed and pretrained embeddings. --]] local WordEmbedding, parent = torch.class('onmt.WordEmbedding', 'onmt.Network') --[[ Parameters: * `vocabSize` - size of the vocabulary * `vecSize` - size of the embedding * `preTrainined` - path to a pretrained vector file * `fix` - keep the weights of the embeddings fixed. --]] function WordEmbedding:__init(vocabSize, vecSize, preTrained, fix) self.vocabSize = vocabSize parent.__init(self, nn.LookupTable(vocabSize, vecSize, onmt.Constants.PAD)) -- If embeddings are given. Initialize them. if preTrained and preTrained:len() > 0 then local vecs = torch.load(preTrained) self.net.weight:copy(vecs) end self.fix = fix if self.fix then self.net.gradWeight = nil end end function WordEmbedding:postParametersInitialization() self.net.weight[onmt.Constants.PAD]:zero() end function WordEmbedding:accGradParameters(input, gradOutput, scale) if self.net.gradWeight then self.net:accGradParameters(input, gradOutput, scale) self.net.gradWeight[onmt.Constants.PAD]:zero() end end function WordEmbedding:parameters() if self.net.gradWeight then return parent.parameters(self) end end
Fix fixed word embeddings condition
Fix fixed word embeddings condition
Lua
mit
da03/OpenNMT,jungikim/OpenNMT,monsieurzhang/OpenNMT,jsenellart-systran/OpenNMT,da03/OpenNMT,OpenNMT/OpenNMT,monsieurzhang/OpenNMT,OpenNMT/OpenNMT,jsenellart-systran/OpenNMT,jungikim/OpenNMT,jsenellart/OpenNMT,da03/OpenNMT,jsenellart/OpenNMT,jungikim/OpenNMT,monsieurzhang/OpenNMT,jsenellart/OpenNMT,jsenellart-systran/OpenNMT,OpenNMT/OpenNMT
f2c7377a114918990f2c70b9b268a841746b5b04
mods/track_players/init.lua
mods/track_players/init.lua
local time_interval = 60.0 local fifo_path = "/home/quentinbd/minetest/worlds/minetestforfun/mt_players_fifo" function players_data() local ps = {} for _, player in ipairs(minetest.get_connected_players()) do local pos = player:getpos() local pname = player:get_player_name() local data = { name = pname, x = pos.x, y = pos.y, z = pos.z } table.insert(ps, data) end if table.getn(ps) == 0 then return '[]\n' end return minetest.write_json(ps) .. '\n' end function time_interval_func() local players = players_data() local fifo = io.open(fifo_path, 'w') if (fifo ~= nil) then fifo:write(players) fifo:close() end minetest.after(time_interval, time_interval_func) end minetest.after(time_interval, time_interval_func)
local time_interval = 30.0 local fifo_path = "/home/quentinbd/minetest/worlds/minetestforfun/mt_players_fifo" function players_data() local ps = {} for _, player in ipairs(minetest.get_connected_players()) do local pos = player:getpos() local pname = player:get_player_name() local data = { name = pname, x = pos.x, y = pos.y, z = pos.z } table.insert(ps, data) end if table.getn(ps) == 0 then return '[]\n' end return minetest.write_json(ps) .. '\n' end function time_interval_func() local players = players_data() local fifo = io.open(fifo_path, 'w') if (fifo ~= nil) then fifo:write(players) fifo:close() end minetest.after(time_interval, time_interval_func) end minetest.after(time_interval, time_interval_func)
Set the refresh of the player positions to 30sec
Set the refresh of the player positions to 30sec (60sec is a too high value for real time status)
Lua
unlicense
Coethium/server-minetestforfun,LeMagnesium/minetest-minetestforfun-server,MinetestForFun/server-minetestforfun,sys4-fr/server-minetestforfun,Coethium/server-minetestforfun,Ombridride/minetest-minetestforfun-server,crabman77/minetest-minetestforfun-server,sys4-fr/server-minetestforfun,MinetestForFun/minetest-minetestforfun-server,LeMagnesium/minetest-minetestforfun-server,Ombridride/minetest-minetestforfun-server,crabman77/minetest-minetestforfun-server,Gael-de-Sailly/minetest-minetestforfun-server,paly2/minetest-minetestforfun-server,Gael-de-Sailly/minetest-minetestforfun-server,LeMagnesium/minetest-minetestforfun-server,Gael-de-Sailly/minetest-minetestforfun-server,paly2/minetest-minetestforfun-server,MinetestForFun/server-minetestforfun,MinetestForFun/minetest-minetestforfun-server,crabman77/minetest-minetestforfun-server,Coethium/server-minetestforfun,Ombridride/minetest-minetestforfun-server,sys4-fr/server-minetestforfun,MinetestForFun/server-minetestforfun,MinetestForFun/minetest-minetestforfun-server
be74f10cd8336cb4053c7c759d6a4cfd33bf1699
lua/removeMessages.lua
lua/removeMessages.lua
local call = redis.call local queue = KEYS[1] local messages = ARGV local queueKey = '{' .. queue .. '}:messages' .. ':' local processingKey = '{' .. queue .. '}:processing' for i = 1, #messages do local id = messages[i] local count = call('LREM', processingKey, -1, id) if count == 1 then local messageKey = queueKey .. id local messageProcessingKey = messageKey .. ':processing' call('UNLINK', messageKey, messageProcessingKey) end end return messages
local call = redis.call local queue = KEYS[1] local messages = ARGV local queueKey = '{' .. queue .. '}:messages' .. ':' local processingKey = '{' .. queue .. '}:processing' for i = 1, #messages do local id = messages[i] local count = call('LREM', processingKey, -1, id) if count == 1 then local messageKey = queueKey .. id local messageProcessingKey = messageKey .. ':processing' call('DEL', messageKey, messageProcessingKey) end end return messages
Revert "Use unlink instead of del for better performance"
Revert "Use unlink instead of del for better performance" This reverts commit 72f7fc48dfffbfbae33f99b297f78552d87eb2f5.
Lua
mit
fenichelar/BQueue
6b4597a76db8bd32dd8165cbf9352a37aa175ade
agents/monitoring/tests/helper.lua
agents/monitoring/tests/helper.lua
local spawn = require('childprocess').spawn local constants = require('constants') local misc = require('monitoring/default/util/misc') function runner(name) return spawn('python', {'agents/monitoring/runner.py', name}) end local child local function start_server(callback) local data = '' callback = misc.fireOnce(callback) child = runner('server_fixture_blocking') child.stderr:on('data', function(d) callback(d) end) child.stdout:on('data', function(chunk) data = data .. chunk if data:find('TLS fixture server listening on port 50061') then callback() end end) return child end local function stop_server(child) if not child then return end child:kill(constants.SIGUSR1) -- USR1 end process:on('exit', function() stop_server(child) end) local exports = {} exports.runner = runner exports.start_server = start_server exports.stop_server = stop_server return exports
local spawn = require('childprocess').spawn local constants = require('constants') local misc = require('monitoring/default/util/misc') function runner(name) return spawn('python', {'agents/monitoring/runner.py', name}) end local child local function start_server(callback) local data = '' callback = misc.fireOnce(callback) child = runner('server_fixture_blocking') child.stderr:on('data', function(d) callback(d) end) child.stdout:on('data', function(chunk) data = data .. chunk if data:find('TLS fixture server listening on port 50061') then callback() end end) return child end local function stop_server(child) if not child then return end child:kill(constants.SIGUSR1) -- USR1 end process:on('exit', function() stop_server(child) end) process:on("error", function(e) stop_server(child) end) local exports = {} exports.runner = runner exports.start_server = start_server exports.stop_server = stop_server return exports
Kill the fixture server always.
Kill the fixture server always. As simple as process:on('error'). This will make tests go better.
Lua
apache-2.0
kans/zirgo,kans/zirgo,kans/zirgo
432a5bf2e8119bec104756e37b96e20279e40c6a
mod_motd_sequential/mod_motd_sequential.lua
mod_motd_sequential/mod_motd_sequential.lua
-- Prosody IM -- Copyright (C) 2008-2010 Matthew Wild -- Copyright (C) 2008-2010 Waqas Hussain -- Copyright (C) 2010 Jeff Mitchell -- -- This project is MIT/X11 licensed. Please see the -- COPYING file in the source package for more information. -- local host = module:get_host(); local motd_jid = module:get_option("motd_jid") or host; local datamanager = require "util.datamanager"; local ipairs = ipairs; local motd_sequential_messages = module:get_option("motd_sequential_messages") or {}; local motd_messagesets = {}; local max = 1; for i, message in ipairs(motd_sequential_messages) do motd_messagesets[i] = message; max = i; end local st = require "util.stanza"; module:hook("resource-bind", function (event) local session = event.session; local alreadyseen_list = datamanager.load(session.username, session.host, "motd_sequential_seen") or { max = 0 }; local alreadyseen = alreadyseen_list["max"] + 1; local mod_stanza; for i = alreadyseen, max do motd_stanza = st.message({ to = session.username..'@'..session.host, from = motd_jid }) :tag("body"):text(motd_messagesets[i]); core_route_stanza(hosts[host], motd_stanza); module:log("debug", "MOTD send to user %s@%s", session.username, session.host); end alreadyseen_list["max"] = max; datamanager.store(session.username, session.host, "motd_sequential_seen", alreadyseen_list); end);
Add new motd_sequential module. This module lets you define numbered messages shown to each user in order, but only once per user, and persistent across server restarts. Useful for notifying users of added features and changes in an incremental fashion.
Add new motd_sequential module. This module lets you define numbered messages shown to each user in order, but only once per user, and persistent across server restarts. Useful for notifying users of added features and changes in an incremental fashion.
Lua
mit
LanceJenkinZA/prosody-modules,vince06fr/prosody-modules,drdownload/prosody-modules,BurmistrovJ/prosody-modules,iamliqiang/prosody-modules,brahmi2/prosody-modules,either1/prosody-modules,stephen322/prosody-modules,amenophis1er/prosody-modules,either1/prosody-modules,apung/prosody-modules,guilhem/prosody-modules,mmusial/prosody-modules,1st8/prosody-modules,prosody-modules/import,heysion/prosody-modules,asdofindia/prosody-modules,amenophis1er/prosody-modules,vfedoroff/prosody-modules,1st8/prosody-modules,stephen322/prosody-modules,syntafin/prosody-modules,obelisk21/prosody-modules,either1/prosody-modules,mmusial/prosody-modules,cryptotoad/prosody-modules,joewalker/prosody-modules,softer/prosody-modules,1st8/prosody-modules,jkprg/prosody-modules,obelisk21/prosody-modules,guilhem/prosody-modules,prosody-modules/import,vfedoroff/prosody-modules,amenophis1er/prosody-modules,olax/prosody-modules,BurmistrovJ/prosody-modules,cryptotoad/prosody-modules,apung/prosody-modules,iamliqiang/prosody-modules,joewalker/prosody-modules,obelisk21/prosody-modules,mmusial/prosody-modules,cryptotoad/prosody-modules,dhotson/prosody-modules,syntafin/prosody-modules,drdownload/prosody-modules,guilhem/prosody-modules,amenophis1er/prosody-modules,asdofindia/prosody-modules,heysion/prosody-modules,amenophis1er/prosody-modules,dhotson/prosody-modules,iamliqiang/prosody-modules,brahmi2/prosody-modules,crunchuser/prosody-modules,either1/prosody-modules,mmusial/prosody-modules,Craige/prosody-modules,cryptotoad/prosody-modules,LanceJenkinZA/prosody-modules,heysion/prosody-modules,crunchuser/prosody-modules,vince06fr/prosody-modules,1st8/prosody-modules,iamliqiang/prosody-modules,guilhem/prosody-modules,mardraze/prosody-modules,NSAKEY/prosody-modules,vince06fr/prosody-modules,cryptotoad/prosody-modules,vince06fr/prosody-modules,Craige/prosody-modules,brahmi2/prosody-modules,mardraze/prosody-modules,NSAKEY/prosody-modules,crunchuser/prosody-modules,drdownload/prosody-modules,syntafin/prosody-modules,brahmi2/prosody-modules,asdofindia/prosody-modules,jkprg/prosody-modules,jkprg/prosody-modules,BurmistrovJ/prosody-modules,vince06fr/prosody-modules,guilhem/prosody-modules,dhotson/prosody-modules,apung/prosody-modules,NSAKEY/prosody-modules,NSAKEY/prosody-modules,stephen322/prosody-modules,softer/prosody-modules,mmusial/prosody-modules,LanceJenkinZA/prosody-modules,iamliqiang/prosody-modules,Craige/prosody-modules,drdownload/prosody-modules,syntafin/prosody-modules,obelisk21/prosody-modules,LanceJenkinZA/prosody-modules,jkprg/prosody-modules,1st8/prosody-modules,jkprg/prosody-modules,asdofindia/prosody-modules,apung/prosody-modules,heysion/prosody-modules,vfedoroff/prosody-modules,BurmistrovJ/prosody-modules,dhotson/prosody-modules,softer/prosody-modules,vfedoroff/prosody-modules,prosody-modules/import,joewalker/prosody-modules,olax/prosody-modules,crunchuser/prosody-modules,softer/prosody-modules,olax/prosody-modules,mardraze/prosody-modules,heysion/prosody-modules,obelisk21/prosody-modules,mardraze/prosody-modules,vfedoroff/prosody-modules,LanceJenkinZA/prosody-modules,Craige/prosody-modules,softer/prosody-modules,stephen322/prosody-modules,asdofindia/prosody-modules,joewalker/prosody-modules,olax/prosody-modules,either1/prosody-modules,crunchuser/prosody-modules,prosody-modules/import,drdownload/prosody-modules,mardraze/prosody-modules,syntafin/prosody-modules,NSAKEY/prosody-modules,Craige/prosody-modules,stephen322/prosody-modules,olax/prosody-modules,prosody-modules/import,BurmistrovJ/prosody-modules,apung/prosody-modules,joewalker/prosody-modules,brahmi2/prosody-modules,dhotson/prosody-modules
b30815639ede18a6c1992b7e0840c42b30adff5a
init.lua
init.lua
-- Theme if not CURSES then ui.set_theme('base16-solarized-dark', {font = 'Inconsolata', fontsize = 12}) end -- Snippets require("snippets/snippets") -- Elastic Tabstops require('elastic_tabstops').enable() -- Textadept's yaml module yaml = require "yaml" -- Or just the lyaml contained in there --lyaml = require "yaml.lyaml" -- Zettels local zettels = require('zettels') zettels.enable('/home/sthesing/Dokumente/Zettelkasten/', "/home/sthesing/.config/Zettels/index.yaml") -- Keyboard Chains keys['c2'] = { up = function() buffer.add_text("“") end, down = function() buffer.add_text("„") end }
-- Theme if not CURSES then ui.set_theme('base16-solarized-dark', {font = 'Inconsolata', fontsize = 12}) end -- Snippets require("snippets/snippets") -- Elastic Tabstops require('elastic_tabstops').enable() -- Textadept's yaml module yaml = require "yaml" -- Or just the lyaml contained in there --lyaml = require "yaml.lyaml" -- Zettels local zettels = require('zettels') zettels.enable(os.getenv("HOME") .. '/Dokumente/Zettelkasten/', os.getenv("HOME") .. "/.config/Zettels/index.yaml") -- Keyboard Chains keys['c2'] = { up = function() buffer.add_text("“") end, down = function() buffer.add_text("„") end }
Use env for path to userhome
Use env for path to userhome
Lua
mit
sthesing/.textadept,sthesing/.textadept,sthesing/.textadept
281ec9375928bd8c79208d08f3da530fbc85fc05
src/lgix-Gst-0_10.lua
src/lgix-Gst-0_10.lua
------------------------------------------------------------------------------ -- -- LGI Gst override module. -- -- Copyright (c) 2010 Pavel Holejsovsky -- Licensed under the MIT license: -- http://www.opensource.org/licenses/mit-license.php -- ------------------------------------------------------------------------------ local lgi = require 'lgi' local gi = require('lgi._core').gi local Gst = lgi.Gst -- GstObject has special ref_sink mechanism, make sure that lgi core -- is aware of it, otherwise refcounting is screwed. Gst.Object._sink = gi.Gst.Object.methods.ref_sink -- Load additional Gst modules. local GstInterfaces = lgi.GstInterfaces
------------------------------------------------------------------------------ -- -- LGI Gst override module. -- -- Copyright (c) 2010 Pavel Holejsovsky -- Licensed under the MIT license: -- http://www.opensource.org/licenses/mit-license.php -- ------------------------------------------------------------------------------ local lgi = require 'lgi' local gi = require('lgi._core').gi local GLib = lgi.GLib local Gst = lgi.Gst -- GstObject has special ref_sink mechanism, make sure that lgi core -- is aware of it, otherwise refcounting is screwed. Gst.Object._sink = gi.Gst.Object.methods.ref_sink function Gst.Bus:add_watch(callback) return self:add_watch_full(GLib.PRIORITY_DEFAULT, callback) end function Gst.Bin:add_many(...) local args = {...} for i = 1, #args do self:add(args[i]) end end -- Load additional Gst modules. local GstInterfaces = lgi.GstInterfaces -- Initialize gstreamer. Gst.init()
Add some Gst helper overrides.
Add some Gst helper overrides.
Lua
mit
psychon/lgi,zevv/lgi,pavouk/lgi
db47358fdcc6c566e5375b813c48f0ae2d1b3391
share/lua/playlist/koreus.lua
share/lua/playlist/koreus.lua
--[[ Copyright 2009 the VideoLAN team This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. 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 General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. --]] -- Probe function. function probe() if vlc.access ~= "http" then return false end koreus_site = string.match( vlc.path, "koreus" ) if not koreus_site then return false end return ( string.match( vlc.path, "video" ) ) -- http://www.koreus.com/video/pouet.html end -- Parse function. function parse() while true do line = vlc.readline() if not line then break end if string.match( line, "<meta name=\"title\"" ) then _,_,name = string.find( line, "content=\"(.-)\"" ) end if string.match( line, "<meta name=\"description\"" ) then _,_,description = string.find( line, "content=\"(.-)\"" ) end if string.match( line, "<meta name=\"author\"" ) then _,_,artist = string.find( line, "content=\"(.-)\"" ) end if string.match( line, "link rel=\"image_src\"" ) then _,_,arturl = string.find( line, "href=\"(.-)\"" ) end if string.match( line, "videoDiv\"%)%.innerHTML" ) then vid_url = string.match( line, '(http://media%d?%.koreus%.com/%d+/%d+/[%w-]*%.mp4)' ) if vid_url then return { { path = vid_url; name = name; description = description; artist = artist; arturl = arturl } } end end end end
Add Koreus Lua playlist file
Add Koreus Lua playlist file
Lua
lgpl-2.1
xkfz007/vlc,shyamalschandra/vlc,shyamalschandra/vlc,xkfz007/vlc,vlc-mirror/vlc,vlc-mirror/vlc-2.1,vlc-mirror/vlc,krichter722/vlc,jomanmuk/vlc-2.2,vlc-mirror/vlc,shyamalschandra/vlc,shyamalschandra/vlc,shyamalschandra/vlc,krichter722/vlc,xkfz007/vlc,jomanmuk/vlc-2.2,jomanmuk/vlc-2.1,jomanmuk/vlc-2.2,xkfz007/vlc,krichter722/vlc,vlc-mirror/vlc-2.1,xkfz007/vlc,vlc-mirror/vlc-2.1,vlc-mirror/vlc-2.1,jomanmuk/vlc-2.2,jomanmuk/vlc-2.1,vlc-mirror/vlc-2.1,shyamalschandra/vlc,xkfz007/vlc,xkfz007/vlc,vlc-mirror/vlc,vlc-mirror/vlc-2.1,vlc-mirror/vlc,jomanmuk/vlc-2.1,shyamalschandra/vlc,krichter722/vlc,jomanmuk/vlc-2.2,vlc-mirror/vlc,jomanmuk/vlc-2.1,jomanmuk/vlc-2.2,krichter722/vlc,vlc-mirror/vlc-2.1,jomanmuk/vlc-2.1,krichter722/vlc,jomanmuk/vlc-2.1,vlc-mirror/vlc,jomanmuk/vlc-2.1,jomanmuk/vlc-2.2,krichter722/vlc
7e58ad2800bae44b532853e2ac74aa75c03ae5ed
third_party/imgui.lua
third_party/imgui.lua
group("third_party") project("imgui") uuid("ed9271c4-b0a1-42ef-8403-067b11bf49d0") kind("StaticLib") language("C++") links({ }) defines({ "_LIB", }) includedirs({ "imgui", }) files({ "imgui/imconfig.h", "imgui/imgui.cpp", "imgui/imgui.h", "imgui/imgui_draw.cpp", "imgui/imgui_demo.cpp", "imgui/imgui_internal.h", "imgui/stb_rect_pack.h", "imgui/stb_textedit.h", "imgui/stb_truetype.h", }) buildoptions({ "/wd4312", -- Ugh. })
group("third_party") project("imgui") uuid("ed9271c4-b0a1-42ef-8403-067b11bf49d0") kind("StaticLib") language("C++") links({ }) defines({ "_LIB", }) includedirs({ "imgui", }) files({ "imgui/imconfig.h", "imgui/imgui.cpp", "imgui/imgui.h", "imgui/imgui_draw.cpp", "imgui/imgui_demo.cpp", "imgui/imgui_internal.h", "imgui/stb_rect_pack.h", "imgui/stb_textedit.h", "imgui/stb_truetype.h", }) filter("platforms:Windows") buildoptions({ "/wd4312", -- Ugh. })
Put MSVC buildoptions under Windows platform filter.
Put MSVC buildoptions under Windows platform filter.
Lua
bsd-3-clause
maxton/xenia,maxton/xenia,sephiroth99/xenia,galek/xenia,no1dead/xenia,ObsidianGuardian/xenia,sephiroth99/xenia,sabretooth/xenia,no1dead/xenia,maxton/xenia,ObsidianGuardian/xenia,sabretooth/xenia,TRex22/xenia,sephiroth99/xenia,galek/xenia,galek/xenia,KitoHo/xenia,KitoHo/xenia,galek/xenia,TRex22/xenia,KitoHo/xenia,KitoHo/xenia,TRex22/xenia,sabretooth/xenia,no1dead/xenia,no1dead/xenia,ObsidianGuardian/xenia
aacde712152b91f917ab0695954dc0860dc0c995
modulefiles/Core/gromacs/4.6.5.lua
modulefiles/Core/gromacs/4.6.5.lua
help( [[ This module loads a Gromacs 4.6.5 into the environment ]]) local version = "4.6.5" local base = "/cvmfs/oasis.opensciencegrid.org/osg/modules/gromacs/"..version prepend_path("PATH", pathJoin(base, "bin")) prepend_path("LD_LIBRARY_PATH", pathJoin(base, "lib")) family('gromacs') prereq('fftw/fftw-3.3.4-gromacs', 'atlas', 'lapack')
help( [[ This module loads a Gromacs 4.6.5 into the environment ]]) local version = "4.6.5" local base = "/cvmfs/oasis.opensciencegrid.org/osg/modules/gromacs/"..version prepend_path("PATH", pathJoin(base, "bin")) prepend_path("LD_LIBRARY_PATH", pathJoin(base, "lib")) family('gromacs') prereq('fftw/3.3.4-gromacs', 'atlas', 'lapack')
Fix reference to FFTW libraries
Fix reference to FFTW libraries
Lua
apache-2.0
OSGConnect/modulefiles,OSGConnect/modulefiles,OSGConnect/modulefiles
49f4ca3b2801771f34459076ec2e7dd89e2f6e4d
examples/custom-module/usage_limits_error.lua
examples/custom-module/usage_limits_error.lua
-- This module customizes the APIcast authorization logic, and returns a different response code -- and message if the authorization failed because the application reached its usage limits. -- In other cases the behavior is as in standard APIcast. -- The status code, error message and the content-type header can be configured -- in the 'usage_limits_error' object below: local usage_limits_error = { status = 429, content_type = 'text/plain; charset=us-ascii', message = 'Usage limits are exceeded' } -- The message that 3scale backend returns in the <reason> field on authorization failure local backend_reason = 'usage limits are exceeded' local apicast = require('apicast').new() local proxy = require 'proxy' local _M = { _VERSION = '3.0.0', _NAME = 'APIcast with usage limits error' } local mt = { __index = setmetatable(_M, { __index = apicast }) } function _M.new() return setmetatable({}, mt) end local utils = require 'threescale_utils' local function error_limits_exceeded(cached_key) ngx.log(ngx.INFO, 'usage limits exceeded for ', cached_key) ngx.var.cached_key = nil ngx.status = usage_limits_error.status ngx.header.content_type = usage_limits_error.content_type ngx.print(usage_limits_error.message) return ngx.exit(ngx.HTTP_OK) end proxy.handle_backend_response = function(self, cached_key, response, ttl) ngx.log(ngx.DEBUG, '[backend] response status: ', response.status, ' body: ', response.body) local authorized, reason = self.cache_handler(self.cache, cached_key, response, ttl) if not authorized then local usage_limits_exceeded = utils.match_xml_element(response.body, 'reason', backend_reason) if usage_limits_exceeded then error_limits_exceeded(cached_key) end end return authorized, reason end return _M
Add example for custom error for exceeded usage limits
[example] Add example for custom error for exceeded usage limits
Lua
mit
3scale/apicast,3scale/docker-gateway,3scale/apicast,3scale/apicast,3scale/docker-gateway,3scale/apicast
f30f25696ba5618522d34d782046da6c639151da
Tupfile.lua
Tupfile.lua
-- -- file: Tupfile.lua -- -- author: Copyright (C) 2014-2016 Kamil Szczygiel http://www.distortec.com http://www.freddiechopin.info -- -- This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not -- distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. -- local makeDistortosConfiguration_awk = DISTORTOS_TOP .. "scripts/makeDistortosConfiguration.awk" tup.rule(DISTORTOS_CONFIGURATION_MK, string.format('^ AWK %s^ %s "%%f" > "%%o"', makeDistortosConfiguration_awk, makeDistortosConfiguration_awk), {OUTPUT .. "include/distortos/distortosConfiguration.h", TOP .. "<headers>"})
-- -- file: Tupfile.lua -- -- author: Copyright (C) 2014-2016 Kamil Szczygiel http://www.distortec.com http://www.freddiechopin.info -- -- This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not -- distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. -- local makeDistortosConfigurationSh = DISTORTOS_TOP .. "scripts/makeDistortosConfiguration.sh" tup.rule(DISTORTOS_CONFIGURATION_MK, string.format('^ SH %s^ %s "%%f" > "%%o"', makeDistortosConfigurationSh, makeDistortosConfigurationSh), {OUTPUT .. "include/distortos/distortosConfiguration.h", TOP .. "<headers>"})
Use makeDistortosConfiguration.sh in tup build
Use makeDistortosConfiguration.sh in tup build
Lua
mpl-2.0
CezaryGapinski/distortos,CezaryGapinski/distortos,CezaryGapinski/distortos,jasmin-j/distortos,CezaryGapinski/distortos,DISTORTEC/distortos,jasmin-j/distortos,DISTORTEC/distortos,DISTORTEC/distortos,jasmin-j/distortos,CezaryGapinski/distortos,jasmin-j/distortos,DISTORTEC/distortos,jasmin-j/distortos
48291845974f99f53d090e3664eea8890481ae8e
lib/pkg/android-standalone-arm.lua
lib/pkg/android-standalone-arm.lua
return { build = { type = 'android-standalone-toolchain', toolchain = 'android-ndk-r16b', arch = 'arm', system = 'arm-linux-androideabi', cc = 'clang', cxx = 'clang++', }, export = { cmake_options = { '-DCMAKE_TOOLCHAIN_FILE=${toolchain_source_dir}/build/cmake/android.toolchain.cmake', '-DANDROID_ABI=armeabi-v7a', '-DANDROID_PLATFORM=android-23' } } }
return { build = { type = 'android-standalone-toolchain', toolchain = 'android-ndk', arch = 'arm', system = 'arm-linux-androideabi', cc = 'clang', cxx = 'clang++', }, export = { cmake_options = { '-DCMAKE_TOOLCHAIN_FILE=${toolchain_source_dir}/build/cmake/android.toolchain.cmake', '-DANDROID_ABI=armeabi-v7a', '-DANDROID_PLATFORM=android-23' } } }
Fix android standalone toolchain dependency
Fix android standalone toolchain dependency
Lua
mit
bazurbat/jagen
5c7b45283a7417ce98bcc52808fa0c92a97ac35e
src/web_utils/lp_ex.lua
src/web_utils/lp_ex.lua
local lp = require"src.web_utils.lp" local lat = require"src.lib.latclient" local M = { lat = lat } function M.translate (s) lat.js_url = "pub/latclient/js" lat.js_served = false s = lat.translate(s) return lp.translate(s) end function M.setoutfunc (f) lp.setoutfunc(f) end return M
local lp = require"src.web_utils.lp" local lat = require"src.lib.latclient" local M = { lat = lat } function M.translate (s) lat.js_url = "pub/latclient/js" s = lat.translate(s) return lp.translate(s) end function M.setoutfunc (f) lat.js_served = false lp.setoutfunc(f) end return M
Fix JS being served again if translate() is called multiple times
Fix JS being served again if translate() is called multiple times
Lua
mit
Etiene/sailor,felipedaragon/sailor,mpeterv/sailor,Etiene/sailor,noname007/sailor,hallison/sailor,mpeterv/sailor,Etiene/sailor_website,ignacio/sailor,ignacio/sailor,jeary/sailor,sailorproject/sailor,sailorproject/sailor_website,felipedaragon/sailor
ad7932bb0603f30c237923dc09bc9f448c4f6bda
src/conf.lua
src/conf.lua
function love.conf(t) t.title = "Journey to the Center of Hawkthorne v0.0.29" 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.30" 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.30
Bump release version to v0.0.30
Lua
mit
hawkthorne/hawkthorne-server-lua,hawkthorne/hawkthorne-client-lua,hawkthorne/hawkthorne-server-lua,hawkthorne/hawkthorne-client-lua
8561ccb6cb27520684dc190c4c1bf222c43f500c
premake5.lua
premake5.lua
include("build_tools") group("third_party") project("elemental-forms") uuid("04444ac4-de86-40bc-b6b3-c7684c50cfa9") kind("StaticLib") language("C++") links({}) defines({ }) includedirs({ ".", "src", }) recursive_platform_files("src/") include("testbed")
include("build_tools") group("third_party") project("elemental-forms") uuid("04444ac4-de86-40bc-b6b3-c7684c50cfa9") kind("StaticLib") language("C++") links({}) defines({ }) includedirs({ ".", "src", }) recursive_platform_files("src/") if os.is("windows") then include("testbed") end
Build testbed only on Windows.
Build testbed only on Windows. Do not build testbed under any other OS than Windows. Also the testbed project has mixed C++ and C files, which does not build under the current Linux build framework (premake and clang).
Lua
bsd-3-clause
xenia-project/elemental-forms,xenia-project/elemental-forms
c9169dc990d71bfe816cd28c7563a327a5de4b8b
layout-halfletter.lua
layout-halfletter.lua
local book = SILE.require("classes/book"); book:loadPackage("masters") book:defineMaster({ id = "right", firstContentFrame = "content", frames = { content = { left = "22.5mm", right = "100%pw-15mm", top = "20mm", bottom = "top(footnotes)" }, runningHead = { left = "left(content)", right = "right(content)", top = "top(content)-8mm", bottom = "top(content)" }, footnotes = { left = "left(content)", right = "right(content)", height = "0", bottom = "100%ph-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" }) SILE.require("crop")
local class = SILE.documentState.documentClass SILE.documentState.paperSize = SILE.paperSizeParser("halfletter") SILE.documentState.orgPaperSize = SILE.documentState.paperSize class:defineMaster({ id = "right", firstContentFrame = "content", frames = { content = { left = "22.5mm", right = "100%pw-15mm", top = "20mm", bottom = "top(footnotes)" }, runningHead = { left = "left(content)", right = "right(content)", top = "top(content)-8mm", bottom = "top(content)" }, footnotes = { left = "left(content)", right = "right(content)", height = "0", bottom = "100%ph-15mm" } } }) class:mirrorMaster("right", "left") SILE.call("switch-master-one-page", { id = "right" }) if SILE.documentState.documentClass.options.crop() == "true" then SILE.require("crop") end SILE.registerCommand("href", function (options, content) SILE.process(content) end)
Bring Halfletter layout into line with class methods
Bring Halfletter layout into line with class methods
Lua
agpl-3.0
alerque/casile,alerque/casile,alerque/casile,alerque/casile,alerque/casile
1aa1997e387bcb496f874c6d06daabf22a9022f3
packages/footnotes.lua
packages/footnotes.lua
-- Footnotes class SILE.require("packages/counters") SILE.require("packages/raiselower") local insertions = SILE.require("packages/insertions") SILE.scratch.counters.footnote = { value= 1, display= "arabic" }; SILE.registerCommand("footnote", function(options, content) SILE.Commands["raise"]({height = "1ex"}, function() SILE.Commands["font"]({ size = "2ex" }, function() SILE.typesetter:typeset(SILE.scratch.counters.footnote.value) end) end) insertions.exports:insert("footnote", SILE.Commands["vbox"]({}, function() SILE.Commands["font"]({size = "9pt"}, function() SILE.typesetter:typeset(SILE.scratch.counters.footnote.value..". ") SILE.process(content) end) end )) SILE.scratch.counters.footnote.value = SILE.scratch.counters.footnote.value + 1 end) return { init = function (class, args) insertions.exports:initInsertionClass("footnote", { insertInto = args.insertInto, stealFrom = args.stealFrom, maxHeight = SILE.length.new({length = SILE.toPoints("25", "%","h") }), topSkip = SILE.length.parse("12pt") }) end, exports = { outputInsertions = insertions.exports.outputInsertions } }
-- Footnotes class SILE.require("packages/counters") SILE.require("packages/raiselower") local insertions = SILE.require("packages/insertions") SILE.scratch.counters.footnote = { value= 1, display= "arabic" }; SILE.registerCommand("footnote", function(options, content) SILE.Commands["raise"]({height = "1ex"}, function() SILE.Commands["font"]({ size = "2ex" }, function() SILE.typesetter:typeset(SILE.scratch.counters.footnote.value) end) end) insertions.exports:insert("footnote", SILE.Commands["vbox"]({}, function() SILE.Commands["font"]({size = "9pt"}, function() SILE.typesetter:typeset(SILE.scratch.counters.footnote.value..". ") SILE.process(content) end) end )) SILE.scratch.counters.footnote.value = SILE.scratch.counters.footnote.value + 1 end) return { init = function (class, args) insertions.exports:initInsertionClass("footnote", { insertInto = args.insertInto, stealFrom = args.stealFrom, maxHeight = SILE.length.new({length = SILE.toPoints("25", "%","h") }), topSkip = SILE.length.parse("4ex") }) end, exports = { outputInsertions = insertions.exports.outputInsertions } }
Make default footnote topskip relative to font size.
Make default footnote topskip relative to font size.
Lua
mit
anthrotype/sile,alerque/sile,WAKAMAZU/sile_fe,alerque/sile,simoncozens/sile,anthrotype/sile,shirat74/sile,shirat74/sile,shirat74/sile,WAKAMAZU/sile_fe,Nathan22Miles/sile,alerque/sile,Nathan22Miles/sile,neofob/sile,neofob/sile,WAKAMAZU/sile_fe,neofob/sile,Nathan22Miles/sile,anthrotype/sile,anthrotype/sile,simoncozens/sile,simoncozens/sile,alerque/sile,shirat74/sile,WAKAMAZU/sile_fe,neofob/sile,Nathan22Miles/sile,simoncozens/sile,Nathan22Miles/sile
87ffdadb24d509e17f0f7230557b9887531fa189
tests/test_sockaddr_lookup_full.lua
tests/test_sockaddr_lookup_full.lua
local llnet = require"llnet" local P = llnet.Protocols local host, port, family, socktype, protocol = arg[1], arg[2], arg[3], arg[4], arg[5] if #arg < 1 then print(arg[0], ": <host> [<port> [<family> [<socktype> [<protocol>]]]]") return end if family then family = family:upper() family = llnet[family] or llnet['AF_' .. family] or 0 end if socktype then socktype = socktype:upper() socktype = llnet[socktype] or llnet['SOCK_' .. socktype] or 0 end if protocol then protocol = P[protocol] end local addr = llnet.LSockAddr() local stat, err = addr:lookup_full(host, port, family, socktype, protocol) if stat then print("addr:", addr) else print("getaddrinfo returned an error:", err, llnet.EAI_Errors:description(err)) end
Add test script for LSockAddr lookup_full method.
Add test script for LSockAddr lookup_full method.
Lua
mit
Neopallium/lua-llnet
754fe22b18b74baa6b9fa1537f3b1069b2fda8e9
src/test/res/test7.lua
src/test/res/test7.lua
local function fixhash(msg) return string.gsub(msg, "@(%x+)", function(s) return "@"..(string.rep("x", 6)) end) end obj = luajava.newInstance("java.lang.Object") print( fixhash( tostring(obj) ) ) sample = luajava.newInstance("org.luaj.sample.SampleClass") print( fixhash( tostring(sample) ) ) sample.s = "Hello" print( sample.s ) print( sample:getS() ) sample:setObj(obj) print( obj == sample:getObj() ) sample:setS( "World" ) print( sample.s ) math = luajava.bindClass("java.lang.Math") print("Square root of 9 is", math:sqrt(9.0))
local function fixhash(msg) return (string.gsub(msg, "@(%x+)", function(s) return "@"..(string.rep("x", 6)) end)) end obj = luajava.newInstance("java.lang.Object") print( fixhash( tostring(obj) ) ) sample = luajava.newInstance("org.luaj.sample.SampleClass") print( fixhash( tostring(sample) ) ) sample.s = "Hello" print( sample.s ) print( sample:getS() ) sample:setObj(obj) print( obj == sample:getObj() ) sample:setS( "World" ) print( sample.s ) math = luajava.bindClass("java.lang.Math") print("Square root of 9 is", math:sqrt(9.0))
Update test to work with fixed gsub behavior
Update test to work with fixed gsub behavior
Lua
mit
MightyPirates/OC-LuaJ,MightyPirates/OC-LuaJ
d72ac96ba959953e6725a7bf46755ef5351150a5
lua/samples-tex-slow.lua
lua/samples-tex-slow.lua
-- Visualize IQ data as a texture from the HackRF -- You want seizures? 'Cause this is how you get seizures. VERTEX_SHADER = [[ #version 400 layout (location = 0) in vec3 vp; layout (location = 1) in vec3 vn; layout (location = 2) in vec2 vt; out vec3 color; out vec2 texCoord; uniform mat4 uViewMatrix, uProjectionMatrix; uniform float uTime; void main() { color = vec3(1.0, 1.0, 1.0); texCoord = vt; // vec2(vp.x + 0.5, vp.z + 0.5); gl_Position = vec4(vp.x*2, vp.z*2, 0, 1.0); } ]] FRAGMENT_SHADER = [[ #version 400 in vec3 color; in vec2 texCoord; uniform sampler2D uTexture; layout (location = 0) out vec4 fragColor; void main() { float r = texture(uTexture, texCoord).r * 1; fragColor = vec4(r, r, r, 0.95); } ]] function setup() freq = 200.5 device = nrf_device_new(freq, "../rfdata/rf-200.500-big.raw", 0.01) camera = ngl_camera_new_look_at(0, 0, 0) -- Camera is unnecessary but ngl_draw_model requires it shader = ngl_shader_new(GL_TRIANGLES, VERTEX_SHADER, FRAGMENT_SHADER) texture = ngl_texture_new(shader, "uTexture") model = ngl_model_new_grid_triangles(2, 2, 1, 1) end function draw() ngl_clear(0.2, 0.2, 0.2, 1.0) ngl_texture_update(texture, GL_RED, 512, 512, device.samples) ngl_draw_model(camera, model, shader) end function on_key(key, mods) keys_frequency_handler(key, mods) end
Add an example of slow interpolation.
Add an example of slow interpolation.
Lua
mit
silky/frequensea,fdb/frequensea,silky/frequensea,fdb/frequensea,fdb/frequensea,fdb/frequensea,silky/frequensea,silky/frequensea,fdb/frequensea,silky/frequensea
1c37d60c0e1034a73c6183a63e8047b69f03a6e9
src/cosy/webclient/headbar/init.lua
src/cosy/webclient/headbar/init.lua
return function (loader) local Webclient = loader.load "cosy.webclient" local I18n = loader.load "cosy.i18n" local i18n = I18n.load { "cosy.webclient.headbar", } local HeadBar = {} HeadBar.template = Webclient.template "cosy.webclient.headbar" return function (options) Webclient.run (function () Webclient.show { where = options.where, template = HeadBar.template, data = { title = loader.client.server.information {}.name, }, i18n = i18n, } loader.window:eval [[ $(".main-content").css({"margin-top": (($(".navbar-fixed-top").height()) + 1 )+"px"}); ]] loader.load "cosy.webclient.authentication" { where = "headbar:user", } end) end end
return function (loader) local Webclient = loader.load "cosy.webclient" local I18n = loader.load "cosy.i18n" local i18n = I18n.load { "cosy.webclient.headbar", } local HeadBar = {} HeadBar.template = Webclient.template "cosy.webclient.headbar" return function (options) Webclient.run (function () Webclient.show { where = options.where, template = HeadBar.template, data = { title = Webclient.client.server.information {}.name, }, i18n = i18n, } Webclient.window:eval [[ var height = $(".navbar-fixed-top").height (); $(".main-content").css ({ "margin-top": (height + 1 ) + "px" }); ]] loader.load "cosy.webclient.authentication" { where = "headbar:user", } end) end end
Use Webclient js.* in headbar.
Use Webclient js.* in headbar.
Lua
mit
CosyVerif/library,CosyVerif/library,CosyVerif/library
4aab049b42a16e3bacd8b2680374ed530f536d47
modules/title/sites/githubgist.lua
modules/title/sites/githubgist.lua
local simplehttp = require'simplehttp' local json = require'json' customHosts['gist%.github%.com'] = function(queue, info) local query = info.query local path = info.path local fragment = info.fragment local gid local pattern = '/%a+/(%w+)' if(path and path:match(pattern)) then gid = path:match(pattern) end if(gid) then simplehttp( ('https://api.github.com/gists/%s'):format(gid), function(data) local info = json.decode(data) local name = info.user if name == json.util.null then name = 'Anonymous' else name = info.user.login end local files = '' for file,_ in pairs(info.files) do files = files..file..' ' end local time = info.updated_at local out = {} table.insert(out, string.format('\002@%s\002 %s %s', name, time, files)) queue:done(table.concat(out, ' ')) end ) return true end end
local simplehttp = require'simplehttp' local json = require'json' customHosts['gist%.github%.com'] = function(queue, info) local query = info.query local path = info.path local fragment = info.fragment local gid local pattern = '/%a+/(%w+)' if(path and path:match(pattern)) then gid = path:match(pattern) end if(gid) then simplehttp( ('https://api.github.com/gists/%s'):format(gid), function(data) local info = json.decode(data) local name = info.user if name == json.util.null then name = 'Anonymous' else name = info.user.login end local files = '' for file,_ in pairs(info.files) do files = files..file..' ' end local time = info.updated_at queue:done(table.concat(string.format('\002@%s\002 %s %s', name, time, files)) end ) return true end end
Remove unnecessary table -> string in gist.
title: Remove unnecessary table -> string in gist.
Lua
mit
torhve/ivar2,torhve/ivar2,haste/ivar2,torhve/ivar2
6018fc597498d03af1dc239eac6f5c3a744b490d
kong/plugins/log_serializers/basic.lua
kong/plugins/log_serializers/basic.lua
local _M = {} function _M.serialize(ngx) return { request = { uri = ngx.var.request_uri, request_uri = ngx.var.scheme.."://"..ngx.var.host..":"..ngx.var.server_port..ngx.var.request_uri, querystring = ngx.req.get_uri_args(), -- parameters, as a table method = ngx.req.get_method(), -- http method headers = ngx.req.get_headers(), size = ngx.var.request_length }, response = { status = ngx.status, headers = ngx.resp.get_headers(), size = ngx.var.bytes_sent }, latencies = { kong = (ngx.ctx.kong_processing_access or 0) + (ngx.ctx.kong_processing_header_filter or 0) + (ngx.ctx.kong_processing_body_filter or 0), proxy = ngx.var.upstream_response_time * 1000, request = ngx.var.request_time * 1000 }, authenticated_entity = ngx.ctx.authenticated_entity, api = ngx.ctx.api, client_ip = ngx.var.remote_addr, started_at = ngx.req.start_time() * 1000 } end return _M
local _M = {} function _M.serialize(ngx) return { request = { uri = ngx.var.request_uri, request_uri = ngx.var.scheme.."://"..ngx.var.host..":"..ngx.var.server_port..ngx.var.request_uri, querystring = ngx.req.get_uri_args(), -- parameters, as a table method = ngx.req.get_method(), -- http method headers = ngx.req.get_headers(), body_data = ngx.req.get_body_data(), size = ngx.var.request_length }, response = { status = ngx.status, headers = ngx.resp.get_headers(), size = ngx.var.bytes_sent }, latencies = { kong = (ngx.ctx.kong_processing_access or 0) + (ngx.ctx.kong_processing_header_filter or 0) + (ngx.ctx.kong_processing_body_filter or 0), proxy = ngx.var.upstream_response_time * 1000, request = ngx.var.request_time * 1000 }, authenticated_entity = ngx.ctx.authenticated_entity, api = ngx.ctx.api, client_ip = ngx.var.remote_addr, started_at = ngx.req.start_time() * 1000 } end return _M
Add body data in logging
Add body data in logging
Lua
mit
vmercierfr/kong
07ef62b04bfffceea38504eea1823676ef85147c
stowed/.config/nvim/init.lua
stowed/.config/nvim/init.lua
-- Entrypoint for my Neovim configuration! -- We simply bootstrap packer and Aniseed here. -- It's then up to Aniseed to compile and load fnl/init.fnl local execute = vim.api.nvim_command local fn = vim.fn local pack_path = fn.stdpath("data") .. "/site/pack" local fmt = string.format function ensure (user, repo) -- Ensures a given github.com/USER/REPO is cloned in the pack/packer/start directory. local install_path = fmt("%s/packer/start/%s", pack_path, repo, repo) if fn.empty(fn.glob(install_path)) > 0 then execute(fmt("!git clone https://github.com/%s/%s %s", user, repo, install_path)) execute(fmt("packadd %s", repo)) end end -- Bootstrap essential plugins required for installing and loading the rest. ensure("wbthomason", "packer.nvim") ensure("Olical", "aniseed") -- Enable Aniseed's automatic compilation and loading of Fennel source code. vim.g["aniseed#env"] = {module = "dotfiles.init"}
-- Entrypoint for my Neovim configuration! -- We simply bootstrap packer and Aniseed here. -- It's then up to Aniseed to compile and load fnl/init.fnl local execute = vim.api.nvim_command local fn = vim.fn local pack_path = fn.stdpath("data") .. "/site/pack" local fmt = string.format function ensure (user, repo) -- Ensures a given github.com/USER/REPO is cloned in the pack/packer/start directory. local install_path = fmt("%s/packer/start/%s", pack_path, repo, repo) if fn.empty(fn.glob(install_path)) > 0 then execute(fmt("!git clone https://github.com/%s/%s %s", user, repo, install_path)) execute(fmt("packadd %s", repo)) end end -- Bootstrap essential plugins required for installing and loading the rest. ensure("wbthomason", "packer.nvim") ensure("Olical", "aniseed") -- Enable Aniseed's automatic compilation and loading of Fennel source code. vim.g["aniseed#env"] = { module = "dotfiles.init", compile = true }
Add a place to switch off compiling
Add a place to switch off compiling
Lua
unlicense
Olical/dotfiles
2171870c287c949f6430396b682083b04959bbef
Modules/Shared/ClassMixin/IsAMixin.lua
Modules/Shared/ClassMixin/IsAMixin.lua
--- Generic IsA interface for Lua classes. -- @module IsAMixin local IsAMixin = {} --- Adds the IsA function to a class and all descendants function IsAMixin:Add(class) assert(not class.IsA, "class already has an IsA method") assert(not class.CustomIsA, "class already has an CustomIsA method") assert(class.ClassName, "class needs a ClassName") class.IsA = self.IsA class.CustomIsA = self.IsA end --- Using the .ClassName property, returns whether or not a component is -- a class function IsAMixin:IsA(className) assert(type(className) == "string", "className must be a string") local CurrentMetatable = getmetatable(self) while CurrentMetatable do if CurrentMetatable.ClassName == className then return true end CurrentMetatable = getmetatable(CurrentMetatable) end return false end return IsAMixin
--- Generic IsA interface for Lua classes. -- @module IsAMixin local IsAMixin = {} --- Adds the IsA function to a class and all descendants function IsAMixin:Add(class) assert(not class.IsA, "class already has an IsA method") assert(not class.CustomIsA, "class already has an CustomIsA method") assert(class.ClassName, "class needs a ClassName") class.IsA = self.IsA class.CustomIsA = self.IsA end --- Using the .ClassName property, returns whether or not a component is -- a class function IsAMixin:IsA(className) assert(type(className) == "string", "className must be a string") local currentMetatable = getmetatable(self) while currentMetatable do if currentMetatable.ClassName == className then return true end currentMetatable = getmetatable(currentMetatable) end return false end return IsAMixin
Update syntax to new standard
Update syntax to new standard
Lua
mit
Quenty/NevermoreEngine,Quenty/NevermoreEngine,Quenty/NevermoreEngine
dbec797cbd0d9c2728e9f214bdc9f33ec825c0c7
vrp/cfg/audio.lua
vrp/cfg/audio.lua
local cfg = {} -- VoIP -- VoIP websocket server cfg.voip_server = "ws://localhost:40120" -- VoIP Opus params cfg.voip_bitrate = 24000 -- bits/s -- frame_size (ms) -- 20,40,60; higher frame_size can result in lower quality, but less WebRTC overhead (~125 bytes per packet) -- 20: best quality, ~6ko/s overhead -- 40: ~3ko/s overhead -- 60: ~2ko/s overhead cfg.voip_frame_size = 60 -- set to true to disable the default voice chat and use vRP voip instead (world channel) cfg.vrp_voip = false -- radius to establish VoIP connections cfg.voip_proximity = 100 -- connect/disconnect interval in milliseconds cfg.voip_interval = 5000 -- world voice config (see Audio:registerVoiceChannel) cfg.world_voice = { effects = { spatialization = { max_dist = cfg.voip_proximity } } } return cfg
local cfg = {} -- VoIP -- VoIP websocket server cfg.voip_server = "ws://localhost:40120" -- VoIP Opus params cfg.voip_bitrate = 24000 -- bits/s -- frame_size (ms) -- 20,40,60; higher frame_size can result in lower quality, but less WebRTC overhead (~125 bytes per packet) -- 20: best quality, ~6ko/s overhead -- 40: ~3ko/s overhead -- 60: ~2ko/s overhead cfg.voip_frame_size = 60 -- set to true to disable the default voice chat and use vRP voip instead (world channel) cfg.vrp_voip = true -- radius to establish VoIP connections cfg.voip_proximity = 100 -- connect/disconnect interval in milliseconds cfg.voip_interval = 5000 -- world voice config (see Audio:registerVoiceChannel) cfg.world_voice = { effects = { spatialization = { max_dist = cfg.voip_proximity } } } return cfg
Enable vRP world VoIP by default.
Enable vRP world VoIP by default.
Lua
mit
ImagicTheCat/vRP,ImagicTheCat/vRP
28e48c8c4b761fd641da8448d64a8680bd3bfd7c
examples/http-upload.lua
examples/http-upload.lua
local HTTP = require("http") local Utils = require("utils") local Table = require("table") HTTP.create_server("0.0.0.0", 8080, function (req, res) p("on_request", req) local chunks = {} local length = 0 req:on('data', function (chunk, len) p("on_data", {chunk=chunk, len=len}) length = length + 1 chunks[length] = chunk end) req:on('end', function () local body = Table.concat(chunks, "") p("on_end", {body=body}) res:write_head(200, { ["Content-Type"] = "text/plain", ["Content-Length"] = #body }) res:write(body) res:close() end) end) print("Server listening at http://localhost:8080/")
local HTTP = require("http") local Utils = require("utils") local Table = require("table") HTTP.create_server("0.0.0.0", 8080, function (req, res) p("on_request", req) local chunks = {} local length = 0 req:on('data', function (chunk, len) p("on_data", {len=len}) length = length + 1 chunks[length] = chunk end) req:on('end', function () local body = Table.concat(chunks, "") p("on_end", {total_len=#body}) body = "length = " .. tostring(#body) .. "\n" res:write_head(200, { ["Content-Type"] = "text/plain", ["Content-Length"] = #body }) res:write(body) res:close() end) end) print("Server listening at http://localhost:8080/")
Fix upload example to not dump the actual data
Fix upload example to not dump the actual data Change-Id: Icd849536e31061772e7fef953ddcea1a2f5c8a6d
Lua
apache-2.0
bsn069/luvit,rjeli/luvit,boundary/luvit,GabrielNicolasAvellaneda/luvit-upstream,luvit/luvit,bsn069/luvit,AndrewTsao/luvit,rjeli/luvit,sousoux/luvit,boundary/luvit,AndrewTsao/luvit,AndrewTsao/luvit,zhaozg/luvit,connectFree/lev,sousoux/luvit,luvit/luvit,kaustavha/luvit,rjeli/luvit,GabrielNicolasAvellaneda/luvit-upstream,GabrielNicolasAvellaneda/luvit-upstream,boundary/luvit,connectFree/lev,bsn069/luvit,boundary/luvit,DBarney/luvit,boundary/luvit,boundary/luvit,sousoux/luvit,kaustavha/luvit,GabrielNicolasAvellaneda/luvit-upstream,kaustavha/luvit,sousoux/luvit,zhaozg/luvit,DBarney/luvit,sousoux/luvit,rjeli/luvit,DBarney/luvit,DBarney/luvit,sousoux/luvit,brimworks/luvit
05520716112f8345c352230a268c2a095c993eb4
romdom.lua
romdom.lua
prev = ""; msg = ""; function write_file (filename, text) output = io.open(filename, "w"); io.output(output); io.write(text); io.close(output); end; function read_file (filename) input = io.open(filename, "r"); io.input(input); input_content = io.read(); io.close(input); return input_content; end; function handle_input () local address = tonumber(read_file("address.txt"), 16); local value = tonumber(read_file("value.txt"), 16); local speed = read_file("speed.txt"); if(address ~= "null" and address ~= nil and value ~= nil) then memory.writebyte(address, value); end; if(speed ~= "null") then emu.speedmode(speed); end; end; while (true) do handle_input() emu.frameadvance(); end;
prev = ""; msg = ""; function write_file (filename, text) output = io.open(filename, "w"); io.output(output); io.write(text); io.close(output); end; function read_file (filename) input = io.open(filename, "r"); io.input(input); input_content = io.read(); io.close(input); return input_content; end; function write_ram_byte (address, value) if(address ~= nil and value ~= nil) then memory.writebyte(address, value); end; end; function read_ram_byte (address, value) if(address ~= nil) then local value = memory.readByte(address); write_file("value.txt", value); end; end; function handle_input () local action = read_file("action.txt"); local address = tonumber(read_file("address.txt"), 16); local value = tonumber(read_file("value.txt"), 16); if action == "writeRamByte" then write_ram_byte(address, value); elseif action == "readRamByte" then read_ram_byte(address); end; write_file("action.txt", "null"); end; while (true) do handle_input() emu.frameadvance(); end;
Implement writing to RAM in emulator interface
Implement writing to RAM in emulator interface
Lua
mit
faiq/ROMDOM,sagnew/ROMDOM
0db921e78a1cd574a14578c8d2f8e43bc9157250
monster/race_115_fairy/id_1152_blood_fairy.lua
monster/race_115_fairy/id_1152_blood_fairy.lua
--[[ 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/>. ]] --ID 1152, Blood fairy, Level: 1 local base = require("monster.base.base") local fairies = require("monster.race_115_fairy.base") local M = fairies.generateCallbacks() local orgOnSpawn = M.onSpawn function M.onSpawn(monster) if orgOnSpawn ~= nil then orgOnSpawn(monster) end base.setColor{monster = monster, target = base.SKIN_COLOR, red = 139, green = 26, blue = 26} 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/>. ]] --ID 1152, Blood fairy, Level: 1 local base = require("monster.base.base") local fairies = require("monster.race_115_fairy.base") local M = fairies.generateCallbacks() local orgOnSpawn = M.onSpawn function M.onSpawn(monster) if orgOnSpawn ~= nil then orgOnSpawn(monster) end base.setColor{monster = monster, target = base.SKIN_COLOR, red = 139, green = 26, blue = 26} end return M
Add missing part of license header
Add missing part of license header
Lua
agpl-3.0
KayMD/Illarion-Content,vilarion/Illarion-Content,Baylamon/Illarion-Content,Illarion-eV/Illarion-Content,LaFamiglia/Illarion-Content
d0f3940890697a0ee29f39f9558f279060edb2fb
package.lua
package.lua
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.2", -- 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@3.2.1", -- Core plugin for proper http headers "creationix/weblit-auto-headers@2.1.0", -- Serve static files from disk "creationix/weblit-static@2.2.2", -- Basic logger to stdout "creationix/weblit-logger@2.0.0", } }
Update weblit to fix crashing bug
Update weblit to fix crashing bug
Lua
apache-2.0
luvit/luvit.io,luvit/luvit.io,luvit/luvit.io
c8275a3e5589188e1545dd491ec3078bfd193876
src/sounds/src/Shared/SoundUtils.lua
src/sounds/src/Shared/SoundUtils.lua
--- Helps play sounds on the client -- @module SoundUtils -- @author Quenty local SoundService = game:GetService("SoundService") local SoundUtils = {} function SoundUtils.playTemplate(templates, templateName) assert(type(templates) == "table", "Bad templates") assert(type(templateName) == "string", "Bad templateName") local sound = templates:Clone(templateName) sound.Archivable = false SoundService:PlayLocalSound(sound) delay(sound.TimeLength + 0.05, function() sound:Destroy() end) return sound end return SoundUtils
--- Helps play sounds on the client -- @module SoundUtils -- @author Quenty local SoundService = game:GetService("SoundService") local SoundUtils = {} function SoundUtils.playTemplate(templates, templateName) assert(type(templates) == "table", "Bad templates") assert(type(templateName) == "string", "Bad templateName") local sound = templates:Clone(templateName) sound.Archivable = false SoundService:PlayLocalSound(sound) delay(sound.TimeLength + 0.05, function() sound:Destroy() end) return sound end function SoundUtils.playTemplateInParent(templates, templateName, parent) local sound = templates:Clone(templateName) sound.Archivable = false sound.Parent = parent sound:Play() delay(sound.TimeLength + 0.05, function() sound:Destroy() end) return sound end return SoundUtils
Add ability to play sounds in parent
feat: Add ability to play sounds in parent
Lua
mit
Quenty/NevermoreEngine,Quenty/NevermoreEngine,Quenty/NevermoreEngine
6bf05d6e63ea6aa9f519b5feba6624d9c53bf94a
third_party/vulkan/loader/premake5.lua
third_party/vulkan/loader/premake5.lua
group("third_party") project("vulkan-loader") uuid("07d77359-1618-43e6-8a4a-0ee9ddc5fa6a") kind("StaticLib") language("C") defines({ "_LIB", "API_NAME=\"vulkan\"", }) removedefines({ "_UNICODE", "UNICODE", }) includedirs({ ".", }) recursive_platform_files() -- Included elsewhere removefiles("vk_loader_extensions.c") filter("platforms:Windows") warnings("Off") -- Too many warnings. characterset("MBCS") defines({ "VK_USE_PLATFORM_WIN32_KHR", }) filter("platforms:not Windows") removefiles("dirent_on_windows.c") filter("platforms:Linux") defines({ [[SYSCONFDIR="\"/etc\""]], [[FALLBACK_CONFIG_DIRS="\"/etc/xdg\""]], [[DATADIR="\"/usr/share\""]], [[FALLBACK_DATA_DIRS="\"/usr/share:/usr/local/share\""]], })
group("third_party") project("vulkan-loader") uuid("07d77359-1618-43e6-8a4a-0ee9ddc5fa6a") kind("StaticLib") language("C") defines({ "_LIB", "API_NAME=\"vulkan\"", }) removedefines({ "_UNICODE", "UNICODE", }) includedirs({ ".", }) recursive_platform_files() -- Included elsewhere removefiles("vk_loader_extensions.c") filter("platforms:Windows") warnings("Off") -- Too many warnings. characterset("MBCS") defines({ "VK_USE_PLATFORM_WIN32_KHR", }) filter("platforms:not Windows") removefiles("dirent_on_windows.c") filter("platforms:Linux") defines({ "VK_USE_PLATFORM_XCB_KHR", [[SYSCONFDIR="\"/etc\""]], [[FALLBACK_CONFIG_DIRS="\"/etc/xdg\""]], [[DATADIR="\"/usr/share\""]], [[FALLBACK_DATA_DIRS="\"/usr/share:/usr/local/share\""]], })
Enable XCB in Vulkan loader on Linux
Enable XCB in Vulkan loader on Linux
Lua
bsd-3-clause
sephiroth99/xenia,sephiroth99/xenia,sephiroth99/xenia
92a4d1be83e9f7c4785c8d276a7018fa2a0e2d9f
vi_util.lua
vi_util.lua
-- Lua utility functions local M = {} -- Pretty-print Lua values. function M.tostring(a) if type(a) == "string" then return '"' .. a .. '"' elseif type(a) ~= 'table' then return tostring(a) end local maxn = 0 local sbits = {'{'} for i,v in ipairs(a) do table.insert(sbits, M.tostring(v) .. ", ") maxn = i end for k,v in pairs(a) do -- Do the non-contiguous-integer keys if type(k) == 'number' and k == math.ceil(k) and k <= maxn and k >= 1 then -- Ignore an integer key we've already seen else table.insert(sbits, '['..M.tostring(k)..'] = '..M.tostring(v)..', ') end end table.insert(sbits, '}') return table.concat(sbits) end return M
Add pretty print (from test.lua) to somewhere more useful.
Add pretty print (from test.lua) to somewhere more useful.
Lua
mit
jugglerchris/textadept-vi,erig0/textadept-vi,jugglerchris/textadept-vi
d2a492e606e8fb2dfca54bf6509e611fbd337c07
nginx-jwt.lua
nginx-jwt.lua
local auth_header = ngx.var.http_Authorization if auth_header == nil then ngx.log(ngx.STDERR, "No Authorization header") ngx.exit(ngx.HTTP_UNAUTHORIZED) else ngx.log(ngx.STDERR, "Authorization: " .. auth_header) local _, _, token = string.find(auth_header, "Bearer%s+(.+)") if token == nil then ngx.log(ngx.STDERR, "Missing token") ngx.exit(ngx.HTTP_UNAUTHORIZED) else ngx.log(ngx.STDERR, "Token: " .. token) return end end
local auth_header = ngx.var.http_Authorization if auth_header == nil then ngx.log(ngx.WARN, "No Authorization header") ngx.exit(ngx.HTTP_UNAUTHORIZED) else ngx.log(ngx.INFO, "Authorization: " .. auth_header) local _, _, token = string.find(auth_header, "Bearer%s+(.+)") if token == nil then ngx.log(ngx.WARN, "Missing token") ngx.exit(ngx.HTTP_UNAUTHORIZED) else ngx.log(ngx.INFO, "Token: " .. token) return end end
Use proper log level constants with ngx.log()
Use proper log level constants with ngx.log()
Lua
mit
rubyboy/nginx-jwt,njcaruso/nginx-jwt,ChrisWhiten/nginx-jwt,rubyboy/nginx-jwt,ChrisWhiten/nginx-jwt,auth0/nginx-jwt,bobrik/nginx-jwt,njcaruso/nginx-jwt,unibet/nginx-jwt,auth0/nginx-jwt,unibet/nginx-jwt,bobrik/nginx-jwt
392916b6cf3d9cf8bf21b49848266fc397ea995d
Modules/ClassMixin/GenerateWithMixin.lua
Modules/ClassMixin/GenerateWithMixin.lua
--- Simple mixin to generate code for a class -- @module GenerateWithMixin local module = {} --- Adds the GenerateWith API to the class -- @tparam table class -- @tparam[opt] table staticResources If provided, these resources are added to the class automatically function module:Add(class, staticResources) assert(class) assert(not class.GenerateWith) class.GenerateWith = self.GenerateWith if staticResources then class:GenerateWith(staticResources) end end --- Generates resources -- @tparam table resources Resources to add function module:GenerateWith(resources) assert(type(resources) == "table") for _, resourceName in ipairs(resources) do local storeName = ("_%s"):format(resourceName:sub(1, 1):lower() .. resourceName:sub(2, #resourceName)) self[("With%s"):format(resourceName)] = function(self, resource) self[storeName] = resource or error(("Failed to set '%s', %s"):format(resourceName, tostring(resource))) self[resourceName] = resource -- inject publically too, for now return self end self[("Get%s"):format(resourceName)] = function(self) return self[storeName] end end return self end return module
--- Simple mixin to generate code for a class -- @module GenerateWithMixin local require = require(game:GetService("ReplicatedStorage"):WaitForChild("Nevermore")) local String = require("String") local module = {} --- Adds the GenerateWith API to the class -- @tparam table class -- @tparam[opt] table staticResources If provided, these resources are added to the class automatically function module:Add(class, staticResources) assert(class) class.GenerateWith = self.GenerateWith if staticResources then class:GenerateWith(staticResources) end end --- Generates resources -- @tparam table resources Resources to add function module.GenerateWith(class, resources) assert(type(resources) == "table") for _, resourceName in ipairs(resources) do local storeName = String.ToPrivateCase(resourceName) class[("With%s"):format(resourceName)] = function(self, resource) self[storeName] = resource or error(("Failed to set '%s', %s"):format(resourceName, tostring(resource))) self[resourceName] = resource -- inject publically too, for now return self end class[("Get%s"):format(resourceName)] = function(self) return self[storeName] end end return class end return module
Update GenerateWith mixin to avoid showing warnings
Update GenerateWith mixin to avoid showing warnings
Lua
mit
Quenty/NevermoreEngine,Quenty/NevermoreEngine,Quenty/NevermoreEngine
0b66154ae2b13e1efd86bc776bcd73ba1ad65e6a
hammerspoon/.hammerspoon/launch-apps.lua
hammerspoon/.hammerspoon/launch-apps.lua
local module = {} module.init = function() hs.hotkey.bind({"cmd", "shift"}, "space", function() local focusedApp = hs.application.frontmostApplication() if focusedApp:name() == 'iTerm2' then focusedApp:hide() else hs.application.open("iTerm") end end) hs.hotkey.bind({'ctrl', 'alt', 'shift'}, 'space', function() local focusedApp = hs.application.frontmostApplication() if focusedApp:name() == 'Dynalist' then focusedApp:hide() else hs.application.open('Dynalist') end end) end return module
local module = {} appLauncher = function (bundleID) return function() local focusedApp = hs.application.frontmostApplication() if focusedApp:bundleID() == bundleID then focusedApp:hide() else hs.application.open(bundleID) end end end module.init = function() hs.hotkey.bind({'cmd', 'shift'}, 'space', appLauncher('com.googlecode.iterm2')) hs.hotkey.bind({'ctrl', 'alt', 'shift'}, 'space', appLauncher('io.dynalist')) end return module
Create reusable function for launching apps
Create reusable function for launching apps Switched to bundleID because the name for iTerm is 'iTerm2' but it needs to be `open()`ed with 'iTerm' (dunno why)
Lua
mit
spinningarrow/.files,spinningarrow/.files
f172eb12787dd71efd63d66c18f78637cd1554f6
himan-scripts/meps-friction-velocity.lua
himan-scripts/meps-friction-velocity.lua
-- Friction velocity code -- Tack 6/2015 logger:Info("Calculating friction velocity") local par1 = param("UFLMOM-NM2") -- Eastward turbulent surface stress local par2 = param("VFLMOM-NM2") -- Northward turbulent surface stress local par3 = param("RHO-KGM3") -- density local par4 = param("FRVEL-MS") -- friction velocity local lvl = level(HPLevelType.kHeight, 0) local ewss = luatool:FetchWithType(current_time, lvl, par1, current_forecast_type) local nsss = luatool:FetchWithType(current_time, lvl, par2, current_forecast_type) local rho = luatool:FetchWithType(current_time, lvl, par3, current_forecast_type) local timestepSize = configuration:GetForecastStep():Hours()*3600 if not (ewss and nsss and rho) then print("Data not found") return end function isnan(v) if type(v) == 'number' and tostring(v) == 'nan' then return true else return false end end function isfinite(v) return not isnan(v) end local i = 0 local res = {} for i=1, #rho do local _ewss=ewss[i] local _nsss=nsss[i] local _rho=rho[i] -- friction velocity is defined as sqrt(sheer stress / desity ) if isfinite(_rho) then res[i] = (((_ewss/timestepSize)^2 + (_nsss/timestepSize)^2)/_rho^2)^(1/4) else res[i] = missing end end result:SetValues(res) result:SetParam(par4) logger:Info("Writing results") luatool:WriteToFile(result)
Add friction velocity lua from old directory
Add friction velocity lua from old directory
Lua
mit
fmidev/himan,fmidev/himan,fmidev/himan
8d3681dc1f021262353473baaecbb11022270208
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 serverToData = {} for _, proxy in ipairs(ARGV) do local players = redis.call("SMEMBERS", "proxy:" .. proxy .. ":usersOnline") for _, player in ipairs(players) do local server = redis.call("HGET", "player:" .. player, "server") if server then if not serverToData[server] then serverToData[server] = {} end table.insert(serverToData[server], 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 if not serverToData[server] then serverToData[server] = {} end insert(serverToData[server], player) end end end -- Redis can't map a Lua table back, so we have to send it as JSON. return cjson.encode(serverToData)
Make some Lua calls local to increase performance.
Make some Lua calls local to increase performance.
Lua
unknown
thechunknetwork/RedisBungee,minecrafter/RedisBungee
05db241a6f74eb84a5caab7c30825e4a8a97c097
src/conf.lua
src/conf.lua
function love.conf(t) t.title = "Journey to the Center of Hawkthorne v0.0.61" 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 -- custom variables t.mixpanel = "ac1c2db50f1332444fd0cafffd7a5543" end
function love.conf(t) t.title = "Journey to the Center of Hawkthorne v0.0.62" 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 -- custom variables t.mixpanel = "ac1c2db50f1332444fd0cafffd7a5543" end
Bump release version to v0.0.62
Bump release version to v0.0.62
Lua
mit
hawkthorne/hawkthorne-server-lua,hawkthorne/hawkthorne-client-lua,hawkthorne/hawkthorne-server-lua,hawkthorne/hawkthorne-client-lua
f0683d4636917240c5b22752f518fb58c517287a
pud/event/EntityPositionEvent.lua
pud/event/EntityPositionEvent.lua
local Class = require 'lib.hump.class' local Event = getClass 'pud.event.Event' -- EntityPositionEvent -- local EntityPositionEvent = Class{name='EntityPositionEvent', inherits=Event, function(self, entity, v) verifyClass('pud.entity.Entity', entity) verify('vector', v) Event.construct(self, 'Entity Position Event') self._entity = entity self._v = v end } -- destructor function EntityPositionEvent:destroy() self._entity = nil self._v = nil Event.destroy(self) end function EntityPositionEvent:getEntity() return self._entity end function EntityPositionEvent:getVector() return self._v:clone() end -- the class return EntityPositionEvent
local Class = require 'lib.hump.class' local Event = getClass 'pud.event.Event' -- EntityPositionEvent -- local EntityPositionEvent = Class{name='EntityPositionEvent', inherits=Event, function(self, entity, from, to) verifyClass('pud.entity.Entity', entity) verify('vector', from, to) Event.construct(self, 'Entity Position Event') self._entity = entity self._from = from self._to = to end } -- destructor function EntityPositionEvent:destroy() self._entity = nil self._from = nil self._to = nil Event.destroy(self) end function EntityPositionEvent:getEntity() return self._entity end function EntityPositionEvent:getOrigin() return self._from:clone() end function EntityPositionEvent:getDestination() return self._to:clone() end -- the class return EntityPositionEvent
Revert "change to use vector instead of positions"
Revert "change to use vector instead of positions" This reverts commit 58aa68ddf2f9fa8b641a36b5a812392efc3768d4.
Lua
mit
scottcs/wyx
a5582e84ca346b5721b5ad592bdce9310a646557
nesms.lua
nesms.lua
prev = ""; msg = ""; function write_file (filename, text) output = io.open(filename, "w"); io.output(output); io.write(text); io.close(output); end; function read_file (filename) input = io.open(filename, "r"); io.input(input); input_content = io.read(); io.close(input); return input_content; end; function handle_input () local address = tonumber(read_file("address.txt"), 16); local value = tonumber(read_file("value.txt"), 16); if(address ~= "None" and address ~= nil and value ~= nil) then memory.writebyte(address, value); end; end; while (true) do input_content = read_file("input.txt"); if(input_content ~= nil) then msg = input_content gui.text(0, 50, msg); end; if(msg ~= prev) then prev = msg; handle_input() end; emu.frameadvance(); end;
prev = ""; msg = ""; function write_file (filename, text) output = io.open(filename, "w"); io.output(output); io.write(text); io.close(output); end; function read_file (filename) input = io.open(filename, "r"); io.input(input); input_content = io.read(); io.close(input); return input_content; end; function handle_input () local address = tonumber(read_file("address.txt"), 16); local value = tonumber(read_file("value.txt"), 16); if(address ~= "None" and address ~= nil and value ~= nil) then memory.writebyte(address, value); end; end; while (true) do input_content = read_file("input.txt"); if(input_content ~= nil) then msg = input_content emu.message(msg); end; if(msg ~= prev) then prev = msg; handle_input() end; emu.frameadvance(); end;
Change text positioning on the emulator
Change text positioning on the emulator
Lua
mit
sagnew/NESMS,sagnew/NESMS
c69714fa6d1c764395aea8ce9de44444b89033f9
src/conf.lua
src/conf.lua
function love.conf(t) t.title = "Journey to the Center of Hawkthorne v0.0.41" 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.42" 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.42
Bump release version to v0.0.42
Lua
mit
hawkthorne/hawkthorne-server-lua,hawkthorne/hawkthorne-client-lua,hawkthorne/hawkthorne-client-lua,hawkthorne/hawkthorne-server-lua
5a075af8da802de1dfcef06c95b61d9be2616b2a
tests/test-path.lua
tests/test-path.lua
require("helper") local Path = require('path') -- test `Path.dirname` assert(Path.dirname('/usr/bin/vim') == '/usr/bin') assert(Path.dirname('/usr/bin/') == '/usr') assert(Path.dirname('/usr/bin') == '/usr')
Add basic tests for `path` module
Add basic tests for `path` module Tests #47.
Lua
apache-2.0
rjeli/luvit,DBarney/luvit,rjeli/luvit,boundary/luvit,sousoux/luvit,boundary/luvit,luvit/luvit,sousoux/luvit,connectFree/lev,GabrielNicolasAvellaneda/luvit-upstream,kaustavha/luvit,bsn069/luvit,boundary/luvit,GabrielNicolasAvellaneda/luvit-upstream,zhaozg/luvit,sousoux/luvit,boundary/luvit,sousoux/luvit,boundary/luvit,sousoux/luvit,rjeli/luvit,luvit/luvit,AndrewTsao/luvit,sousoux/luvit,zhaozg/luvit,kaustavha/luvit,boundary/luvit,AndrewTsao/luvit,AndrewTsao/luvit,DBarney/luvit,GabrielNicolasAvellaneda/luvit-upstream,GabrielNicolasAvellaneda/luvit-upstream,connectFree/lev,rjeli/luvit,bsn069/luvit,kaustavha/luvit,bsn069/luvit,DBarney/luvit,DBarney/luvit
5ff5ff484dcbf95d1e78f994f88b68dd0abbc632
layout-bant.lua
layout-bant.lua
SILE.documentState.paperSize = SILE.paperSizeParser(1920 / 300 .. "in x " .. 692 / 300 .. "in") SILE.documentState.orgPaperSize = SILE.documentState.paperSize
Add banner size for church app resources
Add banner size for church app resources
Lua
agpl-3.0
alerque/casile,alerque/casile,alerque/casile,alerque/casile,alerque/casile
3d96da33fb3d269eb77261854d46234bd8928cb0
readmeta.lua
readmeta.lua
local yaml = require("yaml") yaml.configure({ load_nulls_as_nil = true }) return { load = function (filename) return yaml.loadpath(filename) end }
local yaml = require("yaml") yaml.configure({ load_nulls_as_nil = true, load_numeric_scalars = false, }) return { load = function (filename) return yaml.loadpath(filename) end }
Handle YAML keys that start with digits as strings
fix(metadata): Handle YAML keys that start with digits as strings
Lua
agpl-3.0
alerque/casile,alerque/casile,alerque/casile,alerque/casile,alerque/casile
b25534501d7febfa5021dfc795866eb0c8e58258
premake4.lua
premake4.lua
#!lua if os.execute("gcc-6 -v") == 0 then premake.gcc.cc = 'gcc-6' premake.gcc.cxx = 'g++-6' end solution "Opossum" configurations { "Debug", "Release" } platforms "x64" flags { "FatalWarnings", "ExtraWarnings" } project "Opossum" kind "ConsoleApp" language "C++" targetdir "build/" buildoptions "-std=c++1z" files { "**.hpp", "**.cpp" } includedirs { "src/lib/" } configuration "Debug" defines { "DEBUG" } flags { "Symbols" } configuration "Release" defines { "NDEBUG" } flags { "OptimizeSpeed" }
#!lua if os.execute("gcc-6 -v") == 0 then premake.gcc.cc = 'gcc-6' premake.gcc.cxx = 'g++-6' end solution "Opossum" configurations { "Debug", "Release" } platforms "x64" flags { "FatalWarnings", "ExtraWarnings" } project "Opossum" kind "ConsoleApp" language "C++" targetdir "build/" buildoptions { "-std=c++1z", "-I/usr/local/include" } files { "**.hpp", "**.cpp" } includedirs { "src/lib/" } configuration "Debug" defines { "DEBUG" } flags { "Symbols" } configuration "Release" defines { "NDEBUG" } flags { "OptimizeSpeed" }
Add system include path to buildoptions
Add system include path to buildoptions
Lua
mit
hyrise/hyrise,hyrise/hyrise,hyrise/hyrise
ebef1bd18e0383fb7956e3b34cada035f3fcd0fa
src/conf.lua
src/conf.lua
function love.conf(t) t.title = "Journey to the Center of Hawkthorne v0.0.15" 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.16" 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.16
Bump release version to v0.0.16
Lua
mit
hawkthorne/hawkthorne-client-lua,hawkthorne/hawkthorne-server-lua,hawkthorne/hawkthorne-server-lua,hawkthorne/hawkthorne-client-lua
939aa116265c9dadcda1d3d23cf1eed5a319517d
src/conf.lua
src/conf.lua
function love.conf(t) t.title = "Journey to the Center of Hawkthorne v0.0.30" 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.31" 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.31
Bump release version to v0.0.31
Lua
mit
hawkthorne/hawkthorne-server-lua,hawkthorne/hawkthorne-client-lua,hawkthorne/hawkthorne-server-lua,hawkthorne/hawkthorne-client-lua
89e4707cefa1d7835eecdcf5db09652caa88890b
lib/pkg/gcc-linaro-4.8.lua
lib/pkg/gcc-linaro-4.8.lua
return { source = { type = 'dist', location = 'https://releases.linaro.org/15.06/components/toolchain/binaries/4.8/arm-linux-gnueabi/gcc-linaro-4.8-2015.06-x86_64_arm-linux-gnueabi.tar.xz', sha256sum = '04556b1a453008222ab55e4ab9d792f32b6f8566e46e99384225a6d613851587', }, build = { in_source = true, toolchain = false } }
return { source = { type = 'dist', location = 'https://releases.linaro.org/15.06/components/toolchain/binaries/4.8/arm-linux-gnueabi/gcc-linaro-4.8-2015.06-x86_64_arm-linux-gnueabi.tar.xz', sha256sum = '04556b1a453008222ab55e4ab9d792f32b6f8566e46e99384225a6d613851587', }, build = { in_source = true, toolchain = false }, requires = { 'gcc-linaro-4.8-runtime', 'gcc-linaro-4.8-sysroot' } }
Add sysroot and runtime to linaro dependencies
Add sysroot and runtime to linaro dependencies
Lua
mit
bazurbat/jagen
0247dc70d4f1712ca891b5bb80e551d1f61c4ee0
src/conf.lua
src/conf.lua
function love.conf(t) t.title = "Journey to the Center of Hawkthorne v0.0.66" 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.67" 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.67
Bump release version to v0.0.67
Lua
mit
hawkthorne/hawkthorne-server-lua,hawkthorne/hawkthorne-server-lua,hawkthorne/hawkthorne-client-lua,hawkthorne/hawkthorne-client-lua
28e7704af600cdf8613d028f337ea3601f636aaf
src/conf.lua
src/conf.lua
function love.conf(t) t.title = "Journey to the Center of Hawkthorne v0.0.39" 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.40" 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.40
Bump release version to v0.0.40
Lua
mit
hawkthorne/hawkthorne-client-lua,hawkthorne/hawkthorne-server-lua,hawkthorne/hawkthorne-server-lua,hawkthorne/hawkthorne-client-lua
63d4e919df298d4a1dfe99aff84bea3edffbd355
src/SharpLLVM/premake4.lua
src/SharpLLVM/premake4.lua
project "SharpLLVM" kind "SharedLib" language "C#" flags { "Unsafe"} SetupManagedProject() files { "*.cs", "**.i" } dependson { "SharpLLVM.Native" } links { "System", "System.Core", }
project "SharpLLVM" kind "SharedLib" language "C#" flags { "Unsafe"} SetupManagedProject() files { "**.cs", "**.i" } dependson { "SharpLLVM.Native" } links { "System", "System.Core", }
Include subdirectories in SharpLLVM binding, so that TypeRef and ValueRef have proper ToString methods (easier debugging).
Build: Include subdirectories in SharpLLVM binding, so that TypeRef and ValueRef have proper ToString methods (easier debugging).
Lua
bsd-2-clause
xen2/SharpLang,xen2/SharpLang,xen2/SharpLang,xen2/SharpLang,xen2/SharpLang
86ced27953164327676fa69a5319cf27561b2fdf
lib/em-hiredis/lock_lua/lock_acquire.lua
lib/em-hiredis/lock_lua/lock_acquire.lua
-- Set key to token with expiry of timeout, if: -- - It doesn't exist -- - It exists and already has value of token (further set extends timeout) -- Used to implement a re-entrant lock. local key = KEYS[1] local token = ARGV[1] local timeout = ARGV[2] local value = redis.call('get', key) if value == token or not value then -- Great, either we hold the lock or it's free for us to take return redis.call('set', key, token, 'ex', timeout) else -- Someone else has it return false end
-- Set key to token with expiry of timeout, if: -- - It doesn't exist -- - It exists and already has value of token (further set extends timeout) -- Used to implement a re-entrant lock. local key = KEYS[1] local token = ARGV[1] local timeout = ARGV[2] local value = redis.call('get', key) if value == token or not value then -- Great, either we hold the lock or it's free for us to take return redis.call('setex', key, timeout, token) else -- Someone else has it return false end
Use more backward compatible formulation of SET EX
Use more backward compatible formulation of SET EX
Lua
mit
adityagodbole/em-hiredis,loggator/em-hiredis,mloughran/em-hiredis,pusher/em-hiredis,dixiS/em-hiredis
b93e1cbdba08f115bb53cda435c6c47e6534e694
init.lua
init.lua
--[[ Copyright 2014 The Luvit Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS-IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --]] local uv = require('uv') return function (main, ...) -- Inject the global process table _G.process = require('process').globalProcess() -- Seed Lua's RNG do local math = require('math') local os = require('os') math.randomseed(os.clock()) end -- Call the main app main(...) -- Start the event loop uv.run() -- Allow actions to run at process exit. require('hooks'):emit('process.exit') uv.run() -- When the loop exits, close all unclosed uv handles. uv.walk(function (handle) if not handle:is_closing() then handle:close() end end) uv.run() -- Send the exitCode to luvi to return from C's main. return _G.process.exitCode end
--[[ Copyright 2014 The Luvit Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS-IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --]] local uv = require('uv') return function (main, ...) -- Inject the global process table _G.process = require('process').globalProcess() -- Seed Lua's RNG do local math = require('math') local os = require('os') math.randomseed(os.clock()) end local args = {...} local success, err = xpcall(function () -- Call the main app main(unpack(args)) -- Start the event loop uv.run() end, debug.traceback) if success then -- Allow actions to run at process exit. require('hooks'):emit('process.exit') uv.run() else _G.process.exitCode = -1 require('pretty-print').stderr:write("Uncaught exception:\n" .. err .. "\n") end -- When the loop exits, close all unclosed uv handles. uv.walk(function (handle) if not handle:is_closing() then handle:close() end end) uv.run() -- Send the exitCode to luvi to return from C's main. return _G.process.exitCode end
Include stack trace in uncaught exceptions during main
Include stack trace in uncaught exceptions during main
Lua
apache-2.0
kaustavha/luvit,GabrielNicolasAvellaneda/luvit-upstream,bsn069/luvit,rjeli/luvit,kaustavha/luvit,GabrielNicolasAvellaneda/luvit-upstream,bsn069/luvit,luvit/luvit,luvit/luvit,GabrielNicolasAvellaneda/luvit-upstream,bsn069/luvit,rjeli/luvit,GabrielNicolasAvellaneda/luvit-upstream,rjeli/luvit,zhaozg/luvit,kaustavha/luvit,zhaozg/luvit,rjeli/luvit
516c936e2f98eb6cca0aa64e3b612140cdf0b9e7
himan-scripts/potential-precipitation-mask.lua
himan-scripts/potential-precipitation-mask.lua
-- Create PrecipitationType and PrecipitationForm from Potential parameter version -- Only for smartmet editor data -- partio 2018-02-16 local ppf = luatool:Fetch(current_time, level(HPLevelType.kHeight, 0), param("POTPRECF-N")) local ppt = luatool:Fetch(current_time, level(HPLevelType.kHeight, 0), param("POTPRECT-N")) local rrr = luatool:Fetch(current_time, level(HPLevelType.kHeight, 0), param("RRR-KGM2")) if not ppf or not ppt or not rrr then return end local i = 0 local pf = {} local pt = {} local MISS = missing for i=1, #ppf do local _pf = MISS local _pt = MISS if rrr[i] > 0 then _pf = ppf[i] _pt = ppt[i] end pf[i] = _pf pt[i] = _pt end -- using param PRECFORM2-N because that has mapping ready in radon result:SetValues(pf) result:SetParam(param("PRECFORM2-N")) luatool:WriteToFile(result) result:SetValues(pt) result:SetParam(param("PRECTYPE-N")) luatool:WriteToFile(result)
Add script to create precipitation type & form from potential versions
Add script to create precipitation type & form from potential versions This is done by masking those gridpoints where precipitation sum is zero
Lua
mit
fmidev/himan,fmidev/himan,fmidev/himan
602a470b8a1438195c2ce7067f0ff92b7b8a681d
config/nvim/lua/ext/vim.lua
config/nvim/lua/ext/vim.lua
local M = {} local option_scopes = { o = vim.o, wo = vim.wo, bo = vim.bo } function M.option(scope) return setmetatable({}, { __index = function(_, k) return option_scopes[scope][k] end, __newindex = function(_, k, v) option_scopes[scope][k] = v option_scopes["o"][k] = v end }) end function M.mapping(mode) return function(key, binding, options) vim.api.nvim_set_keymap( mode, key, binding, vim.tbl_extend("force", {noremap = true}, options or {}) ) end end return M
local M = {} local option_scopes = { o = vim.o, wo = vim.wo, bo = vim.bo } function M.option(scope) return setmetatable({}, { __index = function(_, k) return option_scopes[scope][k] end, __newindex = function(_, k, v) option_scopes[scope][k] = v option_scopes["o"][k] = v end }) end function M.mapping(mode) return function(key, binding, options) vim.api.nvim_set_keymap( mode, key, binding, vim.tbl_extend("force", {noremap = true}, options or {}) ) end end function M.highlight(name, options) local definitions = {} if options.bg then options.guibg = options.bg options.bg = nil end if options.fg then options.guifg = options.fg options.fg = nil end if options.style then options.gui = options.style options.style = nil end for k, v in pairs(options or {}) do table.insert(definitions, string.join({k, v}, "=")) end vim.cmd( string.join( { "highlight", name, string.join(definitions, " "), }, " " ) ) end function M.highlight_link(from, to) vim.cmd(string.join({"highlight", "link", from, to}, " ")) end return M
Add lua extension for setting highlights
Add lua extension for setting highlights
Lua
mit
charlesbjohnson/dotfiles,charlesbjohnson/dotfiles
763d134b9ffdb0234ca66e2eefb21b4272c410b0
scripts/example/modules.lua
scripts/example/modules.lua
require "example.rules" local srcpath = config.source_dir tests = { srcpath .. '/shared/scripts/tests/common.lua', srcpath .. '/shared/scripts/tests/bson.lua', } -- variables used in testsuite test = { swordmakeskill = 3 -- weaponsmithing skill for swords ,swordiron = 1 -- iron per sword ,horsecapacity = 2000 -- carrying capacity of horses (minus weight) ,cartcapacity = 10000 -- carrying capacity of carts (minus weight) ,shipname = "boat" -- some ship name (any name) }
require "example.rules" local srcpath = config.source_dir tests = { srcpath .. '/shared/scripts/tests/common.lua', srcpath .. '/shared/scripts/tests/bson.lua', }
Make all tests for Eressea pass again, using the config module.
Make all tests for Eressea pass again, using the config module.
Lua
isc
eressea/e4-server,eressea/e4-server
c0d0d366ff0796ccfcd0dcd316e6d82138f1abbd
tests/base/test_option.lua
tests/base/test_option.lua
-- -- tests/base/test_option.lua -- Verify the handling of command line options and the _OPTIONS table. -- Copyright (c) 2014 Jason Perkins and the Premake project -- local suite = test.declare("base_option") -- -- Setup and teardown. -- function suite.setup() _LOGGING = true _OPTIONS["testopt"] = "testopt" end function suite.teardown() _OPTIONS["testopt"] = nil _LOGGING = false end -- -- Because we can't control how the user will type in options on the -- command line, all key lookups should be case insensitive. -- function suite.returnsCorrectOption_onMixedCase() test.isnotnil(_OPTIONS["TestOpt"]) end
-- -- tests/base/test_option.lua -- Verify the handling of command line options and the _OPTIONS table. -- Copyright (c) 2014 Jason Perkins and the Premake project -- local suite = test.declare("base_option") -- -- Setup and teardown. -- function suite.setup() _OPTIONS["testopt"] = "testopt" end function suite.teardown() _OPTIONS["testopt"] = nil end -- -- Because we can't control how the user will type in options on the -- command line, all key lookups should be case insensitive. -- function suite.returnsCorrectOption_onMixedCase() test.isnotnil(_OPTIONS["TestOpt"]) end
Remove dead code from option unit tests
Remove dead code from option unit tests --HG-- extra : rebase_source : bda34e49fc7ef28dd2aa8e3e548f9748f96fd94f
Lua
bsd-3-clause
annulen/premake,annulen/premake,annulen/premake,annulen/premake
987ea442fa0aa3dc5f5d59ec89c9a3d818cd48d3
src/regex.lua
src/regex.lua
-- A simple wrapper for PCRE that uses a cache for compiled expressions. _regex_cache = {} _regex_cache.mt = {} setmetatable(_regex_cache, _regex_cache.mt) _regex_cache.mt.__index = function (self, key) local r, compiled = ifre.compile(pattern) if not r then return end self[key] = compiled return compiled end function regex_search(pattern, subject) _check_required(pattern, 'string') _check_required(subject, 'string') local compiled = _regex_cache[pattern] if compiled == nil then return nil end return ifre.exec(compiled, subject) end
-- A simple wrapper for PCRE that uses a cache for compiled expressions. _regex_cache = {} _regex_cache.mt = {} setmetatable(_regex_cache, _regex_cache.mt) _regex_cache.mt.__index = function (self, key) local r, compiled = ifre.compile(key) if not r then return end self[key] = compiled return compiled end function regex_search(pattern, subject) _check_required(pattern, 'string') _check_required(subject, 'string') local compiled = _regex_cache[pattern] if compiled == nil then return nil end return ifre.exec(compiled, subject) end
Fix incorrect argument to ifre.compile().
Fix incorrect argument to ifre.compile().
Lua
mit
makinacorpus/imapfilter,lefcha/imapfilter,makinacorpus/imapfilter
04585beaafe473757b93f3f84319e687aca73e34
hammerspoon/hammerspoon.symlink/modules/audio-device.lua
hammerspoon/hammerspoon.symlink/modules/audio-device.lua
-- Define audio device names for headphone/speaker switching local usbAudioSearch = "VIA Technologies" -- USB sound card -- Toggle between speaker and headphone sound devices (useful if you have multiple USB soundcards that are always connected) function setDefaultAudio() local current = hs.audiodevice.defaultOutputDevice() local usbAudio = findOutputByPartialUID(usbAudioSearch) if usbAudio and current:name() ~= usbAudio:name() then usbAudio:setDefaultOutputDevice() end hs.notify.new({ title='Hammerspoon', informativeText='Default output device:' .. hs.audiodevice.defaultOutputDevice():name() }):send() end function findOutputByPartialUID(uid) for _, device in pairs(hs.audiodevice.allOutputDevices()) do if device:uid():match(uid) then return device end end end hs.usb.watcher.new(setDefaultAudio):start() setDefaultAudio()
-- -- Define audio device names for headphone/speaker switching -- local usbAudioSearch = "VIA Technologies" -- USB sound card -- -- -- Toggle between speaker and headphone sound devices (useful if you have multiple USB soundcards that are always connected) -- function setDefaultAudio() -- local current = hs.audiodevice.defaultOutputDevice() -- local usbAudio = findOutputByPartialUID(usbAudioSearch) -- -- if usbAudio and current:name() ~= usbAudio:name() then -- usbAudio:setDefaultOutputDevice() -- end -- -- hs.notify.new({ -- title='Hammerspoon', -- informativeText='Default output device:' .. hs.audiodevice.defaultOutputDevice():name() -- }):send() -- end -- -- function findOutputByPartialUID(uid) -- for _, device in pairs(hs.audiodevice.allOutputDevices()) do -- if device:uid():match(uid) then -- return device -- end -- end -- end -- -- hs.usb.watcher.new(setDefaultAudio):start() -- setDefaultAudio()
Disable audio switcher, it causes unexpected audio splitting
fix(Hammerspoon): Disable audio switcher, it causes unexpected audio splitting
Lua
mit
sethvoltz/dotfiles,sethvoltz/dotfiles,sethvoltz/dotfiles,sethvoltz/dotfiles
50ffaa0473ff18a5e9e75c902dc8dac80a4763eb
hammerspoon/.hammerspoon/launch-apps.lua
hammerspoon/.hammerspoon/launch-apps.lua
local module = {} function appLauncher(bundleID) return function() local focusedApp = hs.application.frontmostApplication() if focusedApp:bundleID() == bundleID then focusedApp:hide() else hs.application.launchOrFocusByBundleID(bundleID) end end end module.init = function() hs.hotkey.bind({'cmd', 'shift'}, 'space', appLauncher('net.kovidgoyal.kitty')) hs.hotkey.bind({'ctrl', 'alt', 'shift'}, 'space', appLauncher('io.dynalist')) end return module
local module = {} function appLauncher(bundleID) return function() local focusedApp = hs.application.frontmostApplication() if focusedApp:bundleID() == bundleID then focusedApp:hide() else hs.application.launchOrFocusByBundleID(bundleID) end end end module.init = function() hs.hotkey.bind({'cmd', 'shift'}, 'space', appLauncher('com.googlecode.iterm2')) hs.hotkey.bind({'ctrl', 'alt', 'shift'}, 'space', appLauncher('io.dynalist')) end return module
Revert "Launch Kitty instead of iTerm"
Revert "Launch Kitty instead of iTerm" This reverts commit 379d04d7f7aa3ba133f6be81ed2551e88376f445.
Lua
mit
spinningarrow/.files,spinningarrow/.files
9f95817e32ed5ee1feab9a637691973b1918fa9c
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" ) m:AddSpacer() m:AddOption( "Turn Off All", function() for _, mp in ipairs(MediaPlayer.GetAll()) do MediaPlayer.RequestListen( mp ) end end ) 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 MediaPlayer.HideSidebar() end ) end )
Hide sidebar when turning off all media players
Hide sidebar when turning off all media players
Lua
mit
pixeltailgames/gm-mediaplayer,pixeltailgames/gm-mediaplayer
c52dcbf14e53eaa46eb9862fd518f966e92b4297
test/simple/test-http-finish-before-resolve.lua
test/simple/test-http-finish-before-resolve.lua
module(..., lunit.testcase, package.seeall) function test() local http = require "luanode.http" local google = http.createClient(80, 'www.google.com') local request = google:request('GET', '/', { host = 'www.google.com'}) request:finish("") local response_received = false local timer = setTimeout(function() request.connection:destroy() assert_true(response_received, "A response should have arrived by now") process:exit(-1) end, 2000) request:on('response', function (self, response) console.log('STATUS: ' .. response.statusCode) console.log('HEADERS: ') for k,v in pairs(response.headers) do console.log(k, v) end response_received = true timer:stop() --clearInterval(timer) response:on('data', function (self, chunk) console.log('BODY: %s', chunk) end) end) process:loop() end
module(..., lunit.testcase, package.seeall) function test() local http = require "luanode.http" local google = http.createClient(80, 'www.google.com') local request = google:request('GET', '/', { host = 'www.google.com'}) request:finish("") local response_received = false local timer = setTimeout(function() request.connection:destroy() assert_true(response_received, "A response should have arrived by now") process:exit(-1) end, 5000) request:on('response', function (self, response) console.log('STATUS: ' .. response.statusCode) console.log('HEADERS: ') for k,v in pairs(response.headers) do console.log(k, v) end response_received = true timer:stop() --clearInterval(timer) response:on('data', function (self, chunk) console.log('BODY: %s', chunk) end) end) process:loop() end
Raise the timeout in this test case
Raise the timeout in this test case
Lua
mit
ichramm/LuaNode,ignacio/LuaNode,ichramm/LuaNode,ignacio/LuaNode,ichramm/LuaNode,ignacio/LuaNode,ichramm/LuaNode,ignacio/LuaNode
67b2b201a7251a9810233b91dfef8b888fad7b53
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, pid = 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", } 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
Fix unused variable causing lint error.
Fix unused variable causing lint error.
Lua
mit
NREL/api-umbrella,apinf/api-umbrella,apinf/api-umbrella,NREL/api-umbrella,apinf/api-umbrella,NREL/api-umbrella,apinf/api-umbrella,NREL/api-umbrella,apinf/api-umbrella
8c977a47ca2230975f64f4667a9e3a8db6bb6dad
luasrc/nonC.lua
luasrc/nonC.lua
--[[ This file is for functions that are not direct wraps of the randomkit C routines ]] function randomkit.bytes(...) local result, params = randomkit._check1DParams(0, torch.ByteTensor, ...) if torch.typename(result) ~= "torch.ByteTensor" then error("randomkit.bytes() can only store into a ByteTensor!") end local dataPtr = torch.data(result) randomkit.ffi.rk_fill(dataPtr, result:nElement(), state) return result end
--[[ This file is for functions that are not direct wraps of the randomkit C routines ]] function randomkit.bytes(...) local result, params = randomkit._check1DParams(0, torch.ByteTensor, ...) if torch.typename(result) ~= "torch.ByteTensor" then error("randomkit.bytes() can only store into a ByteTensor!") end local dataPtr = torch.data(result) randomkit.ffi.rk_fill(dataPtr, result:nElement(), randomkit._state) return result end
Fix ugly bug in bytes
Fix ugly bug in bytes Was harmless until we actually started to use the state when decoupling randomkit's stream from torch's.
Lua
bsd-3-clause
fastturtle/torch-randomkit,deepmind/torch-randomkit,deepmind/torch-randomkit,fastturtle/torch-randomkit
93019b6835de3d23367897c514f13b83da330fd1
config/nvim/lua/gb-git.lua
config/nvim/lua/gb-git.lua
keymap = require("nutils").map require("gitsigns").setup( { watch_index = { interval = 100 } } ) keymap("n", "<leader>gs", ":vertical Git<CR>", {silent = true}) keymap("n", "<leader>gh", ":diffget //2<CR>", {silent = true}) keymap("n", "<leader>gl", ":diffget //3<CR>", {silent = true})
keymap = require("nutils").map require("gitsigns").setup( { watch_index = { interval = 100 } } ) keymap("n", "<leader>gs", ":vertical Git<CR>", {silent = true}) keymap("n", "<leader>gh", ":diffget //2<CR>", {silent = true}) keymap("n", "<leader>gl", ":diffget //3<CR>", {silent = true}) keymap("n", "<leader>gb", ":Git blame<CR>", {silent = true})
Add shortcut for git blame
Add shortcut for git blame
Lua
mit
gblock0/dotfiles
e681bae65d6286dde0d9e247b7fa6c5f09c02d90
vim/lua/plugin/telescope.lua
vim/lua/plugin/telescope.lua
local telescope = require('telescope') telescope.setup({ defaults = { mappings = { i = { ['<c-u>'] = false, ['<c-d>'] = false, ['jj'] = require('telescope.actions').close, ['<esc>'] = require('telescope.actions').close, }, }, vimgrep_arguments = { 'rg', '--hidden', '--no-heading', '--with-filename', '--line-number', '--column', '--smart-case', }, }, }) telescope.load_extension('lsp_handlers') require('which-key').register({ f = { name = '+find', b = { [[<cmd>Telescope buffers<cr>]], 'Buffers' }, f = { [[<cmd>Telescope find_files<cr>]], 'Files' }, g = { [[<cmd>Telescope git_status<cr>]], 'Git status' }, o = { [[<cmd>Telescope oldfiles<cr>]], 'Oldfiles' }, ['/'] = { [[<cmd>Telescope live_grep<cr>]], 'Live grep' }, }, }, { prefix = '<leader>', })
local telescope = require('telescope') telescope.setup({ defaults = { mappings = { i = { ['<c-u>'] = false, ['<c-d>'] = false, ['jj'] = require('telescope.actions').close, ['<esc>'] = require('telescope.actions').close, }, }, vimgrep_arguments = { 'rg', '--hidden', '--no-heading', '--with-filename', '--line-number', '--column', '--smart-case', }, }, }) telescope.load_extension('lsp_handlers') require('which-key').register({ f = { name = '+find', b = { [[<cmd>Telescope buffers<cr>]], 'Buffers' }, f = { [[<cmd>Telescope find_files<cr>]], 'Files' }, g = { [[<cmd>Telescope git_status<cr>]], 'Git status' }, o = { [[<cmd>Telescope oldfiles<cr>]], 'Oldfiles' }, ['/'] = { [[<cmd>Telescope grep_string<cr>]], 'Grep string' }, }, }, { prefix = '<leader>', })
Change live_grep to grep_string as more useful
Change live_grep to grep_string as more useful
Lua
mit
MPogoda/dotfiles
db4e228ea3786ecee8f62cfa2c7f189ce9e2f7f4
website/nginx/lua/access.lua
website/nginx/lua/access.lua
local jwt = require "luajwt" local auth = ngx.var.authorization local users = ngx.shared.users local projects = ngx.shared.projects local project = ngx.req.project if (project == nil and (ngx.req.uri ~= '/settings' and ngx.req.uri ~= '/login')) then ngx.say("invalid") ngx.exit(406) end local val, err = jwt.decode(auth, key, true) if not val then return ngx.say("Error:", err) end -- val.user
Add lua code for nginx.
Add lua code for nginx.
Lua
mit
materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org
082d6121ed876760e061b0885a99bc9f14d55c88
lua/parse/yaml/read/scalar/init.lua
lua/parse/yaml/read/scalar/init.lua
local re = require 're' return re.compile([[ {| {:data: %SINGLE_QUOTED :} {:primitive: '' -> 'scalar' :} {:tag: '' -> 'tag:yaml.org,2002:str' :} |} ]], { SINGLE_QUOTED = require 'parse.yaml.read.scalar.quoted.single'; })
local re = require 're' return re.compile([[ {| {:data: %SINGLE_QUOTED :} {:primitive: '' -> 'scalar' :} {:tag: '' -> '!' :} |} ]], { SINGLE_QUOTED = require 'parse.yaml.read.scalar.quoted.single'; })
Use the non-specific tag as default for quoted scalar
Use the non-specific tag as default for quoted scalar
Lua
mit
taxler/radish,taxler/radish,taxler/radish,taxler/radish,taxler/radish,taxler/radish
a6238011a5cfcf9e05e712c720a1485c1008eb21
.config/nvim/lua/user/colorscheme.lua
.config/nvim/lua/user/colorscheme.lua
vim.o.termguicolors = true local base16 = require("user.utils.base16") local background = base16.background() if background ~= nil then vim.opt.background = background end vim.cmd([[let base16colorspace=256]]) local colorscheme = base16.theme() if colorscheme ~= nil then vim.cmd("colorscheme " .. colorscheme) end vim.cmd([[hi TSField guifg=#]] .. vim.g.base16_gui05) vim.cmd([[hi TSPunctSpecial guifg=#]] .. vim.g.base16_gui0F) vim.cmd([[hi TSFuncBuiltin cterm=italic gui=italic ctermfg=6 guifg=#]] .. vim.g.base16_gui0C) vim.cmd([[hi def link TSSymbol rubySymbol]])
vim.o.termguicolors = true local base16 = require("user.utils.base16") local background = base16.background() if background ~= nil then vim.opt.background = background end vim.cmd([[let base16colorspace=256]]) local colorscheme = base16.theme() if colorscheme ~= nil then vim.cmd("colorscheme " .. colorscheme) end vim.cmd([[hi link @variable Identifier]]) vim.cmd([[hi @function.builtin cterm=italic gui=italic ctermfg=6 guifg=#]] .. vim.g.base16_gui0C) -- Ruby specific vim.cmd([[hi link @field.ruby Normal]]) vim.cmd([[hi link @punctuation.special.ruby rubyInterpolationDelimiter]]) vim.cmd([[hi link @symbol.ruby rubySymbol]]) vim.cmd([[hi link @variable.builtin.ruby Debug]])
Remove use of deprecated TS* highlight groups
Remove use of deprecated TS* highlight groups
Lua
isc
tarebyte/dotfiles,tarebyte/dotfiles
4d0c2b549934538e7829419701af4cf06bf74dd7
app/log.lua
app/log.lua
-- Oxypanel Core -- File: app/log.lua -- Desc: logging of all actions for Oxypanel local os = os local database, user = luawa.database, luawa.user local function log() local request = luawa.request local status, err = database:insert( 'log', { 'time', 'object_type', 'object_id', 'user_id', 'action', 'module', 'module_request', 'request' }, {{ os.time(), request.get.type or '', request.get.id or 0, user:checkLogin() and user:getData().id or 0, request.get.action or 'view', request.get.module or '', request.get.module_request or '', request.get.request }}, { delayed = true } ) end return log
-- Oxypanel Core -- File: app/log.lua -- Desc: logging of all actions for Oxypanel local os = os local database, user, request = luawa.database, luawa.user, luawa.request local function log() -- require both id & type for object local id, type = 0, '' if request.get.type and request.get.id then id = request.get.id type = request.get.type end -- insert the log local status, err = database:insert( 'log', { 'time', 'object_type', 'object_id', 'user_id', 'action', 'module', 'module_request', 'request' }, {{ os.time(), type, id, user:checkLogin() and user:getData().id or 0, request.get.action or 'view', request.get.module or '', request.get.module_request or '', request.get.request }}, { delayed = true } ) end return log
Fix for when one of id/type set
Fix for when one of id/type set
Lua
mit
Oxygem/Oxycore,Oxygem/Oxycore,Oxygem/Oxycore
741e743ba141e8f36c2972fedb2ac255292caad6
src/conf.lua
src/conf.lua
function love.conf(t) t.title = "Journey to the Center of Hawkthorne v0.0.12" 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.13" 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.13
Bump release version to v0.0.13
Lua
mit
hawkthorne/hawkthorne-server-lua,hawkthorne/hawkthorne-client-lua,hawkthorne/hawkthorne-server-lua,hawkthorne/hawkthorne-client-lua
30f754176c889c8777299037e1359ddd2bf8ff9c
training/main.lua
training/main.lua
#!/usr/bin/env th require 'torch' require 'cutorch' require 'optim' require 'paths' require 'xlua' local opts = paths.dofile('opts.lua') opt = opts.parse(arg) print(opt) os.execute('mkdir -p ' .. opt.save) torch.save(paths.concat(opt.save, 'opts.t7'), opt, 'ascii') print('Saving everything to: ' .. opt.save) torch.setdefaulttensortype('torch.FloatTensor') cutorch.setDevice(1) torch.manualSeed(opt.manualSeed) paths.dofile('data.lua') paths.dofile('model.lua') paths.dofile('train.lua') paths.dofile('test.lua') paths.dofile('util.lua') if opt.peoplePerBatch > #trainLoader.classes then print('\n\nWarning: opt.peoplePerBatch > number of classes.') print(' + opt.peoplePerBatch: ', opt.peoplePerBatch) print(' + number of classes: ', #trainLoader.classes) print('Setting opt.peoplePerBatch to the number of classes.\n\n') opt.peoplePerBatch = #trainLoader.classes end epoch = opt.epochNumber -- test() for i=1,opt.nEpochs do train() test() epoch = epoch + 1 end
#!/usr/bin/env th require 'torch' require 'cutorch' require 'optim' require 'paths' require 'xlua' local opts = paths.dofile('opts.lua') opt = opts.parse(arg) print(opt) os.execute('mkdir -p ' .. opt.save) torch.save(paths.concat(opt.save, 'opts.t7'), opt, 'ascii') print('Saving everything to: ' .. opt.save) torch.setdefaulttensortype('torch.FloatTensor') cutorch.setDevice(1) torch.manualSeed(opt.manualSeed) paths.dofile('data.lua') paths.dofile('model.lua') paths.dofile('train.lua') paths.dofile('test.lua') paths.dofile('util.lua') if opt.peoplePerBatch > nClasses then print('\n\nError: opt.peoplePerBatch > number of classes. Please decrease this value.') print(' + opt.peoplePerBatch: ', opt.peoplePerBatch) print(' + number of classes: ', nClasses) os.exit(-1) end epoch = opt.epochNumber -- test() for i=1,opt.nEpochs do train() test() epoch = epoch + 1 end
Handle peoplePerBatch > nClasses edge case when nDonkey != -1.
Training: Handle peoplePerBatch > nClasses edge case when nDonkey != -1.
Lua
apache-2.0
francisleunggie/openface,francisleunggie/openface,sumsuddinshojib/openface,Alexx-G/openface,nmabhi/Webface,Alexx-G/openface,nmabhi/Webface,nmabhi/Webface,sumsuddinshojib/openface,nhzandi/openface,xinfang/face-recognize,xinfang/face-recognize,Alexx-G/openface,sumsuddinshojib/openface,sumsuddinshojib/openface,cmusatyalab/openface,nhzandi/openface,cmusatyalab/openface,Alexx-G/openface,xinfang/face-recognize,cmusatyalab/openface,nmabhi/Webface,francisleunggie/openface,nhzandi/openface
60510c9a904c2d370c271d965667981228b062b9
application.lua
application.lua
local send_report = function() print('Report: Sending') -- Report sending code goes here end if not not cfg.data.sta_ssid then wifi.setphymode(wifi.PHYMODE_N) wifi.setmode(wifi.STATION) wifi.sta.config(cfg.data.sta_ssid, cfg.data.sta_psk) local tries = 0 local maxTries = 10 tmr.alarm(0, 1000, 1, function() local ip = wifi.sta.getip() if ip == nil and tries < maxTries then print('Wifi: Connecting..') tries = tries +1 else if tries == maxTries then print('Wifi: Connection failed') else print('Wifi: Connected, IP:', ip) end tmr.stop(0) tries = nil maxTries = nil collectgarbage() cfg.data.report_queued = false cfg.save() send_report() if cfg.data.sleep == '1' then cfg.data.report_queued = true cfg.save() node.dsleep(tonumber(cfg.data.report_interval) * 1000 * 1000) else tmr.alarm(0, tonumber(cfg.data.report_interval) * 1000, 1, send_report) end end end) else print('Wifi: Missing config') end
local send_report = function() print('Report: Sending') -- Report sending code goes here end if not not cfg.data.sta_ssid then wifi.setphymode(wifi.PHYMODE_N) wifi.setmode(wifi.STATION) wifi.sta.config(cfg.data.sta_ssid, cfg.data.sta_psk) local tries = 0 local maxTries = 10 tmr.alarm(0, 1000, 1, function() local ip = wifi.sta.getip() if ip == nil and tries < maxTries then print('Wifi: Connecting..') tries = tries +1 else if tries == maxTries then print('Wifi: Connection failed') else print('Wifi: Connected, IP:', ip) end tmr.stop(0) tries = nil maxTries = nil collectgarbage() cfg.data.report_queued = false cfg.save() send_report() if cfg.data.sleep == '1' then cfg.data.report_queued = true cfg.save() node.dsleep(tonumber(cfg.data.report_interval) * 1000 * 1000, 4) else tmr.alarm(0, tonumber(cfg.data.report_interval) * 1000, 1, send_report) end end end) else print('Wifi: Missing config') end
Use option 4 for deep sleep, to keep wifi module disabled after wakeup.
Use option 4 for deep sleep, to keep wifi module disabled after wakeup. Signed-off-by: Kalman Olah <aaf4c61ddcc5e8a2dabede0f3b482cd9aea9434d@kalmanolah.net>
Lua
mit
kalmanolah/kalmon-ESP8266
f18f13b3ebfb1d497713bf2e540ea1a869e44467
Modules/Shared/Binder/BinderGroup.lua
Modules/Shared/Binder/BinderGroup.lua
--- Groups binders together -- @classmod BinderGroup local BinderGroup = {} BinderGroup.ClassName = "BinderGroup" BinderGroup.__index = BinderGroup function BinderGroup.new(binders, validateConstructor) local self = setmetatable({}, BinderGroup) self._binders = {} self._bindersByTag = {} self._validateConstructor = validateConstructor self:AddList(binders) return self end function BinderGroup:AddList(binders) assert(type(binders) == "table") -- Assume to be using osyris's typechecking library, -- we have an optional constructor to validate binder classes. for _, binder in pairs(binders) do self:Add(binder) end end function BinderGroup:Add(binder) if self._validateConstructor then assert(self._validateConstructor(binder:GetConstructor())) end local tag = binder:GetTag() if self._bindersByTag[tag] then warn("[BinderGroup.Add] - Binder with tag %q already added. Adding again.") end self._bindersByTag[tag] = binder table.insert(self._binders, self._bindersByTag) end function BinderGroup:GetBinders() return self._binders end return BinderGroup
--- Groups binders together -- @classmod BinderGroup local require = require(game:GetService("ReplicatedStorage"):WaitForChild("Nevermore")) local Binder = require("Binder") local BinderGroup = {} BinderGroup.ClassName = "BinderGroup" BinderGroup.__index = BinderGroup function BinderGroup.new(binders, validateConstructor) local self = setmetatable({}, BinderGroup) self._binders = {} self._bindersByTag = {} self._validateConstructor = validateConstructor self:AddList(binders) return self end function BinderGroup:AddList(binders) assert(type(binders) == "table") -- Assume to be using osyris's typechecking library, -- we have an optional constructor to validate binder classes. for _, binder in pairs(binders) do self:Add(binder) end end function BinderGroup:Add(binder) assert(Binder.isBinder(binder)) if self._validateConstructor then assert(self._validateConstructor(binder:GetConstructor())) end local tag = binder:GetTag() if self._bindersByTag[tag] then warn("[BinderGroup.Add] - Binder with tag %q already added. Adding again.") end self._bindersByTag[tag] = binder table.insert(self._binders, binder) end function BinderGroup:GetBinders() assert(self._binders, "No self._binders") return self._binders end return BinderGroup
Fix binder group, add sanity checks
Fix binder group, add sanity checks
Lua
mit
Quenty/NevermoreEngine,Quenty/NevermoreEngine,Quenty/NevermoreEngine
911199e2ceeeec5cc9a5e7bc469b48b199429248
src/conf.lua
src/conf.lua
function love.conf(t) t.title = "Journey to the Center of Hawkthorne v0.0.55" 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.56" 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.56
Bump release version to v0.0.56
Lua
mit
hawkthorne/hawkthorne-server-lua,hawkthorne/hawkthorne-client-lua,hawkthorne/hawkthorne-server-lua,hawkthorne/hawkthorne-client-lua
aae3d482e55a4cc69490e71bd3d7c93e03c3695c
premake5.lua
premake5.lua
project "ocgcore" kind "StaticLib" files { "*.cpp", "*.h" } links { "lua" } if BUILD_LUA then includedirs { "../lua" } end filter "not action:vs*" buildoptions { "-std=c++14" } filter "system:bsd" defines { "LUA_USE_POSIX" } filter "system:macosx" defines { "LUA_USE_MACOSX" } filter "system:linux" defines { "LUA_USE_LINUX" } if not BUILD_LUA then includedirs { "/usr/include/lua5.3" } end
project "ocgcore" kind "StaticLib" files { "*.cpp", "*.h" } links { "lua" } if BUILD_LUA then includedirs { "../lua" } end filter "action:vs*" includedirs { "../lua" } filter "not action:vs*" buildoptions { "-std=c++14" } filter "system:bsd" defines { "LUA_USE_POSIX" } filter "system:macosx" defines { "LUA_USE_MACOSX" } filter "system:linux" defines { "LUA_USE_LINUX" } if not BUILD_LUA then includedirs { "/usr/include/lua5.3" } end
Revert "trigger build lua only once"
Revert "trigger build lua only once" This reverts commit 58bb9a8cbb6c707d4d0ec908b39755e5f51fcb8f.
Lua
mit
mercury233/ygopro-core,mercury233/ygopro-core
8766ff2625ec8ceca592f7da7850fa804983b1be
src/conf.lua
src/conf.lua
function love.conf(t) t.title = "Journey to the Center of Hawkthorne v0.0.49" 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.50" 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.50
Bump release version to v0.0.50
Lua
mit
hawkthorne/hawkthorne-client-lua,hawkthorne/hawkthorne-server-lua,hawkthorne/hawkthorne-server-lua,hawkthorne/hawkthorne-client-lua
b8cee33e2a8a711702c2a7e62f0a276910ba0daa
src/premake5.lua
src/premake5.lua
group("src") project("ECU-core") uuid("02054839-d1cf-4dbf-bc7b-5cc12097ed82") kind("WindowedApp") targetname("ECU") language("C++") files({ "ecu-core.cpp", "ecu-core.h", }) files({ "main_resources.rc", }) links({ "sqlite", "irsdk", "inih", "libcef", "libcef_dll_wrapper", "dxguid", "dinput8", "ECU-base", }) filter("configurations:Release") linkoptions({ "/RELEASE", }) flags({ "WinMain", })
group("src") project("ECU-core") uuid("02054839-d1cf-4dbf-bc7b-5cc12097ed82") kind("WindowedApp") targetname("ECU") language("C++") files({ "ecu-core.cpp", "ecu-core.h", }) files({ "main_resources.rc", }) links({ "sqlite", "irsdk", "inih", "libcef", "libcef_dll_wrapper", "dxguid", "dinput8", "ECU-base", }) filter("configurations:Debug") linkoptions({ "/ENTRY:WinMainCRTStartup", }) filter("configurations:Release") linkoptions({ "/RELEASE", }) flags({ "WinMain", })
Fix linker trying to find the wrong entry point
Fix linker trying to find the wrong entry point I deleted and rebuilt the project solution and found that in debug builds only, the linker was complaining about not finding the program entry point. Turns out the setting for /ENTRY was for non-gui WinMain.
Lua
bsd-3-clause
garciaadrian/ECU,garciaadrian/ECU,garciaadrian/ECU
1a7681674cada36550bfad0b29da6369266e4fa8
agents/monitoring/init.lua
agents/monitoring/init.lua
--[[ Copyright 2012 Rackspace Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS-IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --]] local logging = require('logging') local Entry = {} local argv = require("options") :usage('Usage: ') :describe("e", "entry module") :describe("s", "state directory path") :describe("c", "config file path") :describe("p", "pid file path") :argv("he:p:c:s:") function Entry.run() local mod = argv.args.e and argv.args.e or 'default' mod = './modules/monitoring/' .. mod logging.set_level(logging.INFO) logging.log(logging.DEBUG, 'Running Module ' .. mod) local err, msg = pcall(function() require(mod).run(argv.args) end) if err == false then logging.log(logging.ERR, msg) end end return Entry
--[[ Copyright 2012 Rackspace Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS-IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --]] local logging = require('logging') local Entry = {} local argv = require("options") :usage('Usage: ') :describe("e", "entry module") :describe("s", "state directory path") :describe("c", "config file path") :describe("p", "pid file path") :describe("d", "enable debug logging") :argv("dhe:p:c:s:") function Entry.run() local mod = argv.args.e and argv.args.e or 'default' mod = './modules/monitoring/' .. mod if argv.args.d then logging.set_level(logging.EVERYTHING) else logging.set_level(logging.INFO) end logging.log(logging.DEBUG, 'Running Module ' .. mod) local err, msg = pcall(function() require(mod).run(argv.args) end) if err == false then logging.log(logging.ERR, msg) end end return Entry
Add command line flag to enable debug logging
Add command line flag to enable debug logging
Lua
apache-2.0
kaustavha/rackspace-monitoring-agent,christopherjwang/rackspace-monitoring-agent,cp16net/virgo-base,virgo-agent-toolkit/rackspace-monitoring-agent,cp16net/virgo-base,christopherjwang/rackspace-monitoring-agent,AlphaStaxLLC/rackspace-monitoring-agent,kaustavha/rackspace-monitoring-agent,cp16net/virgo-base,virgo-agent-toolkit/rackspace-monitoring-agent,cp16net/virgo-base,cp16net/virgo-base,AlphaStaxLLC/rackspace-monitoring-agent
e099949ad81110cfac62e23d6cc4a0584c824f68
source/networking/networkFrameworkEntity.lua
source/networking/networkFrameworkEntity.lua
local flower = flower -- LuaSocket should come with zerobrane local socket = require("socket") NetworkFrameworkEntity = flower.class() function NetworkFrameworkEntity:init(t) self.theirIP = t.theirIP or "localhost" self.port = t.port or 48310 self:run() end function NetworkFrameworkEntity:run() self.server, self.servError = socket.bind("*", self.port) if self.server then print("Network connection info:") print(self.server:getsockname()) self.server:settimeout(15) self.client, self.servError = self.server:accept() else self.client, self.servError = socket.connect(self.theirIP, self.port) end if self.client then self.client:settimeout(0) end end function NetworkFrameworkEntity:stop() if self:isConnected() then self.client:close() if self.server then self.server:close() end end self.client = nil self.server = nil end function NetworkFrameworkEntity:isConnected() if self.client then return true end return false, (self.servError or "Unknown error") end function NetworkFrameworkEntity:talker(text) if self:isConnected() then assert(self.client:send(text .. "\n")) end end function NetworkFrameworkEntity:listener() if self:isConnected() then local l, e = self.client:receive() return l end end
local flower = flower -- LuaSocket should come with zerobrane local socket = require("socket") NetworkFrameworkEntity = flower.class() function NetworkFrameworkEntity:init(t) self.theirIP = t.theirIP or "localhost" self.port = t.port or 48310 self:run() end function NetworkFrameworkEntity:run() self.server, self.servError = socket.bind("*", self.port) if self.server then print("Network connection info:") print(self.server:getsockname()) self.server:settimeout(30) self.client, self.servError = self.server:accept() else self.client, self.servError = socket.connect(self.theirIP, self.port) end if self.client then self.client:settimeout(0) end end function NetworkFrameworkEntity:stop() if self:isConnected() then self.client:close() if self.server then self.server:close() end end self.client = nil self.server = nil end function NetworkFrameworkEntity:isConnected() if self.client then return true end return false, (self.servError or "Unknown error") end function NetworkFrameworkEntity:talker(text) if self:isConnected() then assert(self.client:send(text .. "\n")) end end function NetworkFrameworkEntity:listener() if self:isConnected() then local l, e = self.client:receive() return l end end
Increase timeout limit. Some windows computers are quite slow in connecting.
Increase timeout limit. Some windows computers are quite slow in connecting.
Lua
mit
BryceMehring/Hexel
095c3cc0dca02b19127d187137465e8618557b6f
accumulate/accumulate_spec.lua
accumulate/accumulate_spec.lua
local accumulate = require('accumulate') describe('accumulate', function() local function square(x) return x * x end it('should accumulate over an empty array', function() assert.are.same({}, accumulate({}, square)) end) it('should accumulate over an array with a single element', function() assert.are.same({ 4 }, accumulate({ 2 }, square)) end) it('should accumulate over an array with several elements', function() assert.are.same({ 1, 4, 9 }, accumulate({ 1, 2, 3 }, square)) end) it('should accumulate over an array with a different function', function() assert.are.same({ 'HELLO', 'WORLD' }, accumulate({ 'hello', 'world' }, string.upper)) end) end)
local accumulate = require('accumulate') describe('accumulate', function() local function square(x) return x * x end it('should accumulate over an empty array', function() assert.are.same({}, accumulate({}, square)) end) it('should accumulate over an array with a single element', function() assert.are.same({ 4 }, accumulate({ 2 }, square)) end) it('should accumulate over an array with several elements', function() assert.are.same({ 1, 4, 9 }, accumulate({ 1, 2, 3 }, square)) end) it('should accumulate over an array with a different function', function() assert.are.same({ 'HELLO', 'WORLD' }, accumulate({ 'hello', 'world' }, string.upper)) end) it('should not modify the input array', function() local input = { 1, 2, 3 } accumulate(input, square) assert.are.same({ 1, 2, 3 }, input) end) end)
Verify that the input array is not mutated for accumulate
Verify that the input array is not mutated for accumulate
Lua
mit
exercism/xlua,fyrchik/xlua,ryanplusplus/xlua
1f750b26a25356405b89747e9484a93fb3a0a1b1
src/ServerScriptService/DisableCoreGuiElements.script.lua
src/ServerScriptService/DisableCoreGuiElements.script.lua
-- Simply disabled some of the CoreGui elements that we don't need in the game. local starterGui = game:GetService("StarterGui") starterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Health, false) starterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false)
Disable CoreGui elements we don't use
Disable CoreGui elements we don't use
Lua
mit
VoxelDavid/echo-ridge
357f94401ca7148726a1ae59cbb54e0920228e71
spec/complex_frame_spec.lua
spec/complex_frame_spec.lua
SILE = require("core/sile") SILE.backend = "dummy" SILE.init() local tClass = SILE.classes.base({}) tClass:declareFrame("a", { left = "1pt", right = "12pt", top = "1pt", bottom = "top(b)" }) tClass:declareFrame("b", { left = "1pt", right = "12pt", bottom = "12pt", height="4pt" }) SILE.documentState.thisPageTemplate = tClass.pageTemplate describe("Overlapping frame definitions", function() it("should work", function() assert.is.truthy(tClass) end) describe("Frame B", function() local b = SILE.getFrame("b") local h = b:height():tonumber() local t1 = b:top():tonumber() it("should have height", function () assert.is.equal(4, h) end) it("should have top", function () assert.is.equal(8, t1) end) end) describe("Frame A", function() local a = SILE.getFrame("a") local aBot = a:bottom():tonumber() local aHt1 = a:height():tonumber() it("should have bottom", function () assert.is.equal(8, aBot) end) it("should have height", function () assert.is.equal(7, aHt1) end) end) end)
SILE = require("core.sile") SILE.backend = "dummy" SILE.init() local base = require("classes.base") local tClass = pl.class(base) tClass._name = "tClass" tClass.defaultFrameset = { a = { left = "1pt", right = "12pt", top = "1pt", bottom = "top(b)" }, b = { left = "1pt", right = "12pt", bottom = "12pt", height="4pt" } } tClass.firstContentFrame = "a" function tClass:_init () base._init(self) self:post_init() return self end SILE.documentState.documentClass = tClass() describe("Overlapping frame definitions", function() it("should work", function() assert.is.truthy(SILE.documentState.documentClass._initialized) end) describe("Frame B", function() local b = SILE.getFrame("b") local h = b:height():tonumber() local t1 = b:top():tonumber() it("should have height", function () assert.is.equal(4, h) end) it("should have top", function () assert.is.equal(8, t1) end) end) describe("Frame A", function() local a = SILE.getFrame("a") local aBot = a:bottom():tonumber() local aHt1 = a:height():tonumber() it("should have bottom", function () assert.is.equal(8, aBot) end) it("should have height", function () assert.is.equal(7, aHt1) end) end) end)
Update frame spec test to sanely interact with document class
test(frames): Update frame spec test to sanely interact with document class
Lua
mit
alerque/sile,alerque/sile,alerque/sile,alerque/sile
2d4a2c9aa61d4cde4a389e94a9c66a47a10ea2e5
src/CppParser/premake4.lua
src/CppParser/premake4.lua
clang_msvc_flags = { "/wd4146", "/wd4244", "/wd4800", "/wd4345", "/wd4355", "/wd4996", "/wd4624", "/wd4291", "/wd4251" } if not (string.starts(action, "vs") and not os.is_windows()) then project "CppSharp.CppParser" kind "SharedLib" language "C++" SetupNativeProject() flags { common_flags } flags { "NoRTTI" } local copy = os.is_windows() and "xcopy /Q /E /Y /I" or "cp -rf"; local headers = path.getabsolute(path.join(LLVMRootDir, "lib/")) if os.isdir(headers) then postbuildcommands { copy .. " " .. headers .. " " .. path.getabsolute(targetdir()) } end configuration "vs*" buildoptions { clang_msvc_flags } configuration "*" files { "*.h", "*.cpp", "*.lua" } SetupLLVMIncludes() SetupLLVMLibs() configuration "*" end include ("Bindings") include ("Bootstrap")
clang_msvc_flags = { "/wd4146", "/wd4244", "/wd4800", "/wd4345", "/wd4355", "/wd4996", "/wd4624", "/wd4291", "/wd4251" } if not (string.starts(action, "vs") and not os.is_windows()) then project "CppSharp.CppParser" kind "SharedLib" language "C++" SetupNativeProject() flags { common_flags } flags { "NoRTTI" } local copy = os.is_windows() and "xcopy /Q /E /Y /I" or "cp -rf"; local headers = path.getabsolute(path.join(LLVMRootDir, "lib/")) if os.isdir(headers) then postbuildcommands { copy .. " " .. headers .. " %{cfg.targetdir}" } end configuration "vs*" buildoptions { clang_msvc_flags } configuration "*" files { "*.h", "*.cpp", "*.lua" } SetupLLVMIncludes() SetupLLVMLibs() configuration "*" end include ("Bindings") include ("Bootstrap")
Revert "Use the absolute target directory when copying Clang headers."
Revert "Use the absolute target directory when copying Clang headers." This reverts commit 535536d1c1c7d02fff3fb36b34b7825b277674b4.
Lua
mit
SonyaSa/CppSharp,Samana/CppSharp,SonyaSa/CppSharp,mohtamohit/CppSharp,xistoso/CppSharp,mono/CppSharp,mydogisbox/CppSharp,ktopouzi/CppSharp,u255436/CppSharp,Samana/CppSharp,xistoso/CppSharp,u255436/CppSharp,zillemarco/CppSharp,SonyaSa/CppSharp,ktopouzi/CppSharp,ddobrev/CppSharp,mohtamohit/CppSharp,genuinelucifer/CppSharp,ddobrev/CppSharp,ddobrev/CppSharp,genuinelucifer/CppSharp,mono/CppSharp,xistoso/CppSharp,zillemarco/CppSharp,mono/CppSharp,genuinelucifer/CppSharp,mydogisbox/CppSharp,Samana/CppSharp,mohtamohit/CppSharp,inordertotest/CppSharp,inordertotest/CppSharp,Samana/CppSharp,ddobrev/CppSharp,inordertotest/CppSharp,mydogisbox/CppSharp,mohtamohit/CppSharp,ktopouzi/CppSharp,mono/CppSharp,ktopouzi/CppSharp,u255436/CppSharp,u255436/CppSharp,genuinelucifer/CppSharp,zillemarco/CppSharp,ktopouzi/CppSharp,u255436/CppSharp,mydogisbox/CppSharp,zillemarco/CppSharp,inordertotest/CppSharp,mono/CppSharp,ddobrev/CppSharp,xistoso/CppSharp,mono/CppSharp,SonyaSa/CppSharp,mydogisbox/CppSharp,zillemarco/CppSharp,mohtamohit/CppSharp,inordertotest/CppSharp,xistoso/CppSharp,SonyaSa/CppSharp,genuinelucifer/CppSharp,Samana/CppSharp
f99df5df57d2a71c61a76180b8b11ec158457173
epubclean.lua
epubclean.lua
#!/usr/bin/env lua -- Remove footnotes from headers to pass epub validation for Play Books Header = function (element) return pandoc.walk_block(element, { Note = function (element) return {} end }) end
-- Remove footnotes from headers to pass epub validation for Play Books Header = function (element) return pandoc.walk_block(element, { Note = function (element) return {} end }) end
Update lua-filter format for Pandoc 2.6
Update lua-filter format for Pandoc 2.6
Lua
agpl-3.0
alerque/casile,alerque/casile,alerque/casile,alerque/casile,alerque/casile
3db7bafb39835d3fc37ed5067f4a6c793ba3bcac
mods/external_legacy/init.lua
mods/external_legacy/init.lua
-- Minetest 0.4 mod: external_legacy -- See README.txt for licensing and other information. -- Aliases to support moreores' ores minetest.register_alias("moreores:mineral_gold", "default:stone_with_gold") minetest.register_alias("moreores:gold_block", "default:goldblock") minetest.register_alias("moreores:gold_lump", "default:gold_lump") minetest.register_alias("moreores:gold_ingot", "default:gold_ingot")
-- Minetest 0.4 mod: external_legacy -- See README.txt for licensing and other information. -- Aliases to support moreores' ores minetest.register_alias("moreores:mineral_gold", "default:stone_with_gold") minetest.register_alias("moreores:gold_block", "default:goldblock") minetest.register_alias("moreores:gold_lump", "default:gold_lump") minetest.register_alias("moreores:gold_ingot", "default:gold_ingot") minetest.register_alias("moreores:mineral_copper", "default:stone_with_copper") minetest.register_alias("moreores:copper_lump", "default:copper_lump") minetest.register_alias("moreores:copper_ingot", "default:copper_ingot") minetest.register_alias("moreores:bronze_ingot", "default:bronze_ingot") minetest.register_alias("moreores:bronze_block", "default:bronzeblock")
Add aliases for moreores' copper and bronze items
Add aliases for moreores' copper and bronze items
Lua
lgpl-2.1
evrooije/beerarchy,evrooije/beerarchy,evrooije/beerarchy
7ffe70fa723e1df370593f3542e087d96da38664
test/benchmark-fs-stat.lua
test/benchmark-fs-stat.lua
local uv = require 'couv' local NUM_SYNC_REQS = 1e6 local NUM_ASYNC_REQS = 1e5 local MAX_CONCURRENT_REQS = 32 local function warmup(path) -- warm up the thread pool coroutine.wrap(function() local ok, err = pcall(function() for i = 1, MAX_CONCURRENT_REQS do uv.fs_stat(path) end end) if not ok then error(err) end end)() uv.run() -- warm up the OS dirent cache for i = 1, 16 do uv.fs_stat(path) end end local function syncBench(path) local before, after before = uv.hrtime() for i = 1, NUM_SYNC_REQS do uv.fs_stat(path) end after = uv.hrtime() print(string.format("%d stats (sync): %.2fs (%d/s)", NUM_SYNC_REQS, after - before, NUM_SYNC_REQS / (after - before))) end local function asyncBench(path) local before, after for i = 1, MAX_CONCURRENT_REQS do local count = NUM_ASYNC_REQS local before = uv.hrtime() for j = 1, i do coroutine.wrap(function() local ok, err = pcall(function() while count > 0 do uv.fs_stat(path) count = count - 1 end end) if not ok then error(err) end end)() end uv.run() local after = uv.hrtime() print(string.format("%d stats (%d concurrent): %.2fs (%d/s)", NUM_ASYNC_REQS, i, after - before, NUM_ASYNC_REQS / (after - before))) end end local path = "." warmup(path) syncBench(path) asyncBench(path)
Add fs_stat benchmark. TODO: fix SIGSEGV during gc.
Add fs_stat benchmark. TODO: fix SIGSEGV during gc.
Lua
mit
hnakamur/couv,hnakamur/couv