conversations listlengths 2 3 | source stringclasses 1 value | stack stringclasses 1 value |
|---|---|---|
[
{
"from": "system",
"value": "Discard space between heading and content frames\n"
},
{
"from": "human",
"value": "local book = SILE.require(\"classes/book\");\nbook:loadPackage(\"masters\")\nbook:defineMaster({ id = \"right\", firstContentFrame = \"content\", frames = {\n content = {left = \"22... | lua | chosen |
[
{
"from": "system",
"value": "Improve error handling for weird command failures.\n\nIf the shell command exits unexpectedly, this handles that error case\nbetter.\n"
},
{
"from": "human",
"value": "-- Run a command line program and return its exit code and output.\nreturn function(command)\n --... | lua | chosen |
[
{
"from": "system",
"value": "Build: Add support for Linux, BSD and Solaris\n\nFormer-commit-id: 2f7f1e74fd101d688977ceb5129027cb1fa4a67b"
},
{
"from": "human",
"value": "MODULE.Name = \"Vulkan\"\n\nMODULE.Defines = {\n\t\"VK_NO_PROTOTYPES\"\n}\n\nMODULE.Libraries = {\n\t\"NazaraCore\",\n\t\"Naz... | lua | chosen |
[
{
"from": "human",
"value": "Add byChannel filter to examples\n"
},
{
"from": "gpt",
"value": "-- This Source Code Form is subject to the terms of the Mozilla Public\n-- License, v. 2.0. If a copy of the MPL was not distributed with this\n-- file, You can obtain one at http://mozilla.org/MPL/2.0... | lua | chosen |
[
{
"from": "system",
"value": "Disable site-specific browsers for now\n\nI’m still figuring out my best strategy here\n"
},
{
"from": "human",
"value": "-- https://zzamboni.org/post/my-hammerspoon-configuration-with-commentary/\n\nhs.loadSpoon(\"SpoonInstall\")\nspoon.SpoonInstall.use_syncinstall... | lua | chosen |
[
{
"from": "system",
"value": "Clean up code. Not change in functionality\n"
},
{
"from": "human",
"value": "--[[\nIllarion Server\n\nThis program is free software: you can redistribute it and/or modify it under\nthe terms of the GNU Affero General Public License as published by the Free\nSoftwar... | lua | chosen |
[
{
"from": "human",
"value": "Add simple benchmark for load testing.\n"
},
{
"from": "gpt",
"value": "local Platform = require \"cosy.platform\"\nlocal Copas = require \"copas.ev\"\nCopas:make_default ()\nlocal websocket = require \"websocket\"\n\nlocal nb_threads = 1\nlocal n... | lua | chosen |
[
{
"from": "system",
"value": "Fix bug where translate(-1, table) gave -inf result (now gives 0)\n"
},
{
"from": "human",
"value": "-- some utility methods for the space probe\n\nfunction log(message)\n\tprint(os.date() .. \" \" .. tostring(message))\nend\n\nfunction round(n)\n\treturn math.floor... | lua | chosen |
[
{
"from": "system",
"value": "Test that lines become unfolded for searches.\n"
},
{
"from": "human",
"value": "test.open('mid.lua')\nlocal lineno = test.lineno\nlocal colno = test.colno\nlocal assertEq = test.assertEq\nlocal assertAt = test.assertAt\n\nassertAt(0,0)\n\n-- Now try folding\ntest.k... | lua | chosen |
[
{
"from": "system",
"value": "Add Spoon directory to Lua package.path\n"
},
{
"from": "human",
"value": "local modpath, prettypath, fullpath, configdir, docstringspath, hasinitfile, autoload_extensions = ...\n\nprint(\"-- Augmenting require paths\")\npackage.path=configdir..\"/?.lua\"..\";\"..co... | lua | chosen |
[
{
"from": "system",
"value": "Fix a subtle GC bug in the module docs\n"
},
{
"from": "human",
"value": "--- === hs.pathwatcher ===\n---\n--- Watch paths recursively for changes\n---\n--- This simple example watches your Hammerspoon directory for changes, and when it sees a change, reloads your c... | lua | chosen |
[
{
"from": "system",
"value": "Nvim: Set Default Options for Python Files\n"
},
{
"from": "human",
"value": "vim.bo.shiftwidth = 2\nvim.bo.tabstop = 2\nvim.bo.softtabstop = 2\nvim.bo.textwidth = 120\nvim.bo.expandtab = true\n"
},
{
"from": "gpt",
"value": "-- Python Defaults\nvim.bo.s... | lua | chosen |
[
{
"from": "system",
"value": "Extend the Lua dispatcher to support custom auth hooks.\n"
},
{
"from": "human",
"value": "print(\"Loading core\")\n\nlocal cjson = require \"cjson\"\n\nfunction dispatch(raw_object)\n object = cjson.decode(raw_object)\n\n -- Environment reference to hook.\n hook... | lua | chosen |
[
{
"from": "human",
"value": "Policy: Add proxy policy unit test\n\nSigned-off-by: Eloy Coto <2a8acc28452926ceac4d9db555411743254cf5f9@gmail.com>\n"
},
{
"from": "gpt",
"value": "local proxy_policy = require('apicast.policy.http_proxy')\nlocal resty_url = require 'resty.url'\n\ndescribe('HTTP pro... | lua | chosen |
[
{
"from": "system",
"value": "[snow] Implement alias between snow and default pine sapling\n\n - Maybe solve #425\n"
},
{
"from": "human",
"value": "minetest.register_alias(\"default:pine_needles\", \"snow:needles\")\nminetest.register_alias(\"default:pine_needles\", \"snow:leaves\")\n"
},
{... | lua | chosen |
[
{
"from": "system",
"value": "Fix require in the loader.\n"
},
{
"from": "human",
"value": "if #setmetatable ({}, { __len = function () return 1 end }) ~= 1\nthen\n error \"Cosy requires Lua >= 5.2 or Luajit with 5.2 compatibility to run.\"\nend\n\nreturn function (t)\n t = t or {}\n local lo... | lua | chosen |
[
{
"from": "system",
"value": "Make the fake term implementation a bit better\n"
},
{
"from": "human",
"value": "local prev = ...\n\nlocal cursorPos = {0, 0}\nlocal fg = 1\nlocal bg = 32768\nlocal blink = true\nlocal termNat; termNat = {\n\tisColor = function() return false end;\n\tisColour = fun... | lua | chosen |
[
{
"from": "human",
"value": "Support natural width for widgets\n"
},
{
"from": "gpt",
"value": "require \"wow/Frame\";\nrequire \"rainback/AnchoredBound\";\nrequire \"rainback/wow-conversion\";\n\nlocal Widget = WoW.Widget;\n\nWidget:AddConstructor(function(widget)\n widget:OnDelegateSet(func... | lua | chosen |
[
{
"from": "human",
"value": "Add script to verify case resultCode is not exist\n"
},
{
"from": "gpt",
"value": "---------------------------------------------------------------------------------------------\n-- CRQ: APPLINK-25085: [GENIVI] UI interface: SDL behavior in case HMI does not respond t... | lua | chosen |
[
{
"from": "system",
"value": "Add augroup lua utility function\n"
},
{
"from": "human",
"value": "local M = {}\n\nM.map = function(key)\n -- get the extra options\n local opts = {noremap = true}\n for i, v in pairs(key) do\n if type(i) == 'string' then opts[i] = v end\n end\n\n -- basic ... | lua | chosen |
[
{
"from": "system",
"value": "Update Lua bindings to work with wchar_t properly.\n"
},
{
"from": "human",
"value": "local ffi = require \"ffi\"\n\nffi.cdef [[\n bool gface_init(const char*);\n wchar_t *gface_acquire();\n void gface_shutdown();\n]]\n\nlocal C, ffistr = ffi.C, ffi.string\... | lua | chosen |
[
{
"from": "system",
"value": "Bump release version to v0.0.47\n"
},
{
"from": "human",
"value": "function love.conf(t)\n t.title = \"Journey to the Center of Hawkthorne v0.0.46\"\n t.author = \"Kyle Conroy\"\n t.version = \"0.8.0\"\n t.identity ... | lua | chosen |
[
{
"from": "system",
"value": "Clear input queue after each update\n"
},
{
"from": "human",
"value": "local state\nlocal lastState\nlocal renderList = {}\n\nlocal update = function(dt)\n local initial = state ~= lastState\n lastState = state\n renderList = state(dt, initial)\nend\n\nlocal getR... | lua | chosen |
[
{
"from": "system",
"value": "nvim: Improve options for gitconfig and commits\n\nEnable spell checking when editing commit messages.\n\nAn autocmd has also been added to properly set the file type when\nediting gitconfig. This is required since nvim only \"detects\" .gitconfig\nby default (named with a lead... | lua | chosen |
[
{
"from": "system",
"value": "Allow hooks to break and return a custom error.\n"
},
{
"from": "human",
"value": "function module_invoke_all(hook, ...)\n local result, r = {}\n\n for name, m in pairs(ophal.modules) do\n if m[hook] then\n -- TODO: Error handling\n r = m[hook](...) -... | lua | chosen |
[
{
"from": "human",
"value": "Add simple Hotkey Mode functionality\n\nThis adds a simple mode.lua library to Hydra.\n\nExample usage, using the grid.lua library:\n\n```lua\nmoom = ext.mode.bind({'shift', 'cmd'}, 'M',\n function() hydra.alert('Move Windows', 3) end,\n function() end)\n\nmoom:bind({}, 'ESC... | lua | chosen |
[
{
"from": "system",
"value": "Use the Cli.new function and transform call to start into a method call.\n"
},
{
"from": "human",
"value": "local Cli = require \"cosy.cli\"\n\nCli.configure (arg)\nCli.start ()\n"
},
{
"from": "gpt",
"value": "local Cli = require \"cosy.cli\"\n\nlocal c... | lua | chosen |
[
{
"from": "human",
"value": "Solve Average 2 in lua\n"
},
{
"from": "gpt",
"value": "a = tonumber(io.read(\"*n\"))\nb = tonumber(io.read(\"*n\"))\nc = tonumber(io.read(\"*n\"))\n\nprint(string.format('MEDIA = %.1f', (a * 2.0 + b * 3.0 + c * 5.0) / 10.0))\n"
}
] | lua | chosen |
[
{
"from": "system",
"value": "Make leak test less sensitive\n"
},
{
"from": "human",
"value": "return require('lib/tap')(function (test)\n\n test(\"lots-o-timers\", function (print, p, expect, uv)\n collectgarbage()\n local before\n local timer\n for i = 1, 0x10000 do\n timer =... | lua | chosen |
[
{
"from": "system",
"value": "Add --clean option to clean redis database before run.\n"
},
{
"from": "human",
"value": "#! /usr/bin/env lua\n\n-- Default values for the program options:\nlocal defaults = {}\n\nlocal loader = require \"cosy.loader\"\nlocal cli = loader \"cliargs\"\n\ncli:set... | lua | chosen |
[
{
"from": "human",
"value": "Add beginnings of NUMA module for Snabb\n"
},
{
"from": "gpt",
"value": "module(..., package.seeall)\n\nlocal S = require(\"syscall\")\n\nfunction set_cpu (cpu)\n local cpu_set = S.sched_getaffinity()\n cpu_set:zero()\n cpu_set:set(cpu)\n S.sched_setaffinity(... | lua | chosen |
[
{
"from": "human",
"value": "Add Lua OpenGL binding tests\n"
},
{
"from": "gpt",
"value": "local gl = require 'engine.gl'\nlocal ffi = require 'ffi'\nlocal fileutil = require 'engine.fileutil'\n\nlocal render_test = nil\nlocal program, posAttrib = nil, nil\n\nfunction _render()... | lua | chosen |
[
{
"from": "system",
"value": "Revert \"State variable pointers should never change.\"\n"
},
{
"from": "human",
"value": "local Identity, _ = torch.class('nn.Identity', 'nn.Module')\n\nfunction Identity:updateOutput(input)\n self.output:set(input:storage(), input:storageOffset(), input:size(), ... | lua | chosen |
[
{
"from": "system",
"value": "Write better message on output\n"
},
{
"from": "human",
"value": "-- Use this file with hakapcap tool:\n--\n-- hakapcap hellopacket.pcap hellopacket.lua\n-- (adjust paths)\n\n\n--The require lines tolds Haka which dissector\n--it has to register. Those dissectors gi... | lua | chosen |
[
{
"from": "system",
"value": "Add message with image path\n"
},
{
"from": "human",
"value": "local System = require 'System'\n\nlocal Image = {}\nlocal padding = 8\n\nlocal function calculate_size(dir)\n return System.pread('*n', 'du -sm \"%s\"', dir)\nend\n\nlocal function run(format, ...)\n... | lua | chosen |
[
{
"from": "system",
"value": "Add FFI code to 'simple' method.\n"
},
{
"from": "human",
"value": "object \"method_call\" {\n\tc_source[[\ntypedef struct method_call method_call;\n\n#define DEFAULT_PTR ((method_call *)0xDEADBEEF)\n\nmethod_call *method_call_create() {\n\treturn DEFAULT_PTR;\n}\n\... | lua | chosen |
[
{
"from": "system",
"value": "Use the JSON document for storing comments\n"
},
{
"from": "human",
"value": "--\n-- For use with Algernon / Lua\n-- \n-- Project page: https://github.com/xyproto/algernon\n-- Web page: http://algernon.roboticoverlords.org/\n--\n\n-- Set the headers\ncontent(\"appli... | lua | chosen |
[
{
"from": "system",
"value": "Update deps to fix networking bugs\n"
},
{
"from": "human",
"value": "return {\n name = \"creationix/rye\",\n version = \"0.0.1\",\n dependencies = {\n \"creationix/git@0.1.0\",\n \"creationix/require@1.0.2\",\n \"creationix/coro-tcp@1.0.1\",\n \"crea... | lua | chosen |
[
{
"from": "system",
"value": "Add a data file and path to store packages.\n"
},
{
"from": "human",
"value": "local Default = require \"cosy.configuration.layers\".default\n\nDefault.cli = {\n data = os.getenv \"HOME\" .. \"/.cosy/cli.data\",\n directory = os.getenv \"HOME\" .. \"/.cosy\",... | lua | chosen |
[
{
"from": "system",
"value": "Allow checking stdin by passing `-` as filename\n"
},
{
"from": "human",
"value": "local check = require \"luacheck.check\"\nlocal luacompiler = require \"metalua.compiler\"\nlocal luaparser = luacompiler.new()\n\n--- Checks a file. \n-- Returns a file report. \n-- ... | lua | chosen |
[
{
"from": "system",
"value": "Fix rate limits being applied 1 request too soon.\n"
},
{
"from": "human",
"value": "local inspect = require \"inspect\"\nlocal distributed_rate_limit_queue = require \"distributed_rate_limit_queue\"\n\nreturn function(settings, user)\n if settings[\"rate_limit_mod... | lua | chosen |
[
{
"from": "system",
"value": "Fix path for GODI installation on deci.\n"
},
{
"from": "human",
"value": "ci = require(\"ci\")\n--godi = require(\"godi\")\noasis = require(\"oasis\")\ngit = require(\"git\")\n\nci.init()\n-- godi.init()\ngit.init()\noasis.init()\n\n--godi.bootstrap(\"3.12\")\n--go... | lua | chosen |
[
{
"from": "human",
"value": "Add maxheight/maxwidth support into profiles\n"
},
{
"from": "gpt",
"value": "local Sequence = require('lib/sequence')\n\nMeasure = {}\n\n-- measurements conversion constants\nlocal inch_to_meters = 0.0254\nlocal feet_to_inches = 12\n\n--- according to http://wiki.op... | lua | chosen |
[
{
"from": "system",
"value": "Fix parse error on 5.2\n\nBetter yet would be an alias for the 'goto' function, but that can\nbe added later.\n"
},
{
"from": "human",
"value": "-- Copyright (c) 2009 Rob Hoelz <rob@hoelzro.net>\n--\n-- Permission is hereby granted, free of charge, to any person obt... | lua | chosen |
[
{
"from": "system",
"value": "Bump release version to v0.0.7\n"
},
{
"from": "human",
"value": "function love.conf(t)\n t.title = \"Journey to the Center of Hawkthorne v0.0.6\"\n t.author = \"Kyle Conroy\"\n t.version = \"0.8.0\"\n\tt.identity =... | lua | chosen |
[
{
"from": "system",
"value": "Fix invalid warning message from openresty 1.15.8.1\n\nSigned-off-by: Eloy Coto <2a8acc28452926ceac4d9db555411743254cf5f9@gmail.com>\n"
},
{
"from": "human",
"value": "if ngx ~= nil then\n ngx.exit = function()end\nend\n\nif os.getenv('CI') == 'true' then\n local ... | lua | chosen |
[
{
"from": "human",
"value": "Add motd plugin, giving text to a user on each login.\n"
},
{
"from": "gpt",
"value": "-- Prosody IM\n-- Copyright (C) 2008-2010 Matthew Wild\n-- Copyright (C) 2008-2010 Waqas Hussain\n-- Copyright (C) 2010 Jeff Mitchell\n-- \n-- This project is MIT/X11 licensed. Ple... | lua | chosen |
[
{
"from": "system",
"value": "Make C++11 a build option rather than mandatory. For now.\n\nI have a feeling this won't be optional for very long.\n"
},
{
"from": "human",
"value": "solution \"snowball\"\nconfigurations { \"Debug-Static\", \"Release-Static\", \"Debug-Shared\", \"Release-Shared\" ... | lua | chosen |
[
{
"from": "human",
"value": "Add a test for measuring up-values.\n"
},
{
"from": "gpt",
"value": "\nsum = 0\nj = 1000\n\nwhile (j > 0) do\n\n i = 10000\n\n while (i > 0) do\n i = i - 1\n sum = sum + 1\n end\n\n j = j - 1\nend\n\nprint (sum)\n\n"
}
] | lua | chosen |
[
{
"from": "system",
"value": "Use silence mode for curl calling\n"
},
{
"from": "human",
"value": "describe('integration', function()\n local port = '7070'\n local url = 'http://localhost:' .. port\n local toboolean = function(value)\n return not not value\n end\n\n local executeCommand ... | lua | chosen |
[
{
"from": "human",
"value": "Add a script to clean up tabs and spaces in the code files\n"
},
{
"from": "gpt",
"value": "-- Lua script used to clean up tabs and spaces in C, CPP and H files.\r\n-- Copyright (c) 2014, bel\r\n-- MIT License (http://opensource.org/licenses/mit-license.php)\r\n--\r\... | lua | chosen |
[
{
"from": "system",
"value": "Return registered host table when registering a component\n"
},
{
"from": "human",
"value": "\r\n\r\nlocal log = require \"util.logger\".init(\"componentmanager\")\r\nlocal jid_split = require \"util.jid\".split;\r\nlocal hosts = hosts;\r\n\r\nlocal components = {};... | lua | chosen |
[
{
"from": "system",
"value": "Clean up the Editor client build file and add some missing links.\n"
},
{
"from": "human",
"value": "EditorClient = {}\nEditorClient.name = \"Editor.Client\"\n\nproject \"Editor.Client\"\n\n\tkind \"SharedLib\"\n\tlanguage \"C#\"\n\t\n\tprebuildcommands\n\t{ \n\t\t-... | lua | chosen |
[
{
"from": "system",
"value": "Add createShader and createProgram functions\n"
},
{
"from": "human",
"value": "local fileutil = require 'engine.fileutil'\nlocal ffi = require 'ffi'\n\nrequire 'engine.gl_h'\n\n-- return ffi.load(ffi.os == 'OSX' and 'OpenGL.framework/OpenGL' or 'GL')\nreturn ffi.lo... | lua | chosen |
[
{
"from": "system",
"value": "Update my hammerspoon configs to my latest\n"
},
{
"from": "human",
"value": "-- http://www.hammerspoon.org/docs/hs.spotify.html#playpause\n-- http://www.hammerspoon.org/go/\n-- https://www.hammerspoon.org/docs/hs.keycodes.html\n\nhs.hotkey.bind({\"cmd\", \"alt\"}, ... | lua | chosen |
[
{
"from": "human",
"value": "Add a timer library which only does relativeTime and relativeTimeShort\n"
},
{
"from": "gpt",
"value": "module(..., package.seeall)\n\ndo\n\tlocal timeTable = {\n\t\t12 * 30 * 24 * 60 * 60, -- year\n\t\t30 * 24 * 60 * 60, --month\n\t\t7 * 24 * 60 * 60, --week\n\t\t24... | lua | chosen |
[
{
"from": "human",
"value": "Fix LUA_CPATH processing for ffi binding.\n"
},
{
"from": "gpt",
"value": "print(package.cpath)\nlocal path_sep = package.config:sub(3,3)\nprint('path_sep = ', path_sep)\n\nlocal path_match = \"([^\" .. path_sep .. \"]+)\"\nprint('match = ', path_match)\nfor path in ... | lua | chosen |
[
{
"from": "system",
"value": "Use only _G to avoid warning by luacheck.\n"
},
{
"from": "human",
"value": "-- Select the platform using the environment.\n\nlocal global = _ENV or _G\n\nif global.js then\n return require \"cosy.platform.js\"\nelse\n return require \"cosy.platform.standalone\"\n... | lua | chosen |
[
{
"from": "system",
"value": "Fix comment and test block\n"
},
{
"from": "human",
"value": "local util = require 'util'\nlocal lustache = require 'lustache'\nlocal markdown = require 'markdown'\n\nlocal fcgi = {}\nlocal actions = {}\nlocal template\n\nfunction actions.GET(page)\n local view =... | lua | chosen |
[
{
"from": "system",
"value": "Install all tree sitter parsers\n"
},
{
"from": "human",
"value": "require('nvim-treesitter.configs').setup {\n ensure_installed = 'maintained',\n highlight = {\n enable = true,\n additional_vim_regex_highlighting = false,\n },\n}\n"
},
{
"from": "g... | lua | chosen |
[
{
"from": "system",
"value": "Set player position on mapper 5 minutes refresh"
},
{
"from": "human",
"value": "local time_interval = 1.0\nlocal fifo_path = \"/tmp/mt_players_fifo\"\n\nfunction players_data()\n local ps = {}\n for _, player in ipairs(minetest.get_connected_players()) do\n ... | lua | chosen |
[
{
"from": "human",
"value": "Add an example for extracting the plain text contents of a document\n"
},
{
"from": "gpt",
"value": "-- This example prints the plain text contents of a HTML file, excluding\n-- the contents of <code> elements. This may be useful for filtering out\n-- markup from a H... | lua | chosen |
[
{
"from": "system",
"value": "Set EMOP_HOME to current working directory if unset, still issue warning\n"
},
{
"from": "human",
"value": "load(\"gcc/4.8.2\")\nload(\"python/2.7.8\")\nload(\"beautifulsoup4\") --local\nload(\"leptonica/1.71\")\nload(\"icu/52.1\")\n--load(\"tesseract/3.03-rc1\")\nl... | lua | chosen |
[
{
"from": "system",
"value": "Fix for car alarms v2\n\ngit-svn-id: 8769cb08482c9977c94b72b8e184ec7d2197f4f7@506 64450a49-1f69-0410-a0a2-f5ebb52c4f5b\n"
},
{
"from": "human",
"value": "function pickLock(thePlayer)\r\n\tif(isVehicleLocked(source))then\r\n\t\tCarAlarm(source, thePlayer)\r\n\tend\r\... | lua | chosen |
[
{
"from": "human",
"value": "Add new value object, which is useful generic implentation of ROBLOX value objects, for tracking changes.\n"
},
{
"from": "gpt",
"value": "local ReplicatedStorage = game:GetService(\"ReplicatedStorage\")\nlocal RunService = game:GetService(\"RunService\")\n\nlocal Ne... | lua | chosen |
[
{
"from": "system",
"value": "Use Hammerspoon's top-level API for emitting keystroke\n\nWe don't seem to be getting any benefit from using the lower-level\napproach, so let's switch to using hs.eventtap.keyStroke.\n"
},
{
"from": "human",
"value": "local log = hs.logger.new('init.lua', 'debug')\... | lua | chosen |
[
{
"from": "system",
"value": "Use coroutines for attribute iterators\n"
},
{
"from": "human",
"value": "local Element = {}\nElement.__index = Element\n\nlocal function attr_next(attrs, i)\n local j = i + 1\n local a = attrs[j]\n if a then\n return j, a.name, a.value, a.namespace,... | lua | chosen |
[
{
"from": "system",
"value": "Add 'go' button by default\n\nBoth this one and the dynamic display ones should have real icons\nfrom say, fontawesome or so - placeholder for now.\n"
},
{
"from": "human",
"value": "meta_guard_reset(true)\n\n-- normally, add would query for a bind, don't want that ... | lua | chosen |
[
{
"from": "human",
"value": "Add example that does a lot of writes.\n"
},
{
"from": "gpt",
"value": "local profiler = false\n\nif profiler then\n profiler = require \"profiler\"\n profiler:start()\nend\n\nlocal Cosy = require \"cosy.cosy\"\nlocal model = Cosy.root [\"cosyverif.io/model\"]\nlo... | lua | chosen |
[
{
"from": "human",
"value": "Use Hammerspoon to fix my caps lock mappings\n\nThis is supposed to address the issue I had after upgrade to Sierra\n(which breaks Karabiner).\n\nCredits & thanks to: @arbelt\n"
},
{
"from": "gpt",
"value": "--\n-- Config to send escape on short ctrl press\n--\n-- So... | lua | chosen |
[
{
"from": "system",
"value": "fix: Fix cancellation occuring when the resulting task yields\n"
},
{
"from": "human",
"value": "--[=[\n\tA version of task.delay that can be cancelled. Soon to be useless.\n\t@class cancellableDelay\n]=]\n\n--[=[\n\t@function cancellableDelay\n\t@param timeoutInSec... | lua | chosen |
[
{
"from": "human",
"value": "Update mouse shift lock service\n"
},
{
"from": "gpt",
"value": "---\n-- @module MouseShiftLockService\n-- See: https://devforum.roblox.com/t/custom-center-locked-mouse-camera-control-toggle/205323\n\nlocal require = require(game:GetService(\"ReplicatedStorage\"):Wai... | lua | chosen |
[
{
"from": "system",
"value": "Make tup compilation more similar to make in regard to selected files\n\nIf ASSOURCES, CSOURCES or CXXSOURCES is defined, then use these as the\nlist of files to compile. Otherwise search for all files with proper\nextension.\n\nNote that these variables should be tables, not s... | lua | chosen |
[
{
"from": "human",
"value": "Print all variables and its values to the user log"
},
{
"from": "gpt",
"value": "-- Use Activation by Button event \"Manual (triggered by action button)\"\n\nlogf(\"-----\")\nlocal function toDebugString(a, indent)\n\t\tif type(a) == 'table' then\n\t\t\tindent = ind... | lua | chosen |
[
{
"from": "system",
"value": "Update hs.base64 to new docstrings format\n"
},
{
"from": "human",
"value": "--- === hs.base64 ===\n---\n--- This module provides base64 encoding and decoding for Hammerspoon.\n---\n--- Portions sourced from (https://gist.github.com/shpakovski/1902994).\n\n\nlocal m... | lua | chosen |
[
{
"from": "system",
"value": "Add safe Lua globals to config."
},
{
"from": "human",
"value": "return function(...)\n require \"configenv.setup\" (...)\n require \"configenv.range\" (...)\n require \"configenv.util\" (...)\n return ...\nend\n"
},
{
"from": "gpt",
"value": "local ... | lua | chosen |
[
{
"from": "system",
"value": "refactor(packages): Update ifattop package with new interface\n"
},
{
"from": "human",
"value": "local function registerCommands (class)\n\n class:registerCommand(\"ifattop\", function (_, content)\n SILE.typesetter:leaveHmode()\n if #(SILE.typesetter.state.o... | lua | chosen |
[
{
"from": "human",
"value": "Support for LRP (and netcat)\n"
},
{
"from": "gpt",
"value": "#!/usr/local/bin/lua53\n\nlocal width = 38\nlocal forth = {7, 7, 4, 10, 10}\n\nlocal function centrado(s)\n local m = s:len()\n local n = math.floor((width-m)/2 + 0.5) + m\n return string.format('... | lua | chosen |
[
{
"from": "system",
"value": "Change defaults back to originals (posts/pages)\n"
},
{
"from": "human",
"value": "-- Luapress\n-- File: luapress/default_config.lua\n-- Desc: the default config we use to generate local config.lua's\n\nlocal config = {\n -- Url\n url = nil,\n -- Build to t... | lua | chosen |
[
{
"from": "human",
"value": "Add shellcode injection attack sample file\n"
},
{
"from": "gpt",
"value": "require(\"proto-ipv4\")\nrequire(\"proto-tcp\")\n\nlocal bindshell =\t\"\\xeb\\x1f\\x5e\\x89\\x76\\x08\\x31\\xc0\\x88\\x46\\x07\\x89\\x46\\x0c\\xb0\\x0b\" ..\n\t\t\t\t\t\"\\x89\\xf3\\x8d\\x4e... | lua | chosen |
[
{
"from": "system",
"value": "Add conversion between matrix and cdata.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env lua\n\nutil = {}\n\nffi = require('ffi')\n\nfunction util.cdata2array(cdata, size)\n data = torch.Tensor(size)\n for i=1, size do\n data[i] = cdata[i - 1]\n en... | lua | chosen |
[
{
"from": "system",
"value": "Include hidden files in nvim fzf file search.\n"
},
{
"from": "human",
"value": "local autosave = require(\"autosave\")\nlocal lspconfig = require(\"lspconfig\")\n\nautosave.setup(\n {\n enabled = true,\n }\n)\n\nlspconfig.pylsp.setup {}\n"
},
{
... | lua | chosen |
[
{
"from": "system",
"value": "Fix \"name in use\" errors from module preload script\n\nThe module preloaded now uses `loadfile()` rather than `include()` in order to report script errors. As a result, the `_preload.lua` file is no longer marked as included, so subsequent calls to `include(\"_preload.lua\")`... | lua | chosen |
[
{
"from": "system",
"value": "fix(backends): Implement cursor tracking to roughly simulate glues\n"
},
{
"from": "human",
"value": "if (not SILE.outputters) then SILE.outputters = {} end\n\nlocal outfile\nlocal cursorX = 0\nlocal cursorY = 0\nlocal hboxCount = 0\n\nlocal writeline = function (..... | lua | chosen |
[
{
"from": "system",
"value": "Build/NDKServer: Fix dependencies, allowing it to exists in server mode\n\n\nFormer-commit-id: 8130fc4bd6898f21d08bfad37e3b54676ee34b96 [formerly 9f64adc84777930b63419690bf0e454582989158]\nFormer-commit-id: 3838886ff2303fe94b69403e1cab51cc4c99a05c"
},
{
"from": "human",... | lua | chosen |
[
{
"from": "system",
"value": "Test loading C lib from Lua\n"
},
{
"from": "human",
"value": "package.path = './lua/?.lua'\n\nlocal glfw = require 'engine.glfw'()\n\n-- Initialize the library\nif glfw.Init() == 0 then\n return\nend\n\n-- Create a windowed mode window and its OpenGL context\nloca... | lua | chosen |
[
{
"from": "system",
"value": "Fix panic when settings value is null.\n\nThis fixes a panic that is triggered when a null value provided in a the settings sent.\n\nIn 3.0 if the value in the table is null (without quotes) it returns a \"lightfunction\" instead of \"nil\".\nThis adds a check for this to preve... | lua | chosen |
[
{
"from": "system",
"value": "Initialize settings when the plugin first runs\n"
},
{
"from": "human",
"value": "local PLUGIN_NAME = \"Studio Bridge\"\n\n-- Suppresses the \"unknown global\" warnings.\nlocal plugin = plugin\nlocal toolbar = plugin:CreateToolbar(PLUGIN_NAME)\n\nlocal function crea... | lua | chosen |
[
{
"from": "system",
"value": "Set ship factions to allow damage\n"
},
{
"from": "human",
"value": "Create(\"blackhole\").position = {350, 400}\n\nlocal player = CreateShip(require(\"ships/mdfrigate\"), \"player\")\nplayer.position = {500, 500}\nplayer.fuel = 11\n\nlocal npc = CreateShip(require(... | lua | chosen |
[
{
"from": "system",
"value": "Add /EHsc to silence warning.\n\nCloses GH-219\n"
},
{
"from": "human",
"value": "Build {\n\tUnits = \"units.lua\",\n\tConfigs = {\n\t\t{\n\t\t\tName = \"macosx-gcc\",\n\t\t\tDefaultOnHost = \"macosx\",\n\t\t\tTools = { \"gcc\" },\n\t\t},\n\t\t{\n\t\t\tName = \"linu... | lua | chosen |
[
{
"from": "system",
"value": "Add a space station to the test map\n"
},
{
"from": "human",
"value": "Create(\"blackhole\").position = {350, 400}\n\nlocal player = CreateShip(require(\"ships/mdfrigate\"), \"player\")\nplayer.position = {500, 500}\nplayer.fuel = 11\nplayer.faction = 1\n\nlocal npc... | lua | chosen |
[
{
"from": "human",
"value": "Add basic Lemon parser generator support.\n"
},
{
"from": "gpt",
"value": "-- lemon.lua - Support for the Lemon parser generator\n\nmodule(..., package.seeall)\n\nlocal path = require \"tundra.path\"\n\nDefRule {\n Name = \"Lemon\",\n Command = \"lemon $(<)\",\... | lua | chosen |
[
{
"from": "human",
"value": "feat(Hammerspoon): Add new Karabiner module for completing the hyper-key hack\n"
},
{
"from": "gpt",
"value": "-- Based on https://gist.github.com/prenagha/1c28f71cb4d52b3133a4bff1b3849c3e\n\n-- A global variable for the sub-key Hyper Mode\nk = hs.hotkey.modal.new({}... | lua | chosen |
[
{
"from": "system",
"value": "Remove comments and fixed indentation\n"
},
{
"from": "human",
"value": "wordTable = {}\nfor line in io.lines() do\n line:gsub('%S+', function(w) \n wordTable[w] = (wordTable[w] or 0) + 1\n end)\nend\n\ndisplayTable = {} -- Because lua doesn't have any concept ... | lua | chosen |
[
{
"from": "human",
"value": "Add an example useful for testing basing execution.\n"
},
{
"from": "gpt",
"value": "\nlocal sum = 0\nlocal j = 1000\n\nwhile (j > 0) do\n\n local i = 10000\n\n while (i > 0) do\n i = i - 1\n sum = sum + 1\n end\n\n j = j - 1\nend\n\nprint (sum)\n\n"
}
] | lua | chosen |
[
{
"from": "system",
"value": "Fix \"tx\"/\"rx\" link names that were reversed\n"
},
{
"from": "human",
"value": "module(..., package.seeall)\n\n-- This module provides some common definitions for snabbwall programs\n\ninputs = {}\n\nfunction inputs.pcap (kind, path)\n return \"output\", { requ... | lua | chosen |
[
{
"from": "system",
"value": "Change `My Apps` key binding map\n\nPulled By: trungpnn\n"
},
{
"from": "human",
"value": "--------------------------------------------------------------------------------\n\n-- Launch applications\nhs.hotkey.bind(mash.apps, '1', function () hs.application.launchOrF... | lua | chosen |
[
{
"from": "system",
"value": "Comment out undone featuer call\n"
},
{
"from": "human",
"value": "--[[\r\nIllarion Server\r\n\r\nThis program is free software: you can redistribute it and/or modify it under\r\nthe terms of the GNU Affero General Public License as published by the Free\r\nSoftware... | lua | chosen |
[
{
"from": "system",
"value": "Improve the make lexer - recognise error/warning.\n"
},
{
"from": "human",
"value": "local lexer = require('lexer')\nlocal token, word_match = lexer.token, lexer.word_match\nlocal P, S = lpeg.P, lpeg.S\n\nlocal lex = lexer.new('tavi_make', { lex_by_line = true })\n\... | lua | chosen |
[
{
"from": "system",
"value": "Add `emmet` plugin for writing HTML\n"
},
{
"from": "human",
"value": "vim.cmd [[packadd packer.nvim]]\n\nreturn require('packer').startup(function()\n\t-- Packer can manage itself\n\tuse 'wbthomason/packer.nvim'\n\n\t-- TComment\n\tuse 'tomtom/tcomment_vim'\n\n\t--... | lua | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.