conversations listlengths 2 3 | source stringclasses 1 value | stack stringclasses 1 value |
|---|---|---|
[
{
"from": "system",
"value": "Fix softreq, so it reports when no suitable MD5 library is found\n"
},
{
"from": "human",
"value": "\nlocal softreq = function (...) return select(2, pcall(require, ...)); end\nlocal error = error;\n\nmodule \"hashes\"\n\nlocal md5 = softreq(\"md5\");\nif md5 then\n... | lua | chosen |
[
{
"from": "system",
"value": "Allow random to be passed in\n"
},
{
"from": "human",
"value": "---\n-- @module RandomUtils\n-- @author Quenty\n\nlocal RandomUtils = {}\n\nfunction RandomUtils.choice(list)\n\tif #list == 0 then\n\t\treturn nil\n\telseif #list == 1 then\n\t\treturn list[1]\n\telse\... | lua | chosen |
[
{
"from": "system",
"value": "Hammerspoon: Stop using C-` for reload\n"
},
{
"from": "human",
"value": "local log = hs.logger.new('init.lua', 'debug')\n\n-- Use Control+` to reload Hammerspoon config\nhs.hotkey.bind({'ctrl'}, '`', nil, function()\n hs.reload()\nend)\n\nkeyUpDown = function(modi... | lua | chosen |
[
{
"from": "system",
"value": "Make Hammerspoon accessible via the command line\n"
},
{
"from": "human",
"value": "require('keyboard') -- Load Hammerspoon bits from https://github.com/jasonrudolph/keyboard\n\n--------------------------------------------------------------------------------\n-- Loa... | lua | chosen |
[
{
"from": "system",
"value": "Print all variables and its values to the user log"
},
{
"from": "human",
"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 = ... | lua | chosen |
[
{
"from": "system",
"value": "Add tests for types.equals with functions\n"
},
{
"from": "human",
"value": "local types = require \"titan-compiler.types\"\n\ndescribe(\"Titan types\", function()\n\n it(\"pretty-prints types\", function()\n assert.same(\"{ integer }\", types.tostring(typ... | lua | chosen |
[
{
"from": "system",
"value": "Fix cosy path in www prefix.\n"
},
{
"from": "human",
"value": "return function (loader)\n\n local Lfs = loader.require \"lfs\"\n local Default = loader.load \"cosy.configuration.layers\".default\n\n local www = loader.prefix .. \"/lib/luarocks/rocks/cosyveri... | lua | chosen |
[
{
"from": "system",
"value": "Add more tests for socket.try/protect\n"
},
{
"from": "human",
"value": "local socket = require(\"socket\")\ntry = socket.newtry(function()\n print(\"finalized!!!\")\nend)\ntry = socket.protect(try)\nprint(try(nil, \"it works\"))\n"
},
{
"from": "gpt",
... | lua | chosen |
[
{
"from": "system",
"value": "Add <send> minimal support; pass 4/10\n"
},
{
"from": "human",
"value": "LXSC.EXECUTABLE = {}\n\nfunction LXSC.EXECUTABLE:log(scxml)\n\tprint(scxml.datamodel:run(self.expr))\nend\n\nfunction LXSC.EXECUTABLE:raise(scxml)\n\tscxml:fireEvent(self.event,nil,true)\nend\n... | lua | chosen |
[
{
"from": "system",
"value": "Add pythonpath to rucio module\n"
},
{
"from": "human",
"value": "help(\n[[\nThis module loads Rucio 1.6.6 into the environment. Rucio is a \ndistributed data movement system.\n\n]])\n\nwhatis(\"Loads Rucio\")\n\nlocal version = \"1.6.6\"\nlocal base = \"/cvmfs/oasi... | lua | chosen |
[
{
"from": "human",
"value": "Add sample script for new platform API\n"
},
{
"from": "gpt",
"value": "solution \"MySolution\"\n\n\tconfigurations { \n\t\t\"Debug\", \n\t\t\"Deployment\", \n\t\t\"Profiling\", \n\t\t\"Release\" \n\t}\n\n\tplatforms {\n\t\t\"Win32 Static SCRT\",\n\t\t\"Win32 Static ... | lua | chosen |
[
{
"from": "system",
"value": "Add tests for changing a variable's type\n"
},
{
"from": "human",
"value": "local realvim = vim\nlocal scope = scope\nlocal scope_abbr = scope_abbr\n\nmodule('scope_test', vim.bridge)\n\nlocal env = getfenv(1)\n\nfor _, scope in ipairs { env[scope], env[scop... | lua | chosen |
[
{
"from": "system",
"value": "Write a message in simple WebSocket example.\n"
},
{
"from": "human",
"value": "--- Turbo.lua Hello WebSocket example\n--\n-- Copyright 2013 John Abrahamsen\n--\n-- Licensed under the Apache License, Version 2.0 (the \"License\");\n-- you may not use this file excep... | lua | chosen |
[
{
"from": "system",
"value": "Fix for lua console demo\n"
},
{
"from": "human",
"value": "function love.conf(t)\n t.title = \"Modipulate Console\"\n t.author = \"Eric Gregory; Stevie Hryciw\"\n t.version = '0.9.0'\n\tt.identity = modipulate_console\n t.console = true\n t.release =... | lua | chosen |
[
{
"from": "system",
"value": "Tidy and extend poissionPDF tests\n"
},
{
"from": "human",
"value": "require 'randomkit'\nlocal myTest = {}\nlocal tester = torch.Tester()\n\nfunction myTest.poissonPDF()\n tester:assertalmosteq(randomkit.poissonPDF(0, 2), 0.1353352832366126918939994949, 1e-15)\n... | lua | chosen |
[
{
"from": "human",
"value": "Add failing memory leak test\n"
},
{
"from": "gpt",
"value": "return require('lib/tap')(function (test)\n\n test(\"lots-o-timers\", function (print, p, expect, uv)\n collectgarbage()\n local before = uv.resident_set_memory()\n local timer\n for i = 1, 0x... | lua | chosen |
[
{
"from": "system",
"value": "Add TODO on multi-line strings\n"
},
{
"from": "human",
"value": "require(\"compose\")\nrequire(\"mutation\")\n\nlocal function dumptable(bt, tablename)\n local tabledef = {}\n local output = {}\n local prefix = \"\"\n\n if tablename then\n prefix... | lua | chosen |
[
{
"from": "system",
"value": "xenia-cpu-ppc-tests: Adjust link order for clang\n"
},
{
"from": "human",
"value": "project_root = \"../../../../..\"\ninclude(project_root..\"/tools/build\")\n\ngroup(\"tests\")\nproject(\"xenia-cpu-ppc-tests\")\n uuid(\"2a57d5ac-4024-4c49-9cd3-aa3a603c2ef8\")\n ... | lua | chosen |
[
{
"from": "system",
"value": "Use Hackable Slack Client as chat app\n"
},
{
"from": "human",
"value": "-- A global variable for Hyper Mode\nhyperMode = hs.hotkey.modal.new({}, 'F18')\n\n-- Keybindings for launching apps in Hyper Mode\nhyperModeAppMappings = {\n { 'a', 'iTunes' }, -- ... | lua | chosen |
[
{
"from": "system",
"value": "Tests: Update the busted ffi.metatype wrapper\n"
},
{
"from": "human",
"value": "-- don't try to overwrite metatables so we can use --auto-insulate-tests\n-- shamelessly copied from https://github.com/Olivine-Labs/busted/commit/db6d8b4be8fd099ab387efeb8232cfd905912a... | lua | chosen |
[
{
"from": "system",
"value": "Use 127.0.0.1 for redis instead of localhost, because it does not work in ubuntu.\n"
},
{
"from": "human",
"value": "return function (loader)\n\n local Default = loader.load \"cosy.configuration.layers\".default\n\n Default.redis = {\n interface = \"localhost\"... | lua | chosen |
[
{
"from": "system",
"value": "Add Ws2_32.lib library for spillover-tests project\n"
},
{
"from": "human",
"value": "newoption {\n trigger = 'enable-big-endian',\n description = 'Enable big-endian byte order support (default is little-endian)'\n}\n\nsolution \"spillover\"\n configura... | lua | chosen |
[
{
"from": "system",
"value": "Reduce item durability upon player death\n"
},
{
"from": "human",
"value": "-- Player death\n-- deadPlayer - The player (character) whose hitpoints have just been set to zero\n\nrequire(\"base.common\")\nmodule(\"server.playerdeath\", package.seeall)\n\nfunction pla... | lua | chosen |
[
{
"from": "system",
"value": "Use older version of tesseract\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\")\nload(\"tesseract/3.03-rc1\")\nload(\"java/1.7.0_67\")\n"
},
{
"from... | lua | chosen |
[
{
"from": "system",
"value": "Allow modules to run in controllers.\n"
},
{
"from": "human",
"value": "local Models = {}\n\nfunction Models.load(module_name)\n local m = require(module_name)\n m.db:define(m)\nend\n\nreturn Models\n"
},
{
"from": "gpt",
"value": "local Models = {... | lua | chosen |
[
{
"from": "system",
"value": "Fix a bad signature for FireEvent\n"
},
{
"from": "human",
"value": "require \"wow/Frame\";\n\nlocal Delegate = OOP.Class();\n\nfunction Delegate:Constructor(frame)\n self.frame = frame;\n self.eventHandlers = {};\nend;\n\nfunction Delegate:HasScript(event)\n ... | lua | chosen |
[
{
"from": "system",
"value": "Destroy memory pool in test.\n"
},
{
"from": "human",
"value": "context(\"Memory pool unit tests\", function()\n test(\"Mempool variables\", function()\n local mempool = require \"rspamd_mempool\"\n\n local pool = mempool.create()\n\n assert_not_nil(pool)\... | lua | chosen |
[
{
"from": "human",
"value": "Add subprogram to fetch alarms state\n"
},
{
"from": "gpt",
"value": "module(..., package.seeall)\n\nfunction run (args)\n local opts = { command='get-alarms-state', with_path=true, is_config=false }\n args = common.parse_command_line(args, opts)\n local respon... | lua | chosen |
[
{
"from": "system",
"value": "gmod_wire_button: Use the new Data Tables method for the on/off state.\n"
},
{
"from": "human",
"value": "ENT.Type = \"anim\"\r\nENT.Base = \"base_wire_entity\"\r\n\r\nENT.PrintName = \"Wire Button\"\r\nENT.Author = \"\"\r\nENT.C... | lua | chosen |
[
{
"from": "system",
"value": "Add missing consts for default vulkan config dirs on linux\n"
},
{
"from": "human",
"value": "group(\"third_party\")\nproject(\"vulkan-loader\")\n uuid(\"07d77359-1618-43e6-8a4a-0ee9ddc5fa6a\")\n kind(\"StaticLib\")\n language(\"C\")\n\n defines({\n \"_LIB\",... | lua | chosen |
[
{
"from": "human",
"value": "Add Proof of concept to broadcast wmii events to DBus\n"
},
{
"from": "gpt",
"value": "#!/bin/env lua\n\n-- Proof of concept to broadcast wmii events to DBus\n\nlocal l2dbus = require('l2dbus')\nlocal l2dbus_service = require('l2dbus.service')\n\nlocal dump = require... | lua | chosen |
[
{
"from": "system",
"value": "Use better function for launching apps\n"
},
{
"from": "human",
"value": "local module = {}\n\nappLauncher = function (bundleID)\n\treturn function()\n\t\tlocal focusedApp = hs.application.frontmostApplication()\n\n\t\tif focusedApp:bundleID() == bundleID then\n\t\t... | lua | chosen |
[
{
"from": "system",
"value": "Use memo emoji when getting Code-Review: 0, since it's always a human comment.\n"
},
{
"from": "human",
"value": "-- Filter and format messages\n-- return empty string to filter the message\nfunction main(event)\n if event.type ~= \"Code-Review\" and event.type ~... | lua | chosen |
[
{
"from": "system",
"value": "Remove dynalist from app hotkeys\n\nI don't use it any more\n"
},
{
"from": "human",
"value": "local module = {}\n\nfunction appLauncher(bundleID)\n\treturn function()\n\t\tlocal focusedApp = hs.application.frontmostApplication()\n\n\t\tif focusedApp:bundleID() == b... | lua | chosen |
[
{
"from": "human",
"value": "STU-14421: Add script to produce radiation parameters\n"
},
{
"from": "gpt",
"value": "--\n-- SmartMet NWC parameters\n--\n-- Create radiation parameters to SNWC using data from \"edited data\"\n-- and fixing the raditation if total cloudiness has changed.\n-- \n\nlo... | lua | chosen |
[
{
"from": "system",
"value": "Add some test coverage for Document.setters:title()\n"
},
{
"from": "human",
"value": "local parse = require(\"gumbo\").parse\nlocal assert = assert\nlocal _ENV = nil\n\nassert(parse(\"<title> test x y </title>\").title == \"test x y\")\nassert(parse(\"<title>... | lua | chosen |
[
{
"from": "human",
"value": "Add module to get prioritary auths using Redis pubsub\n"
},
{
"from": "gpt",
"value": "local redis_pool = require 'lib/redis_pool'\n\nlocal AUTH_REQUESTS_CHANNEL = 'xc_channel_auth_requests'\nlocal AUTH_RESPONSES_CHANNEL_PREFIX = 'xc_channel_auth_response:'\n\nlocal ... | lua | chosen |
[
{
"from": "system",
"value": "fix(tests): Use `env` for clean env reading\n"
},
{
"from": "human",
"value": "require('helper')\nlocal spawn = require('childprocess').spawn\nlocal os = require('os')\n\nlocal environmentTestResult = false\n\nfunction test()\n local options = {\n env = { TEST1... | lua | chosen |
[
{
"from": "system",
"value": "Reset _G table to avoid invalid warning message\n\nClean warning on openresty 1.15.8.1, where some global variables are\nset, and a warning message is show during startup outside apicast\npackages.\n\nCode related: https://github.com/openresty/lua-nginx-module/blob/61e4d0aac897... | lua | chosen |
[
{
"from": "system",
"value": "Add lit version special command\n"
},
{
"from": "human",
"value": "require('luvi').bundle.register(\"luvit-require\", \"modules/require.lua\");\nlocal uv = require('uv')\nlocal require = require('luvit-require')()(\"bundle:main.lua\")\n_G.p = require('pretty-print')... | lua | chosen |
[
{
"from": "system",
"value": "Fix \"launchOrFocus\" behavior for Atom\n\nSome time in the last few weeks, something seems to have changed such\nthat Hyper+E always opens a *new* Atom instance, even when there's\nalready an exising Atom instance running. I would expect\nhs.application.launchOrFocus to focus ... | lua | chosen |
[
{
"from": "system",
"value": "Enable build of DBus wrapper for AudioManager\n"
},
{
"from": "human",
"value": "return {\n source = {\n type = 'git',\n location = 'https://github.com/GENIVI/AudioManager.git',\n branch = '7.5',\n ignore_dirty = true\n },\n patc... | lua | chosen |
[
{
"from": "human",
"value": "Add simple test for TCP server and client\n\nClient sends `'ping'`, server responds with `'pong'`\n"
},
{
"from": "gpt",
"value": "local TCP = require('tcp')\n\nlocal PORT = 8080\n\nlocal server = TCP.create_server(\"127.0.0.1\", PORT, function (client)\n client:on(... | lua | chosen |
[
{
"from": "system",
"value": "Switch to 2 space tabs as requested upstream\n"
},
{
"from": "human",
"value": "--[[\n--jUnit output formatter for busted\n--ReMake Electric ehf 2012\n--Considered to be released under your choice of Apache, 2 clause BSD, ISC or MIT licenses\n--]]\n--\nlocal output ... | lua | chosen |
[
{
"from": "system",
"value": "Fix bug on batch size\n"
},
{
"from": "human",
"value": "local Processer = require 'dataset.processer'\n\nlocal cmd = torch.CmdLine()\ncmd:option('-batch_size', 32, 'batch size')\n\nlocal opt = cmd:parse(arg)\n\nlocal directory = 'dataset/ptb/'\nlocal train_file = d... | lua | chosen |
[
{
"from": "system",
"value": "Add infrastructure for arbitrary code entry via sms\n"
},
{
"from": "human",
"value": "msg = \"\";\n\nfunction write_file (filename, text)\n output = io.open(filename, \"w\");\n io.output(output);\n io.write(text);\n io.close(output);\nend;\n\nfunction r... | lua | chosen |
[
{
"from": "system",
"value": "refactor(packages): Update debug package with new interface\n"
},
{
"from": "human",
"value": "local function registerCommands (class)\n\n class:registerCommand(\"debug\", function (options, _)\n for k, v in pairs(options) do\n SILE.debugFlags[k] = SU.boole... | lua | chosen |
[
{
"from": "system",
"value": "Set default cc and cxx for android-standalone-arm to clang\n"
},
{
"from": "human",
"value": "return {\n build = {\n type = 'android-standalone-toolchain',\n toolchain = 'android-ndk-r16b',\n arch = 'arm',\n system = 'arm-... | lua | chosen |
[
{
"from": "system",
"value": "Add newline at end of file\n"
},
{
"from": "human",
"value": "package.path = package.path .. \";spec/?.lua\"\nngx = require(\"fake_ngx\")\nlocal cassandra = require(\"cassandra\")\n\ndescribe(\"cassandra\", function()\n before_each(function()\n cql = cassandra.n... | lua | chosen |
[
{
"from": "system",
"value": "Make test for `gettime` more robust\n"
},
{
"from": "human",
"value": "local system = require 'system.core'\n\ndescribe('Test time functions', function()\n it('gettime returns current time', function()\n assert.is_near(os.time(), system.gettime(), 1.0)\n end)\n... | lua | chosen |
[
{
"from": "system",
"value": "Add notification when running the permissions sample from an unsupported\ndirectory\n"
},
{
"from": "human",
"value": "-- From the example for https://github.com/xyproto/permissions2\nprint(\"Has user bob: \" .. tostring(HasUser(\"bob\")))\nprint(\"Logged in on serv... | lua | chosen |
[
{
"from": "system",
"value": "Update luvi to get zip timestamp fix\n"
},
{
"from": "human",
"value": "return {\n name = \"luvit/lit\",\n version = \"2.3.0\",\n homepage = \"https://github.com/luvit/lit\",\n description = \"The Luvit Invention Toolkit is a luvi app that handles dependencies a... | lua | chosen |
[
{
"from": "system",
"value": "Revert mainmenu version seperator change.\n"
},
{
"from": "human",
"value": "-- Copyright (c) 2015-2017 Lymia Alusyia <lymia@lymiahugs.com>\n--\n-- Permission is hereby granted, free of charge, to any person obtaining a copy\n-- of this software and associated docum... | lua | chosen |
[
{
"from": "system",
"value": "[nvim] Fix importModuleSpecifierPreference { relative => non-relative }\n"
},
{
"from": "human",
"value": "return {\n\tinit_options = {\n\t\tpreferences = {\n\t\t\timportModuleSpecifierPreference = \"relative\",\n\t\t},\n\t},\n}\n"
},
{
"from": "gpt",
"v... | lua | chosen |
[
{
"from": "system",
"value": "Add MNI and FSFAST locations for freesurfer\n"
},
{
"from": "human",
"value": "help(\n[[\nThis module loads Freesurfer 5.3.0 into the environment. Freesurfer is\nan open source software suite for processing and analyzing (human) brain \nMRI images. \n\n]])\n\nwhatis... | lua | chosen |
[
{
"from": "human",
"value": "Add Gtk override, for now only automatically initializes Gtk.\n"
},
{
"from": "gpt",
"value": "------------------------------------------------------------------------------\n--\n-- LGI Gtk3 override module.\n--\n-- Copyright (c) 2010 Pavel Holejsovsky\n-- License... | lua | chosen |
[
{
"from": "system",
"value": "Add a helper function to hs.audiodevice to find devices by name\n"
},
{
"from": "human",
"value": "--- === hs.audiodevice ===\n---\n--- Manipulate the system's audio devices.\n---\n--- This module is based primarily on code from the previous incarnation of Mjolnir b... | lua | chosen |
[
{
"from": "human",
"value": "Convert existing CORS module into a policy\n\nThe functionality is exactly the same.\n"
},
{
"from": "gpt",
"value": "local policy = require('policy')\nlocal _M = policy.new('CORS Policy')\n\nlocal function set_cors_headers()\n local origin = ngx.var.http_origin\n\n... | lua | chosen |
[
{
"from": "system",
"value": "Add more vars needed for freesurfer\n"
},
{
"from": "human",
"value": "help(\n[[\nThis module loads Freesurfer 5.3.0 into the environment. Freesurfer is\nan open source software suite for processing and analyzing (human) brain \nMRI images. \n\n]])\n\nwhatis(\"Loads... | lua | chosen |
[
{
"from": "system",
"value": "Fix return type for openChest function in luadoc.\n"
},
{
"from": "human",
"value": "--- Provides inventory functions.\n-- @module rpgplus.inventory\n\n--- Checks if the player has the given items.\n-- @param player player\n-- @param ... items to check for (each as ... | lua | chosen |
[
{
"from": "human",
"value": "Add simple coro-http server test\n"
},
{
"from": "gpt",
"value": "require('coro-http').createServer(\"127.0.0.1\", 8080, function(req)\n p(req)\n return {\n code = 200,\n reason = \"OK\",\n {\"Content-Length\", \"6\"},\n {\"Connectio... | lua | chosen |
[
{
"from": "system",
"value": "Stop scanning for failed messages upon finding processing messages\n"
},
{
"from": "human",
"value": "local queue = KEYS[1]\nlocal maxMessages = tonumber(ARGV[1])\nlocal queueKey = '{' .. queue .. '}:messages'\nlocal processingKey = '{' .. queue .. '}:processing'\nl... | lua | chosen |
[
{
"from": "human",
"value": "Test luafilesystem to get file attribute\n\nSigned-off-by: Robbie Cao <643a933cab46d49aae0d64e790867eaec8b68831@gmail.com>\n"
},
{
"from": "gpt",
"value": "local lfs = require(\"lfs\")\n\nfunction attrdir (path)\n for file in lfs.dir(path) do\n if file ~= \... | lua | chosen |
[
{
"from": "system",
"value": "Add extra tests for core\n"
},
{
"from": "human",
"value": "local helper = require 'spec.helper'\nlocal cors = require 'cors'\n\n\ndescribe(\"CORS\", function()\n describe(\"when the status is not 404\", function()\n it(\"does nothing\", function()\n lo... | lua | chosen |
[
{
"from": "human",
"value": "Add Heka log decoder for Keystone/Apache\n\nPartially implements: blueprint heka\nChange-Id: I562dddcfa75f3a814874f7735d735416d9aa7803\n"
},
{
"from": "gpt",
"value": "-- Copyright 2015 Mirantis, Inc.\n--\n-- Licensed under the Apache License, Version 2.0 (the \"Lice... | lua | chosen |
[
{
"from": "system",
"value": "Make hooking code more generic and simplify the code a bit.\n"
},
{
"from": "human",
"value": "local mod = EPGP:NewModule(\"EPGP_GPTooltip\")\n\nfunction mod:AddGP2Tooltip(frame, itemLink)\n local gp, ilvl, ivalue = GPUtils:GetGPValue(itemLink)\n if gp and gp > 0 ... | lua | chosen |
[
{
"from": "system",
"value": "Work with apicast's built-in resolver\n"
},
{
"from": "human",
"value": "local redis = require 'resty.redis'\n\nlocal function get_host_and_port(s)\n if s == nil then return { } end\n\n local res = { }\n local i = 1\n\n for str in string.gmatch(s, '[^:]+') do\n ... | lua | chosen |
[
{
"from": "system",
"value": "Add right clicking logic so we can move TO places!\n"
},
{
"from": "human",
"value": "-- Add our third party libs to the module load path\npackage.path = package.path ..\n ';../third_party/middleclass/?.lua;' ..\n ';./third_party/middlecl... | lua | chosen |
[
{
"from": "system",
"value": "Add missing require for base.common\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\nSoftware Found... | lua | chosen |
[
{
"from": "system",
"value": "Add some mappings to nvim\n"
},
{
"from": "human",
"value": "local map = require('utils').map\nlocal cmd = vim.cmd\n\ncmd([[colorscheme dracula]])\n\n-- \" Remove trailing spaces on save\ncmd([[autocmd BufWritePre * :%s/\\s\\+$//e]])\n\n\n-- \" Window Splitting and ... | lua | chosen |
[
{
"from": "system",
"value": "Replace player ship with mdfrigate\n"
},
{
"from": "human",
"value": "local player = CreateShip(require(\"ships/broadside\"), \"player\")\nplayer.position = {500, 500}\nplayer.fuel = 11\n\nCreate(\"asteroid\", {startpoint = {0, 0}, endpoint = {1000, 1000}, range = 1... | lua | chosen |
[
{
"from": "human",
"value": "test(inputs): Add spec for testing TeXlike input parsing\n"
},
{
"from": "gpt",
"value": "SILE = require(\"core/sile\")\n\ndescribe(\"#TeXlike #input\", function ()\n local toTree = SILE.inputs.TeXlike.docToTree\n\n it(\"command with content\", function()\n loca... | lua | chosen |
[
{
"from": "system",
"value": "Copy raw data in case of proxies.\n"
},
{
"from": "human",
"value": "-- Shallow Copy\n-- ============\n\n-- This `shallow_copy` function performs a shallow copy of a table.\n-- If its parameter is `nil`, it returns an empty table.\n--\n-- __Trick:__ This function co... | lua | chosen |
[
{
"from": "system",
"value": "Support Windows gmake in premake file\n"
},
{
"from": "human",
"value": "-- A solution contains projects, and defines the available configurations\nsolution \"Spelling_Game\"\n configurations { \"Debug\", \"Release\" }\n location \"build\"\n \n -- A project de... | lua | chosen |
[
{
"from": "system",
"value": "Use unlink instead of del for better performance\n"
},
{
"from": "human",
"value": "local call = redis.call\nlocal queue = KEYS[1]\nlocal messages = ARGV\nlocal queueKey = '{' .. queue .. '}:messages' .. ':'\nlocal processingKey = '{' .. queue .. '}:processing'\nfor... | lua | chosen |
[
{
"from": "human",
"value": "Add module for ta-specific utilities.\n"
},
{
"from": "gpt",
"value": "-- Utilities for dealing with textadept objects.\nlocal M = {}\n\n-- Return the number of characters on this line, without\n-- line endings.\nfunction M.line_length(lineno)\n\treturn buffer.line_e... | lua | chosen |
[
{
"from": "human",
"value": "Add case for rejecting duplicate services\n"
},
{
"from": "gpt",
"value": "---------------------------------------------------------------------------------------------------\n-- Precondition: \n-- 1) Application with <appID> is registered on SDL.\n-- 2) Specific ... | lua | chosen |
[
{
"from": "human",
"value": "Add example use of poll_zsock wrapper.\n"
},
{
"from": "gpt",
"value": "local zmq = require'zmq'\nlocal poller = require\"examples.poller\"\nlocal poll_zsock = require\"examples.poll_zsock\"\n\nlocal poll = poller.new()\npoll_zsock.set_poller(poll)\n\nlocal c = zmq.i... | lua | chosen |
[
{
"from": "system",
"value": "Use CookieSecret() in the permissions example\n"
},
{
"from": "human",
"value": "-- From the example for https://github.com/xyproto/permissions2\nprint(\"Has user bob: \" .. tostring(HasUser(\"bob\")))\nprint(\"Logged in on server: \" .. tostring(IsLoggedIn(\"bob\")... | lua | chosen |
[
{
"from": "human",
"value": "Add humanoid tracker object to track player's alive humanoids\n"
},
{
"from": "gpt",
"value": "--- Tracks a player's character's humanoid\n-- @classmod HumanoidTracker\n-- @author Quenty\n\nlocal require = require(game:GetService(\"ReplicatedStorage\"):WaitForChild(\... | lua | chosen |
[
{
"from": "system",
"value": "Fix error in wall placement script\n"
},
{
"from": "human",
"value": "return function(player, item)\n local world = player:getWorld()\n local focus = player:getWorldFocus()\n local tileX = math.floor(focus.x)\n local tileY = math.floor(focus.y)\n local wallType... | lua | chosen |
[
{
"from": "system",
"value": "Fix not passing through first cipher argument in vararg form\n"
},
{
"from": "human",
"value": "local ctx = require\"_openssl.ssl.context\"\n\nlocal pack = table.pack or function(...) return { n = select(\"#\", ...); ... } end\n\n-- Allow passing a vararg of ciphers... | lua | chosen |
[
{
"from": "system",
"value": "Rename module from 'example' to 'my_module'"
},
{
"from": "human",
"value": "solution \"Example\"\n\tlanguage\t\t\"C++\"\n\tlocation\t\t\"project\"\n\ttargetdir\t\t\"bin\"\n\n\t--\n\t-- Statically link the C-Runtime to reduce dependencies needed to run our module\n\... | lua | chosen |
[
{
"from": "system",
"value": "Add a anonymous virtualhost to the prosody config\n"
},
{
"from": "human",
"value": "modules_enabled = {\n\t\t\"roster\";\n\t\t\"saslauth\";\n\t\t\"tls\";\n\t\t\"dialback\";\n\t\t\"disco\";\n\t\t\"private\"; \n\t\t\"vcard\";\n\t\t\"version\";\n\t\t\"uptime\";\n\t\t\... | lua | chosen |
[
{
"from": "human",
"value": "Add test case for accessing created single-item variables\n\nChecks that values created from Lua from a type constructor can be\nobtained, and changed.\n"
},
{
"from": "gpt",
"value": "#! /usr/bin/env lua\n--\n-- libtest-create-var-from-type.lua\n-- Copyright (C) 201... | lua | chosen |
[
{
"from": "system",
"value": "Add sdk dependency to hi-utils\n"
},
{
"from": "human",
"value": "-- HiSilicon Linux SDK\n\npackage { 'make', 'host',\n source = 'make-3.81.tar.bz2'\n}\n\npackage { 'hi-kernel' }\n\npackage { 'hi-sdk', 'target',\n { 'build_linux',\n { 'hi-kernel', 'unpa... | lua | chosen |
[
{
"from": "system",
"value": "Add minimal instructions for proctitle module\n"
},
{
"from": "human",
"value": "-- Changes the process name to 'prosody' rather than 'lua'/'lua5.1'\n-- Copyright (C) 2015 Rob Hoelz\n--\n-- This file is MIT/X11 licensed.\n\nlocal proctitle = require 'proctitle';\n\n... | lua | chosen |
[
{
"from": "system",
"value": "Add formatted time to timelapse image names\n"
},
{
"from": "human",
"value": "require \"defines\"\n\nscript.on_event(defines.events.on_tick, function(event)\n if (game.tick % 1800 == 0 and game.tick > 0) then\n local player = game.player\n local spawnpos = p... | lua | chosen |
[
{
"from": "system",
"value": "Make spawn.stdout in test-spawn passes on Windows.\n"
},
{
"from": "human",
"value": "if arg[1] == 'spawn_helper1' then\n os.exit(1)\nend\n\nif arg[1] == 'spawn_helper2' then\n print(\"hello world\")\n os.exit(1)\nend\n\nif arg[1] == 'spawn_helper3' then\n local... | lua | chosen |
[
{
"from": "system",
"value": "chore(packages): Handle raw handlers in new pkg format\n"
},
{
"from": "human",
"value": "local base = pl.class()\nbase.type = \"package\"\nbase._name = \"base\"\n\nbase._initialized = false\nbase.class = nil\n\nfunction base:_init (class)\n self.class = class\n s... | lua | chosen |
[
{
"from": "human",
"value": "Add an example showing how to remove an element node by id\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env lua\nlocal gumbo = require \"gumbo\"\nlocal serialize = require \"gumbo.serialize.html\"\n\n--- Iterate an element node recursively and remove any descendant el... | lua | chosen |
[
{
"from": "system",
"value": "Use exact busybox for self-wrapping\n"
},
{
"from": "human",
"value": "\ninv.task('wrap-yourself')\n\t.using('busybox')\n\t\t.run('mkdir', '-p', 'dist/tmp/')\n\t\t.run('cp', 'involucro', 'dist/')\n\t.wrap('dist').at('/')\n\t\t.withConfig({entrypoint = {'/involucro'}... | lua | chosen |
[
{
"from": "system",
"value": "Sort routes in descending order\n\nWas sorting in ascending order earlier\n"
},
{
"from": "human",
"value": "local routespec = ngx.var.request_uri\n\nlocal specs = ngx.shared.routes:get_keys()\n\n-- FIXME: This is a O(nlogn) algorithm for routing, where we\n-- first... | lua | chosen |
[
{
"from": "human",
"value": "Add unit test for lua regexp.\n"
},
{
"from": "gpt",
"value": "context(\"Regexp unit tests\", function()\n local re = require(\"rspamd_regexp\")\n \n test(\"Regexp creation\", function()\n assert_not_nil(re.create_cached('/test$/m'))\n assert_not_nil(re.crea... | lua | chosen |
[
{
"from": "system",
"value": "Refactor InputState -> InputMode in processor\n"
},
{
"from": "human",
"value": "-- Intent: Process inputs by evaluating states \n\nlocal InputModeProcessor = {}\nInputModeProcessor.__index = InputModeProcessor\nInputModeProcessor.ClassName = InputModeProcessor\n\nf... | lua | chosen |
[
{
"from": "system",
"value": "Use local for math floor.\n"
},
{
"from": "human",
"value": "local encode, decode\n\ndo\n local ok, l = pcall(require, 'base64')\n if ok then\n encode = l.encode\n decode = l.decode\n else\n encode = function()\n error('base6... | lua | chosen |
[
{
"from": "system",
"value": "Update Lua sample with header transformations.\n"
},
{
"from": "human",
"value": " function MyPreMiddleware(request, session, spec)\n print(\"MyPreMiddleware, request=\", request, \"session=\", session, \"spec=\", spec)\n tyk.req.set_header(\"myluaheader\", \"myl... | lua | chosen |
[
{
"from": "system",
"value": "Bump release version to v0.0.21\n"
},
{
"from": "human",
"value": "function love.conf(t)\n t.title = \"Journey to the Center of Hawkthorne v0.0.20\"\n t.author = \"Kyle Conroy\"\n t.version = \"0.8.0\"\n\tt.identity ... | lua | chosen |
[
{
"from": "system",
"value": "Remove uneeded variable in nalc mod\n"
},
{
"from": "human",
"value": "local modpath = minetest.get_modpath(minetest.get_current_modname())\n\n-- Custom craftings\ndofile(modpath..\"/crafting.lua\")\n\n-- Custom craftitems\ndofile(modpath..\"/craftitems.lua\")\n\n--... | lua | chosen |
[
{
"from": "system",
"value": "Add note about updating filetype variables\n"
},
{
"from": "human",
"value": "-- Use filetype.lua for performance.\nvim.g.did_load_filetypes = 0\nvim.g.do_filetype_lua = 1\n\nrequire'configurations'\nrequire'mappings'\nrequire'plugins'\nrequire'colorscheme'\n\n-- vi... | lua | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.