conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Change cache variable name to fix possible conflicts\n" }, { "from": "human", "value": "require \"paginator\"\n\nfunction get()\n local page = 0\n\n if http.getValues.page ~= nil then\n page = math.floor(tonumber(http.getValues.page) + 0.5)\n end\n\n...
lua
chosen
[ { "from": "system", "value": "Clean up snapshot output format\n" }, { "from": "human", "value": "local jsonStringify = require('json').stringify\nlocal snapshot = require('snapshot')\nlocal i = 0\nlocal S1 = snapshot()\nlocal potential = {}\n\nreturn function (_, res)\n collectgarbage()\n coll...
lua
chosen
[ { "from": "system", "value": "Remove useless export, add manifest version\n" }, { "from": "human", "value": "server_script 'MySqlAsync.net.dll'\nserver_export 'mysql_configure'\nserver_export 'mysql_execute'\nserver_export 'mysql_sync_execute'\nserver_export 'mysql_fetch_all'\nserver_export 'mys...
lua
chosen
[ { "from": "system", "value": "Remove ODLib include and link\n" }, { "from": "human", "value": "project(\"RenHook\")\n kind(\"StaticLib\")\n language(\"C++\")\n pchheader(\"RenHook/RenHook.hpp\")\n pchsource(\"RenHook/RenHook.cpp\")\n\n if buildpath ~= nil then\n targetdir(b...
lua
chosen
[ { "from": "system", "value": "Modify the bug of effect demo level\n" }, { "from": "human", "value": "local gameConfig = require(\"gameConfig\")\nlocal Sublevel = require(\"Sublevel\")\nlocal MyEffect = require(\"levels.myLevel.MyEffect\")\nlocal util = require(\"util\")\nlocal myLevel = Sublevel...
lua
chosen
[ { "from": "system", "value": "Allow passing parameters to coroutine.\n" }, { "from": "human", "value": "-- Copyright (c) 2010-14 Bifrost Entertainment AS and Tommy Nguyen\n-- Distributed under the MIT License.\n-- (See accompanying file LICENSE or copy at http://opensource.org/licenses/MIT)\n\nl...
lua
chosen
[ { "from": "human", "value": "Add a test for mg.send_file\n" }, { "from": "gpt", "value": "-- This test checks if a query string has been given.\r\n-- It sends the file identified by the query string.\r\n-- Do not use it in a real server in this way!\r\n\r\nif not mg.request_info.query_string the...
lua
chosen
[ { "from": "system", "value": "Fix test, which is returning the correct results after all.\n" }, { "from": "human", "value": "local assertEq = test.assertEq\nlocal function log(x) test.log(tostring(x) .. \"\\n\") end\nlocal vi_regex = require('regex.regex')\nlocal compile = vi_regex.compile\n\nlo...
lua
chosen
[ { "from": "human", "value": "Add function to export quad table as valid lua code\n" }, { "from": "gpt", "value": "local QuadExport = {}\n\nlocal function export_quad(filehandle, quadtable)\n\tfilehandle:write(string.format(\n\t\t\"{x = %d, y = %d, w = %d, h = %d}\",\n\t\tquadtable.x, quadtable.y...
lua
chosen
[ { "from": "system", "value": "Refactor screenmon to work better with multiscreen\n" }, { "from": "human", "value": "require 'expandmode'\nrequire 'movemode'\n\nlocal screenmon = nil\nlocal super = {'ctrl', 'alt', 'cmd', 'shift'}\n\nfunction screensChangedCallback()\n local screen1 = hs.screen.a...
lua
chosen
[ { "from": "system", "value": "Clarify that Redis does allow tables to be sent back, but not associative ones.\n" }, { "from": "human", "value": "-- This script needs all active proxies available specified as args.\nlocal insert = table.insert\nlocal call = redis.call\n\nlocal serverToData = {}\n...
lua
chosen
[ { "from": "system", "value": "Set a smaller nozzle (-0.05).\n" }, { "from": "human", "value": "bed_size_x = 210\r\nbed_size_y = 297\r\nbed_size_z = 10\r\nz_offset = 0.0\r\nnozzle_width = -0.2\r\n" }, { "from": "gpt", "value": "bed_size_x = 210\r\nbed_size_y = 297\r\nbed_size_z = 10...
lua
chosen
[ { "from": "system", "value": "Set min sass players to 2 for now" }, { "from": "human", "value": "SS.Lobby.Link = {}\n\n--------------------------------------------------\n--\n--------------------------------------------------\n\nSS.Lobby.Link.MinPlayers = 4\nSS.Lobby.Link.MaxPlayers = 8\n\n-----...
lua
chosen
[ { "from": "system", "value": "Replace the root '/' with '.'\n" }, { "from": "human", "value": "\nlocal _oldRequire = require\nrequire = function(path, ...)\n return _oldRequire(\"source/\" .. path:gsub(\"%/\", \".\"), ...)\nend\n\nrequire \"main\"" }, { "from": "gpt", "value": "\n...
lua
chosen
[ { "from": "system", "value": "Reset painter when drawing a texture\n" }, { "from": "human", "value": "require \"wow/Texture\";\nrequire \"rainback/AnchoredBound\";\nrequire \"rainback/wow-conversion\";\n\nlocal Delegate = OOP.Class();\n\nfunction Delegate:Constructor(frame)\n self.frame = fra...
lua
chosen
[ { "from": "human", "value": "Add a realy basic package to parse Markdown into normal content\n" }, { "from": "gpt", "value": "SILE.processMarkdown = function (content)\n local lunamark = require(\"lunamark\")\n local reader = lunamark.reader.markdown\n local writer = lunamark.writer.ast.new()...
lua
chosen
[ { "from": "human", "value": "Add filter for removing links from headings\n" }, { "from": "gpt", "value": "-- Don't allow links in headings (notably drops auto verse links)\nHeader = function (element)\n return pandoc.walk_block(element, {\n Link = function (element)\n return element...
lua
chosen
[ { "from": "system", "value": "Adjust mic mute so it actually works\n" }, { "from": "human", "value": "local message = require('status-message')\n\nlocal messageMuting = message.new('muted 🎤')\nlocal messageHot = message.new('hot 🎤')\nlocal lastMods = {}\nlocal recentlyClicked = false\nlocal se...
lua
chosen
[ { "from": "system", "value": "Upgrade to Lua 5.3 to use UTF-8, w00t\n" }, { "from": "human", "value": "print(x) -- Does not fail! It's just nil\nprint(#\"café\") -- It's 5, because it counts UTF-8 bytes\n\nif 0 then\n print \"0 is truthy\"\nelse\n print \"0 is falsy\"\nend\n\nfunctio...
lua
chosen
[ { "from": "system", "value": "Make sure to use latest weblit-static\n" }, { "from": "human", "value": "return {\n name = \"luvit/blog.luvit.io\",\n version = \"0.0.2\",\n private = true,\n dependencies = {\n -- hoedown ffi bindings for fast markdown compiling\n \"creationix/hoedown@1.1...
lua
chosen
[ { "from": "system", "value": "Revert \"Make unittest runnable with latest changes.\"\n\nThis reverts commit 79a6ec311ea474f438533123cd1f38de1af64c15.\n" }, { "from": "human", "value": "\nrequire('test.test_luaunit')\nLuaUnit = require('luaunit')\n\nLuaUnit.LuaUnit.verbosity = 2\nos.exit( LuaUnit...
lua
chosen
[ { "from": "system", "value": "Fix VMatrices being garbage collected\n\nThey will still be garbage collected if there is no reference to the SF-type, but they won't if only the reference to the gmod type is missing\n" }, { "from": "human", "value": "-- Credits to Radon & Xandaros\nSF.VMatrix = {}...
lua
chosen
[ { "from": "system", "value": "Change output in weird test\n" }, { "from": "human", "value": "u = {['@!#'] = 'qbert', [{}] = 1729, [6.28] = 'tau'}\nprint(u[6.28]) -- prints \"tau\"\n\n-- Key matching is basically by value for numbers\n-- and strings, but by identity for tables.\na = u['@!#'] --...
lua
chosen
[ { "from": "system", "value": "Add more tests for util/stanza.lua serialization routines\n" }, { "from": "human", "value": "\nfunction deserialize(deserialize, st)\n\tlocal stanza = st.stanza(\"message\", { a = \"a\" });\n\t\n\tlocal stanza2 = deserialize(st.preserialize(stanza));\n\tassert_is(st...
lua
chosen
[ { "from": "system", "value": "Add ability to execute once at render priority\n" }, { "from": "human", "value": "--- Binds animations into step, where the animation only runs as needed\n-- @module StepUtils\n-- @author Quenty\n\nlocal RunService = game:GetService(\"RunService\")\n\nlocal StepUtil...
lua
chosen
[ { "from": "system", "value": "Use narrower margins and no footer frame for pocket size\n" }, { "from": "human", "value": "local book = SILE.require(\"classes/book\");\nbook:loadPackage(\"masters\")\nbook:defineMaster({ id = \"right\", firstContentFrame = \"content\", frames = {\n content = {lef...
lua
chosen
[ { "from": "human", "value": "Make a nice helper function that applies patches\n" }, { "from": "gpt", "value": "dmp = require('src/lua/diff_match_patch')\n\n_G.apply_patch = function(buf_text, patch_text)\n local patches = dmp.patch_fromText(patch_text)\n local text, results = dmp.patch_apply(p...
lua
chosen
[ { "from": "system", "value": "Remove in config file too\n" }, { "from": "human", "value": "audio.open()\naudio.channels(10)\n\naudio.load_chunk('sfx/Pickup_Coin.wav')\naudio.load_chunk('sfx/Jump.wav')\n\naudio.load_music('sfx/FTL soundtrack - ColonialBATTLE.mp3')\n" }, { "from": "gpt", ...
lua
chosen
[ { "from": "system", "value": "MAINT: Allow tests to run for GitHub clones\n\nChange-Id: I3b21aecd557a63fc91cab58e98889888a24319ac\nReviewed-by: Scott Parlane <85029adc3fa41ef14594a57826619713bfe95f25@alliedtelesis.co.nz>\nSigned-off-by: Matt Bennett <e3d8681cec70d3da741935b3385821001b249adc@alliedtelesis.co...
lua
chosen
[ { "from": "system", "value": "Debug source returns nil on cgilua.\n" }, { "from": "human", "value": "package.path = package.path .. ';'..(debug.getinfo(1).source):match('^@?(.-)/index.lua$')..'/../../src/?.lua'\nrequire \"sailor\"\nsailor.launch()\n" }, { "from": "gpt", "value": "pac...
lua
chosen
[ { "from": "system", "value": "Build/NDKServer: Fix dependencies, allowing it to exists in server mode\n\n\nFormer-commit-id: e917ce65aaea2567e4cb261777f458c3ea8ecdad [formerly a2f437b555af173f06b75f78bfe89ee14de7ba9f]\nFormer-commit-id: 83d69a7152c45f02ae5a344c7f8be574cded2318" }, { "from": "human",...
lua
chosen
[ { "from": "human", "value": "Add testing script for vidoe-decoder\n\nTesting script shows how to receive a stream and save as a file in\nbackground.\n" }, { "from": "gpt", "value": "require(\"pl\")\nrequire(\"image\")\nlocal video = assert(require(\"libvideo_decoder\"))\n\n-- Options -----------...
lua
chosen
[ { "from": "system", "value": "Update beautifulsoup4 to install to /home/idhmc/apps\n" }, { "from": "human", "value": "--[[\n\nmodule load gcc python\n\npip install --user --verbose beautifulsoup4==4.3.2\n\n]]\n\nlocal home = os.getenv(\"HOME\")\nlocal prefix = pathJoin(home, \".local\")\nlocal p...
lua
chosen
[ { "from": "system", "value": "Add two to line number margin width." }, { "from": "human", "value": "-- 4 spaces FTW!\nbuffer.tab_width = 4\nbuffer.use_tabs = false\n\n-- Turn on line wrapping:\nbuffer.wrap_mode = buffer.WRAP_WORD\n\n-- Increase font size for GUI:\nbuffer:set_theme(\n 'light',...
lua
chosen
[ { "from": "human", "value": "Print LUX Data Every 10s" }, { "from": "gpt", "value": "-- ***************************************************************************\n-- BH1750 Example Program for ESP8266 with nodeMCU\n-- BH1750 compatible tested 2015-1-30\n--\n-- Written by xiaohu\n--\n-- MIT lic...
lua
chosen
[ { "from": "system", "value": "Update bar characters and enable numhl\n" }, { "from": "human", "value": "local status_ok, gitsigns = pcall(require, \"gitsigns\")\nif not status_ok then\n\treturn\nend\n\ngitsigns.setup()\n" }, { "from": "gpt", "value": "local status_ok, gitsigns = pcal...
lua
chosen
[ { "from": "system", "value": "Remove print that was used for debug.\n" }, { "from": "human", "value": "-- These lines are required to correctly run tests:\nrequire \"cosy.loader.busted\"\nrequire \"busted.runner\" ()\n\nlocal File = require \"cosy.file\"\n\ndescribe (\"Module cosy.file\", functi...
lua
chosen
[ { "from": "system", "value": "Return copy of default body def\n" }, { "from": "human", "value": "module 'mock'\n\nCLASS: PhysicsBodyDef ()\n\t:MODEL{\n\t\tField 'tag' :string();\n\t\t'----';\n\t\tField 'bodyType' :enum( EnumPhysicsBodyType );\n\t\t'----';\n\t\tField 'allowSleep'...
lua
chosen
[ { "from": "system", "value": "Build/Assimp: Fix compilation error because of missing includes\n\n\nFormer-commit-id: dba6d044f3575ad69b03d56aa5a91c22671d97f5 [formerly b7093d6e2a1e21eccbe3ee6bb54265da98c49001]\nFormer-commit-id: d229e251df3032d9d60357fa12276c24eda8db27" }, { "from": "human", "va...
lua
chosen
[ { "from": "system", "value": "Fix lsyncd script to use NBSEARCHDB_BASE_DIR\n" }, { "from": "human", "value": "update_index = {\n\tmaxProcesses = 1,\n\tdelay = 1,\n\tonCreate = \"/opt/nbsearch/update-index ^pathname\",\n\tonModify = \"/opt/nbsearch/update-index ^pathname\",\n\tonMove = \"/op...
lua
chosen
[ { "from": "system", "value": "Store buffer length in a field instead of using the length operator\n" }, { "from": "human", "value": "local Buffer = {}\nBuffer.__index = Buffer\n\nfunction Buffer:write(...)\n local n = #self\n for i = 1, select(\"#\", ...) do\n self[n+i] = select(i, ...
lua
chosen
[ { "from": "system", "value": "Fix load in root 6.0.6 module\n" }, { "from": "human", "value": "help(\n[[\nThis module loads ROOT 6.06-02 with python 3.4 support into the environment. ROOT is a \nphysics analysis application.\n\n]])\n\nwhatis(\"Loads the ROOT data analysis environmemt\")\n\nlocal...
lua
chosen
[ { "from": "system", "value": "Fix number range lutils syntax\n" }, { "from": "human", "value": "---\n-- @module NumberRangeUtils\n-- @author Quenty\n\nlocal require = require(game:GetService(\"ReplicatedStorage\"):WaitForChild(\"Nevermore\"))\n\nlocal NumberRangeUtils = {}\n\nfunction NumberRang...
lua
chosen
[ { "from": "system", "value": "Fix periodic lags caused by xbacklight\n\nSeems like some update broke/changed something that causes xbacklight\nto produce a short screen freeze when called.\nTo work around this issue the brightness value from /sys is used for\npolling.\n" }, { "from": "human", "v...
lua
chosen
[ { "from": "human", "value": "Add devilspie config for desktop terminal\n" }, { "from": "gpt", "value": "if (get_window_role() == \"desktop-term\") then\n set_window_geometry(88,24,1536,1024);\n undecorate_window();\n set_skip_pager(true);\n set_skip_tasklist(true);\n set_window_type(\"...
lua
chosen
[ { "from": "system", "value": "Make prosody send CORS headers\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\"time\";\n\t\t\"pin...
lua
chosen
[ { "from": "human", "value": "Add zmq.poller version of local_thr.lua to perf/ folder.\n" }, { "from": "gpt", "value": "-- Copyright (c) 2010 Aleksey Yeschenko <aleksey@yeschenko.com>\n--\n-- Permission is hereby granted, free of charge, to any person obtaining a copy\n-- of this software and ass...
lua
chosen
[ { "from": "human", "value": "Add missing array-nested-struct-acess test case\n" }, { "from": "gpt", "value": "#! /usr/bin/env lua\n--\n-- array-nested-struct-access.lua\n-- Copyright (C) 2015 Adrian Perez <aperez@igalia.com>\n--\n-- Distributed under terms of the MIT license.\n--\n\nlocal triang...
lua
chosen
[ { "from": "human", "value": "Create - Order Hall Talent Skin" }, { "from": "gpt", "value": "--[[\n##############################################################################\nS V U I By: \t\t\tFailcoder\nOrder Hall Talents By: \tJoeyMagz\n####################################################...
lua
chosen
[ { "from": "system", "value": "Remove message from schedule when queueing\n" }, { "from": "human", "value": "local ns, queue, id, message = ARGV[1], ARGV[2], ARGV[3], ARGV[4]\n\nredis.call('SADD', ns..':queues', queue)\nredis.call('HSET', ns..':'..queue..':messages', id, message)\n\nif redis.call...
lua
chosen
[ { "from": "system", "value": "Add Statsd Logging for Login Success/Failure\n\nAdd Statsd Logging for Login Success/Failure\nAlso revert the Lua Nginx module to version prior to commit that is causing\nrandom test failures\nhttps://gist.github.com/wkimeria/e4d0686194e71eaefcd6\n" }, { "from": "human"...
lua
chosen
[ { "from": "system", "value": "Add a saner coroutine wrapper in the example\n\nChange-Id: I71132ca8b51219a1619a46c9f1e63da9bcacee02\n" }, { "from": "human", "value": "local FS = require('fs');\n\nlocal co\nco = coroutine.create(function (filename)\n\n print(\"opening...\")\n local err, fd = FS....
lua
chosen
[ { "from": "system", "value": "Add two more wrapper tests and placeholders\n\nOne test for wrapping a mono effect and one for a stereo effect.\n" }, { "from": "human", "value": "local wrap = require \"wrap\"\nlocal wrapDefs = wrap.wrapMachineDefs\n\ndescribe(\"Unit definition wrapper\", funct...
lua
chosen
[ { "from": "system", "value": "Update config to not use deprecated nvim-tree options\n" }, { "from": "human", "value": "return function(use)\n use {\n 'kyazdani42/nvim-tree.lua',\n requires = 'kyazdani42/nvim-web-devicons',\n setup = function()\n vim.g.nvim_tree_window_picker_chars...
lua
chosen
[ { "from": "system", "value": "Update LogSoftMaxInPlace to work with THNN\n" }, { "from": "human", "value": "-- Authors: Tomas Kocisky\n--\n-- Customizes the nn.LogSoftMax to be computed inplace\n--\nlocal LogSoftMaxInplace, parent = torch.class('oxnn.LogSoftMaxInplace', 'nn.LogSoftMax')\n\nfunct...
lua
chosen
[ { "from": "system", "value": "Add minimal documentation for hs.sqlite3\n" }, { "from": "human", "value": "module = require(\"hs.sqlite3.lsqlite3\")\nreturn module\n" }, { "from": "gpt", "value": "--- === hs.sqlite3 ==\n---\n--- Interact with SQLite databases\n---\n--- Notes:\n--- * ...
lua
chosen
[ { "from": "system", "value": "CircuitsUI: Fix costs entity name for lamp --> small-lamp\n\n" }, { "from": "human", "value": "data:extend({\n{\n type = \"recipe\",\n name = \"ui-combinator\",\n enabled = true,\n ingredients =\n {\n {\"advanced-circuit\", 5},\n {\"lamp\", ...
lua
chosen
[ { "from": "human", "value": "Add very simple test page (created by Lua)\n" }, { "from": "gpt", "value": "mg.write(\"HTTP/1.0 200 OK\\r\\n\")\r\nmg.write(\"Content-Type: text/html\\r\\n\")\r\nmg.write(\"\\r\\n\")\r\nmg.write([[<html><body><p>\r\nHello world!\r\n</p>\r\n</body></html>\r\n]])\r\n" ...
lua
chosen
[ { "from": "human", "value": " Add Example to yeelink lib" }, { "from": "gpt", "value": "-- ***************************************************************************\n-- Example for Yeelink Lib\n--\n-- Written by Martin\n--\n--\n-- MIT license, http://opensource.org/licenses/MIT\n-- ***********...
lua
chosen
[ { "from": "system", "value": "Increase default timeout for calling letsencrypt.sh to 60 seconds.\n\nThis attempts to workaround potential slowdowns on Let's Encrypt's end\nwithout dropping the initial request while registering the cert.\n\nThe previous default timeout builtin to resty-shell was 15 seconds.\...
lua
chosen
[ { "from": "human", "value": "Add a very basic undo/redo test.\n" }, { "from": "gpt", "value": "test.open('words.txt')\nlocal lineno = test.lineno\nlocal colno = test.colno\nlocal assertEq = test.assertEq\n\ntest.keys('dd')\nassertEq(buffer:get_line(0), 'hey bee cee dee ee eff\\n')\ntest.keys('u'...
lua
chosen
[ { "from": "system", "value": "Add LIMIT to Lua pop server side script" }, { "from": "human", "value": "local queueKey = KEYS[1]\nlocal inFlightKey = KEYS[2]\nlocal freqKey = KEYS[3]\nlocal now = ARGV[1]\n\nlocal payload = nil\n\nlocal not_empty = function(x)\n return (type(x) == 'table') and (n...
lua
chosen
[ { "from": "system", "value": "Fix inverted expected and passed parameter\n" }, { "from": "human", "value": "describe('Test the ini parser', function()\n local ini = require 'ini'\n setup(function()\n end)\n\n it('basic test', function()\n assert.same(ini.parse('a_key = this is...
lua
chosen
[ { "from": "system", "value": "Allow width to be configured by user variables\n" }, { "from": "human", "value": "local gears = require(\"gears\")\nlocal wibox = require(\"wibox\")\nlocal beautiful = require(\"beautiful\")\n\nreturn function(active_color, background_color, icon)\n local bar = w...
lua
chosen
[ { "from": "system", "value": "Add comment for hammerspoon ctrl+alt+cmd+R reload functionality\n" }, { "from": "human", "value": "require 'modules.loader'\n\n-- watches Lua files\n-- provides short-cuts to reload Hammerspoon config\nloader = ModuleLoader()\nloader.addWatcher('init.lua')\n\n-- for...
lua
chosen
[ { "from": "system", "value": "Bump release version to v0.0.10\n" }, { "from": "human", "value": "function love.conf(t)\n t.title = \"Journey to the Center of Hawkthorne v0.0.9\"\n t.author = \"Kyle Conroy\"\n t.version = \"0.8.0\"\n\tt.identity ...
lua
chosen
[ { "from": "system", "value": "Add 'Turn Off All' menubar action for Sandbox-based gamemodes\n" }, { "from": "human", "value": "hook.Add( \"PopulateMenuBar\", \"MediaPlayerOptions_MenuBar\", function( menubar )\n\n\tlocal m = menubar:AddOrGetMenu( \"Media Player\" )\n\n\tm:AddCVar( \"Fullscreen\"...
lua
chosen
[ { "from": "system", "value": "Add more to group utils\n" }, { "from": "human", "value": "---\n-- @module GroupUtils\n-- @author Quenty\n\nlocal require = require(game:GetService(\"ReplicatedStorage\"):WaitForChild(\"Nevermore\"))\n\nlocal Promise = require(\"Promise\")\n\nlocal GroupUtils = {}\n...
lua
chosen
[ { "from": "system", "value": "Load the right version of ROOT\n" }, { "from": "human", "value": "help(\n[[\nThis module loads Python 3.4.1 with a set of packages needed for\nthe Xenon1T PAX 4.6.1\n\n]])\n\nlocal version = \"3.4.1\"\nlocal base = \"/cvmfs/oasis.opensciencegrid.org/osg/modules/virt...
lua
chosen
[ { "from": "system", "value": "Enable the usage of unsafe code in the editor client.\n" }, { "from": "human", "value": "EditorClient = {}\nEditorClient.name = \"Editor.Client\"\n\nproject \"Editor.Client\"\n\n\tkind \"SharedLib\"\n\tlanguage \"C#\"\n\tlocation \".\"\n\t\n\tSetupAddinResources()\n...
lua
chosen
[ { "from": "system", "value": "Set workdir in hammespoon to ~/.hammerspoon\n\ninit.lua can be actually symlinked, making v0.9.80\nfollow symlinks and thus breaking ability to find certain modules\nunder ~/.hammerspoon\n" }, { "from": "human", "value": "require 'modules.loader'\n\n-- watches Lua f...
lua
chosen
[ { "from": "system", "value": "Exit the hello world sample when any key is released\n" }, { "from": "human", "value": "function init()\n\t-- Set the title of the main window\n\tWindow.set_title(\"Hello world!\")\nend\n\nfunction frame(dt)\nend\n\nfunction shutdown()\nend" }, { "from": "gp...
lua
chosen
[ { "from": "system", "value": "Add ability to log output to stdout/stderr instead of files.\n" }, { "from": "human", "value": "local path = require \"pl.path\"\nlocal setup = require \"api-umbrella.cli.setup\"\nlocal status = require \"api-umbrella.cli.status\"\nlocal unistd = require \"posix.uni...
lua
chosen
[ { "from": "system", "value": "Enable console on windows version\n" }, { "from": "human", "value": "function love.conf(t)\n t.name = \"EmuFun\"\n t.author = \"Ben 'ToxicFrog' Kelly\"\n t.identity = \"emufun\"\n t.version = \"0.8.0\"\n\n t.screen.width = 800\n t.screen.height = 6...
lua
chosen
[ { "from": "system", "value": "Fix vim GitFiles to include unstaged files\n" }, { "from": "human", "value": "local fzf_lua = require('fzf-lua')\nfzf_lua.setup({\n fzf_bin = 'sk',\n fzf_opts = {\n ['--layout'] = 'default',\n },\n files = {\n fd_opts = \"--color=never --type f --hidden --...
lua
chosen
[ { "from": "system", "value": "Build: Disable premake project by default\n" }, { "from": "human", "value": "-- This file contains special configurations values, such as directories to extern libraries (Qt)\n-- Editing this file is not required to use/compile the engine, as default values should b...
lua
chosen
[ { "from": "system", "value": "Fix empty drills bug because of moved resource location\n" }, { "from": "human", "value": "--- Location view gui\n\ndata.raw[\"gui-style\"].default[\"lv_location_view\"] =\n{\n type = \"button_style\",\n parent = \"button_style\",\n width = 100,\n height...
lua
chosen
[ { "from": "system", "value": "Add the required defines for Newton in Physics3D" }, { "from": "human", "value": "MODULE.Name = \"Physics3D\"\n\nMODULE.Defines = {\n\t\"_NEWTON_STATIC_LIB\"\n}\n\nMODULE.OsDefines.Windows = {\n\t\"_WINDOWS\"\n}\n\nMODULE.Libraries = {\n\t\"NazaraCore\",\n\t\"newton...
lua
chosen
[ { "from": "system", "value": "Add support for Header title and Body title to function page_set_title().\n" }, { "from": "human", "value": "function page_set_title(title)\n ophal.title = (title and title .. [[ | ]] or [[]]) .. settings.site_name\nend" }, { "from": "gpt", "value": "fu...
lua
chosen
[ { "from": "system", "value": "Use explicit languages to speed up update/install time\n" }, { "from": "human", "value": "require'nvim-treesitter.configs'.setup {\n ensure_installed = \"maintained\",\n highlight = {\n enable = true\n },\n playground = {\n enable = true,\n disable = {}...
lua
chosen
[ { "from": "human", "value": "Add example CC lua file for profiling on a monitor.\n\nSigned-off-by: Ross Allan <ca2c77e14df1e7ee673215c1ef658354e220f471@gmail.com>\n" }, { "from": "gpt", "value": "local monitorSide = \"left\"\r\n\r\nif peripheral.isPresent(monitorSide) and peripheral.getType(moni...
lua
chosen
[ { "from": "system", "value": "Switch to full screen toggle term\n" }, { "from": "human", "value": "require\"toggleterm\".setup{\n size = 20,\n open_mapping = [[<c-s>]],\n shade_terminals = false,\n start_in_insert = true,\n persist_size = true,\n direction = 'horizontal',\n}\n" }, { ...
lua
chosen
[ { "from": "system", "value": "tests: Return a value from packet hooks to silence errors\n" }, { "from": "human", "value": "client_socket( function () print('TRACE:client_socket') end )\nclient_sendmsg( function () print('TRACE:client_sendmsg') end )\nclient_recvmsg( function () print('TRACE:clie...
lua
chosen
[ { "from": "system", "value": "Handle errors when running JavaScript on the sites\n\nIf the Content Security Policy directive is enabled in the site, then\nthe JavaScript detection function cannot be evaluated, and Splash will\nfail with a Lua script error.\n\nBut even if the JavaScript matchers cannot be us...
lua
chosen
[ { "from": "human", "value": "Add a few tests for fs.Q\n" }, { "from": "gpt", "value": "local test_env = require(\"test/test_environment\")\n\ntest_env.unload_luarocks()\nlocal fs = require(\"luarocks.fs\")\nlocal is_win = test_env.TEST_TARGET_OS == \"windows\"\n\ndescribe(\"Luarocks fs test #whi...
lua
chosen
[ { "from": "human", "value": "Add Lua script for test.\n" }, { "from": "gpt", "value": "-- \r\n-- fib.lua\r\n-- test script for mruby-lua.\r\n--\r\n\r\nfunction fib(k)\r\n if k == 0 then\r\n return 0\r\n elseif k == 1 then\r\n return 1\r\n end\r\n return fib(k - 2) + fib(k - 1)\r\nend\r...
lua
chosen
[ { "from": "system", "value": "Fix a tiny typo in hs.pathwatcher 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": "Fix lab and add requires\n" }, { "from": "human", "value": "help(\n[[\nThis module loads Circos 0.68\n\nCircos is a software package for visualizing data and information. It visualizes\ndata in a circular layout — this makes Circos ideal for exploring relationships\...
lua
chosen
[ { "from": "human", "value": "Add example to update descriptor file.\n" }, { "from": "gpt", "value": "-- Update stored copy of descriptors. Include dump.desc-patch.json.\n--\n-- Usage:\n-- rbxmk run --desc-latest update-desc.rbxmk.lua OUTPUT\n\nassert(rbxmk.globalDesc, \"must run with --desc-...
lua
chosen
[ { "from": "system", "value": "Adjust REPL doc test. Passes except for package level help" }, { "from": "human", "value": "require 'dok'\nrequire 'dokx'\n\nlocal tester = torch.Tester()\nlocal myTests = {}\n\nfunction assertHaveDoc(name, symbol)\n local doc = dok.help(symbol, true)\n tester...
lua
chosen
[ { "from": "system", "value": "Fix issue that make configure api return 404 \n\nThe ok and err variable are out of scope when we check for the error, fixed now" }, { "from": "human", "value": "local router = require \"resty.router\"\nlocal r = router:new(\"resty.router.redis_dns\")\n\nlocal metho...
lua
chosen
[ { "from": "system", "value": "Fix stack trace order being reversed\n" }, { "from": "human", "value": "natives[\"java.lang.Throwable\"] = natives[\"java.lang.Throwable\"] or {}\n\nnatives[\"java.lang.Throwable\"][\"fillInStackTrace()Ljava/lang/Throwable;\"] = function(this)\n\tlocal stackTrace = ...
lua
chosen
[ { "from": "system", "value": "Fix typo in prosody config snippet" }, { "from": "human", "value": "disoc_items = {\n\t{ \"upload.yoursite.tld\", \"request slots to upload files via http\"};\n}\n\n\nComponent \"upload.yoursite.tld\"\n\tcomponent_secret = \"yoursecret\"\n" }, { "from": "gpt...
lua
chosen
[ { "from": "human", "value": "Add script to compute PRs git logs to CHANGES.md format\n\nReplace PRlogs_to_RELEASE_format.py with changes.lua\n\nchanges.lua: Add an option to choose remote + set origin as default remote\n\nchanges.lua: Simplify sort\n\nchanges.lua: Fix regex matching author name\n" }, { ...
lua
chosen
[ { "from": "system", "value": "Use full name for rust toolchain\n" }, { "from": "human", "value": "return {\n -- the executable should be named 'rustup-init' or it will not run\n -- complaining that the default toolchain is not set\n source = { 'dist', 'https://static.rust-lang.org/rustu...
lua
chosen
[ { "from": "human", "value": "Add tests for doc parsing" }, { "from": "gpt", "value": "require 'dokx'\n\nlocal tester = torch.Tester()\nlocal myTests = {}\n\nfunction myTests:testParseWhitespace()\n local parser = dokx.createParser(\"dummyPackageName\", \"dummySourceFile\")\n local testInpu...
lua
chosen
[ { "from": "system", "value": "Add \"lib\" folder to lib dirs even in VS to allow ninja builds.\n" }, { "from": "human", "value": "-- Setup the LLVM dependency directories\n\nLLVMRootDir = \"../../deps/llvm/\"\nLLVMBuildDir = \"../../deps/llvm/build/\"\n\n-- TODO: Search for available system depe...
lua
chosen
[ { "from": "system", "value": "Put tab instead of 8 spaces\n" }, { "from": "human", "value": "------------------------------------\n-- Loading dissectors\n------------------------------------\n\n-- We assign ipv4 because we'll need some function\n-- provided by dissector later in a security rule\...
lua
chosen
[ { "from": "system", "value": "Remove ParserLib and use SetupParser() in Generator.Test build script.\n" }, { "from": "human", "value": "project \"CppSharp.Generator.Tests\"\n\n kind \"SharedLib\"\n language \"C#\"\n location \".\"\n\n files { \"**.cs\" }\n \n libdirs \n {\n depsdir .. ...
lua
chosen
[ { "from": "system", "value": "Enhance seed code of Lua.\n" }, { "from": "human", "value": "i = 0\nf()\n\nif i == 0 then\n\tif j ~= 0 then\n\telseif 2 > j then\n\tend\nelseif 1 < i then\nend\n\nwhile i ~= 0 do\n\twhile j == 0 do\n\tend\nend\n\nrepeat\n\trepeat\n\tuntil j ~= 0\nuntil i == 0\n\nfor...
lua
chosen