conversations listlengths 2 3 | source stringclasses 1 value | stack stringclasses 1 value |
|---|---|---|
[
{
"from": "system",
"value": "Fix empty Redis client in auto HTTPS certificates"
},
{
"from": "human",
"value": "auto_ssl = (require \"resty.auto-ssl\").new()\n\nlocal redis = require \"ceryx.redis\"\nlocal routes = require \"ceryx.routes\"\n\n-- Define a function to determine which SNI domains ... | lua | chosen |
[
{
"from": "system",
"value": "Break nodes for hyphenation, or else it all goes wrong."
},
{
"from": "human",
"value": "SILE.registerCommand(\"thisframeLTR\", function(options, content)\n SILE.typesetter.frame.direction = \"LTR\"\n SILE.typesetter:leaveHmode()\nend);\n\nSILE.registerCommand(\"t... | lua | chosen |
[
{
"from": "system",
"value": "[test] Fix ssl test due library change\n\nDue to the update on the image the ssl library return 0 instead of\nerror.\n\nSigned-off-by: Eloy Coto <2a8acc28452926ceac4d9db555411743254cf5f9@gmail.com>\n"
},
{
"from": "human",
"value": "local _M = require('resty.openssl... | lua | chosen |
[
{
"from": "system",
"value": "Convert xmas attack detection to new rule format\n"
},
{
"from": "human",
"value": "-- Basic test that will output some basic information about the\n-- received packets.\n\nipv4 = require(\"proto-ipv4\")\ntcp = require(\"proto-tcp\")\n\nreturn function(pkt)\n\n\tloc... | lua | chosen |
[
{
"from": "system",
"value": "Add an extra debug message.\n"
},
{
"from": "human",
"value": "if _mpPatch and _mpPatch.loaded and _mpPatch.isModding then\n local playerMap = {}\n _mpPatch.addResetHook(function()\n playerMap = {}\n end)\n\n _mpPatch.addUpdateHook(function(timeDi... | lua | chosen |
[
{
"from": "system",
"value": "Fix to handle nil payload in request data\n\nError below occurs when a rouge request is received from an unknown origin on my network.\r\nHeap: 28320 UPnP: Sent SSDP NOTIFY\r\nPANIC: unprotected error in call to Lua API (/opt/nodemcu-firmware/local/fs/httpd_req.lua:26: b... | lua | chosen |
[
{
"from": "system",
"value": "Switch GetService to use FindFirstChildOfClass instead of FindFirstChild\n"
},
{
"from": "human",
"value": "local BaseInstance = import(\"./BaseInstance\")\n\nlocal Game = BaseInstance:extend(\"DataModel\")\n\nfunction Game:init(instance)\n\t-- Late import here to a... | lua | chosen |
[
{
"from": "human",
"value": "Add simple static file server\n"
},
{
"from": "gpt",
"value": "exports.name = \"creationix/weblit-static\"\nexports.version = \"0.1.0\"\nexports.dependencies = {\n \"creationix/mime@0.1.0\"\n}\n\nlocal getType = require(\"mime\").getType\nlocal jsonStringify = requi... | lua | chosen |
[
{
"from": "system",
"value": "Add a way to remove fences, changed underlaying format\n"
},
{
"from": "human",
"value": "local EffectGroup = {}\nEffectGroup.__index = EffectGroup\nEffectGroup.ClassName = \"EffectGroup\"\n\n-- @author Quenty\n\nfunction EffectGroup.new()\n\tlocal self = {}\n\tsetm... | lua | chosen |
[
{
"from": "system",
"value": "Trim whitespace files and turn off autopairs."
},
{
"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 ... | lua | chosen |
[
{
"from": "human",
"value": "STU-14421: Add script to produce maximum wind parameters\n"
},
{
"from": "gpt",
"value": "--\n-- SmartMet NWC parameters\n--\n-- Create maximum wind speed and maximum wind gust parameters to SNWC \n-- using data from both original snwc and \"edited data\".\n-- \n\nlo... | lua | chosen |
[
{
"from": "human",
"value": "Add new test of ctrl-p in the middle of a word.\n"
},
{
"from": "gpt",
"value": "test.open(\"cmpl1.txt\")\nassertEq = test.assertEq\nassertFileEq = test.assertFileEq\nassertAt = test.assertAt\n\nlocal keys = test.keys\nlocal key = test.key\n\nkeys('2j2l')\nassertAt(2... | lua | chosen |
[
{
"from": "system",
"value": "Add sort handling for manually defined series orders\n"
},
{
"from": "human",
"value": "#!/usr/bin/env lua\n\nlocal yaml = require(\"yaml\")\n\nlocal project = os.getenv(\"PROJECT\")\n\nfunction dump(...)\n local arg = { ... } -- Avoid things that Lua stuffs in arg... | lua | chosen |
[
{
"from": "human",
"value": "Add let for diamond golem aura\n"
},
{
"from": "gpt",
"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 Fou... | lua | chosen |
[
{
"from": "system",
"value": "Add a blocking repl to the executable. TODO: make non-blocking\n\nChange-Id: I36dee78fb8a73b9256706817c0b31fbeabaefa21\n"
},
{
"from": "human",
"value": "function p(first, ...)\n local dump = require('utils').dump\n local l = dump(first)\n for i, v in ipairs{...... | lua | chosen |
[
{
"from": "system",
"value": "Make :data() on an empty Tensor return nil rather than segfault.\n"
},
{
"from": "human",
"value": "if jit then\n\n local ffi = require 'ffi'\n\n local cdefs = [[\ntypedef struct THCudaStorage\n{\n float *data;\n long size;\n int refcount;\n char fla... | lua | chosen |
[
{
"from": "system",
"value": "Remove deprecated Premake flags from build scripts.\n"
},
{
"from": "human",
"value": "clang_msvc_flags =\n{\n \"/wd4146\", \"/wd4244\", \"/wd4800\", \"/wd4345\",\n \"/wd4355\", \"/wd4996\", \"/wd4624\", \"/wd4291\",\n \"/wd4251\"\n}\n\nif not (string.starts(acti... | lua | chosen |
[
{
"from": "system",
"value": "Allow separation of lua configurations into distinct files"
},
{
"from": "human",
"value": "-- Auto-reload configuration if any file inside the hammerspoon directory has changed\nhs.pathwatcher.new(os.getenv(\"HOME\") .. \"/.hammerspoon/\", function()\n hs.alert.... | lua | chosen |
[
{
"from": "system",
"value": "Make redshift start around 8pm\n"
},
{
"from": "human",
"value": "require 'modules.autoloader'\n\n-- watches Lua files\n-- provides short-cuts to reload Hammerspoon config\nautoloader = Autoloader()\n\n-- for all notifications and messaging needs\nmessenger = autolo... | lua | chosen |
[
{
"from": "system",
"value": "style(backends): Normalize whitespace across backends for easier diffing\n"
},
{
"from": "human",
"value": "if (not SILE.outputters) then SILE.outputters = {} end\n\nlocal dummy = function() end\n\nSILE.outputters.dummy = {\n init = dummy,\n newPage = dummy,\n fi... | lua | chosen |
[
{
"from": "system",
"value": "chore(tooling): Enable direct invocation of busted with limit tests\n"
},
{
"from": "human",
"value": "SILE = require(\"core/sile\")\nSILE.backend = \"debug\"\nSILE.init()\n\ndescribe(\"The OpenType loader/parser\", function()\n local ot = SILE.require(\"core/opent... | lua | chosen |
[
{
"from": "system",
"value": "Return 500 when adding upstream fails"
},
{
"from": "human",
"value": "local router = require \"resty.router\"\nlocal r = router:new(\"resty.router.redis_dns\")\n\nlocal method = ngx.req.get_method()\nif method == ngx.HTTP_GET then\n local ok, err = r:set_route(ngx... | lua | chosen |
[
{
"from": "system",
"value": "Fix consequence for gem crafting\n"
},
{
"from": "human",
"value": "require(\"base.class\")\nrequire(\"npc.base.consequence.consequence\")\nrequire(\"item.gems\")\n\nmodule(\"npc.base.consequence.gemcraft\", package.seeall)\n\ngemcraft = base.class.class(npc.base.co... | lua | chosen |
[
{
"from": "system",
"value": "Return after error in tests\n"
},
{
"from": "human",
"value": "local jcd = shell.resolve(fs.combine(fs.getDir(shell.getRunningProgram()), \"..\"))\nlocal program = fs.combine(jcd, \"bin/jvml\")\nlocal tests = fs.combine(jcd, \"tests/build\")\n\nshell.run(program, \"... | lua | chosen |
[
{
"from": "system",
"value": "Allow modules to override the page title given by the path handler.\n"
},
{
"from": "human",
"value": "function menu_get_handler()\n local paths, a, handler = ophal.paths\n local path_tree = sanitize_path()\n for i = 1,#path_tree do\n a = #path_tree - (i - 1) ... | lua | chosen |
[
{
"from": "system",
"value": "Remove double calling module.start -- was used for debugging\n"
},
{
"from": "human",
"value": "-- file: setup.lua\nlocal module = {}\n\nlocal function wifi_wait_ip()\n if wifi.sta.getip()== nil then\n print(\"IP unavailable, Waiting...\")\n else\n tmr.stop(... | lua | chosen |
[
{
"from": "system",
"value": "Allow port setting via env\n"
},
{
"from": "human",
"value": "local pathJoin = require('luvi').path.join\nlocal static = require('weblit-static')\nlocal blog = require('controllers/blog')\n\nrequire('weblit-app')\n\n .bind({host = \"0.0.0.0\", port = 8080})\n\n --... | lua | chosen |
[
{
"from": "system",
"value": "Add LCUI link if os is windows\n"
},
{
"from": "human",
"value": "-- lcui.css \nset_project(\"lcui.css\")\n\n-- xmake minver\nset_xmakever(\"2.1.6\")\n\n-- the debug mode\nif is_mode(\"debug\") then\n \n -- enable the debug symbols\n set_symbols(\"debug\")\... | lua | chosen |
[
{
"from": "system",
"value": "Fix the custom module example\n"
},
{
"from": "human",
"value": "local apicast = require('apicast')\n\nlocal _M = { _VERSION = '0.0' }\nlocal mt = { __index = apicast }\n\nfunction _M.log()\n ngx.log(ngx.WARN,\n 'upstream response time: ', ngx.var.upstream_respo... | lua | chosen |
[
{
"from": "human",
"value": "Add listener for sms messages on FCEUX\n"
},
{
"from": "gpt",
"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 read_file (filena... | lua | chosen |
[
{
"from": "system",
"value": "Use identity for comparison when possible\n\nThere's no need to recursively compare tables when we know\nthat they are the same identity-wise. It saves us some work,\nbut what's more it also makes it usable for tables containing\nLuaJIT cdata. Deep comparing such tables will al... | lua | chosen |
[
{
"from": "system",
"value": "Remove unintentional addition of claim_name to example_relay\n\nI accidently left a claim_name from when I was debugging, this commit\nremoves that. Oops!\n"
},
{
"from": "human",
"value": "-- Use of this source code is governed by the Apache 2.0 license; see COPYIN... | lua | chosen |
[
{
"from": "system",
"value": "Replace external crc32 utility by internal one\n"
},
{
"from": "human",
"value": "\n---------------------------------------------------------------------------------------------------\n-- Common module\n---------------------------------------------------------------... | lua | chosen |
[
{
"from": "system",
"value": "Handle errors when loading the client entry file\n"
},
{
"from": "human",
"value": "\n-- Copyright (C) 2016 Luke San Antonio\n-- All rights reserved.\n\nlocal rc = require(\"redcrane\")\n\nlocal server_mode, sandbox = ...\n\nif server_mode == \"dedicated\" then\n r... | lua | chosen |
[
{
"from": "human",
"value": "Add lua outline of a job\n"
},
{
"from": "gpt",
"value": "--[[\n This section will most likely be written in C and simply exposed to the scripts\n]]--\nfunction inheritsFrom( baseClass )\n -- http://lua-users.org/wiki/InheritanceTutorial\n local new_class = ... | lua | chosen |
[
{
"from": "system",
"value": "Update runtime run once example.\n"
},
{
"from": "human",
"value": "--[[\n Copyright 2018 The Nakama Authors\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a c... | lua | chosen |
[
{
"from": "system",
"value": "Set server log to console in heroku.\n"
},
{
"from": "human",
"value": "local Lfs = require \"lfs\"\nlocal Lustache = require \"lustache\"\nlocal Colors = require 'ansicolors'\nlocal Arguments = require \"argparse\"\nlocal Serpent = require \"serpent\"\n... | lua | chosen |
[
{
"from": "human",
"value": "Add proxy script for nginx\n"
},
{
"from": "gpt",
"value": "---------\n-- Proxy script for OAuth 2.0.\n\nlocal config = require 'ngx-oauth.config'\nlocal Cookies = require 'ngx-oauth.Cookies'\nlocal ethr = require 'ngx-oauth.either'\nlocal nginx = require 'ngx-... | lua | chosen |
[
{
"from": "system",
"value": "Build/Assimp: Fix compilation error because of missing includes\n\n\nFormer-commit-id: b13f32ba6a53da69c8243425ca19766c96b97d26 [formerly 66000790be4f8ebe750ebe0d241f764b668278a1]\nFormer-commit-id: 1da2a2b75eb42f118a1b843463fe715bd5fbabb0"
},
{
"from": "human",
"va... | lua | chosen |
[
{
"from": "system",
"value": "Use new set command generation for nocrash test\n\nAnd bump test duration\n"
},
{
"from": "human",
"value": "#!/usr/bin/env luajit\nmodule(..., package.seeall)\n\nlocal genyang = require(\"program.lwaftr.tests.propbased.genyang\")\nlocal common = require(\"program.... | lua | chosen |
[
{
"from": "system",
"value": "Fix police default cloak issues\n"
},
{
"from": "human",
"value": "\n-- this file configure the cloakrooms on the map\n\nlocal cfg = {}\n\n-- cloakroom types (_config, map of name => customization)\ncfg.cloakroom_types = {\n [\"police\"] = {\n _config = { permis... | lua | chosen |
[
{
"from": "system",
"value": "Add a sleep time for my powerful iMac\n"
},
{
"from": "human",
"value": "-- client to connect to telnet\nhost = 'localhost'\nport = 4000\ntimeout = 0.001\n\nlocal socket = require 'socket'\n\nfunction client_connect(port)\n\tclient = assert(socket.connect(host, port... | lua | chosen |
[
{
"from": "system",
"value": "hs: Rephrase hotkey message on Redshift\n"
},
{
"from": "human",
"value": "-- Redshift menubar\nlocal Redshift = {\n menubar = hs.menubar.new(),\n active = false,\n temperature = 2700,\n start = \"20:00\",\n stop = \"08:00\",\n fade = \"2h\",\n ... | lua | chosen |
[
{
"from": "system",
"value": "Fix Lua comment, we want nil, not undefined\n"
},
{
"from": "human",
"value": "a, b = 5, 6, 7 -- extra results ignored\nc, d, e, f = 5, 6, 7 -- extra vars get undefined\n\nassert(a == 5 and b == 6)\nassert(c == 5 and d == 6 and e == 7 and f == nil)\n"
... | lua | chosen |
[
{
"from": "system",
"value": "Return failures from audio.load instead of printing them\n"
},
{
"from": "human",
"value": "\nlocal ffi = require 'ffi'\n\nlocal audio = {}\n\naudio.loaders = {}\n\nfunction audio.load(path)\n\tfor i, loader in ipairs(audio.loaders) do\n\t\tlocal attempt, message = ... | lua | chosen |
[
{
"from": "system",
"value": "Fix twig commenting for treesitter\n"
},
{
"from": "human",
"value": "-- Load emmet HTML quickwrite plugin.\nvim.cmd('packadd emmet-vim')\n\n-- Add twig pattern files to path to be able to configure below. Enables `gf`\n-- on include to jump to that file. MSK specif... | lua | chosen |
[
{
"from": "system",
"value": "Remove unnecessary reference to ARP thread.\n"
},
{
"from": "human",
"value": "local arp = require \"proto.arp\"\nlocal arpThread = require \"threads.arp\"\n\nlocal dependency = {}\n\nfunction dependency.env(env)\n\tfunction env.arp(ip, fallback, timeout)\n\t\tretur... | lua | chosen |
[
{
"from": "human",
"value": "Add create and read functions\n"
},
{
"from": "gpt",
"value": "\n-- Array of guests list and its length\nguests = { }\nguestsLen = 0\n\n-- Create a new guest, add it to list and update the size number.\n-- PARAM\n-- name : string complete guest name\n-- cpf : stri... | lua | chosen |
[
{
"from": "human",
"value": "Add simple port of Gtk clipboard Vala sample\n"
},
{
"from": "gpt",
"value": "#! /usr/bin/env lua\n\n-- Gtk clipboard sample, adapted from Vala clipboard sample at\n-- http://live.gnome.org/Vala/GTKSample#Clipboard\n\nlocal lgi = require 'lgi'\nlocal Gtk = lgi.Gtk\nl... | lua | chosen |
[
{
"from": "human",
"value": "Add script to produce precipitation phase ie. 'Koistisen kaava'\n"
},
{
"from": "gpt",
"value": "--\n-- Probability of precipitation phase P(W) given 2 meter temperature (C) and relative humidity (%).\n--\n-- Algorithm is a statistical fitting between conventional ob... | lua | chosen |
[
{
"from": "system",
"value": "Add scheduled scripts for enabling different Bennu trails\n"
},
{
"from": "human",
"value": "return \n{\n\t{\n\t\tTime = \"2016 SEP 08 23:10:13\",\n\t\tReversibleLuaScript = {\n\t\t\tForward = \"openspace.printInfo('forward test 1');\",\n\t\t\tBackward = \"openspace... | lua | chosen |
[
{
"from": "human",
"value": "Add an example configuration file for token introspection.\n"
},
{
"from": "gpt",
"value": "local policy_chain = require('apicast.policy_chain').default()\n\nlocal token_policy = require('apicast.policy.token_introspection').new({\n introspection_url = \"http:... | lua | chosen |
[
{
"from": "human",
"value": "Add an example for authorization required server\n"
},
{
"from": "gpt",
"value": "package.path = '../src/?.lua;src/?.lua;' .. package.path\npcall(require, 'luarocks.require')\n\nlocal nats = require 'nats'\n\nlocal params = {\n host = '127.0.0.1',\n port = 4222... | lua | chosen |
[
{
"from": "system",
"value": "Add function for generating invalid but seemingly close addend pairs for given number\n"
},
{
"from": "human",
"value": "function gen_addend_pairs(x)\n local ps = {}\n for i=1,x/2 do\n local p = {i, x-i}\n table.insert(ps, p)\n end\n return ps\nend\n\n--t ... | lua | chosen |
[
{
"from": "system",
"value": "Add default make command for Laravel projects\n"
},
{
"from": "human",
"value": "vim.g.projectionist_heuristics = {\n artisan = {\n ['*'] = {\n start = 'sail up',\n console = 'sail tinker',\n },\n ['app/Models/*.php'] = {\n type = 'model',\n... | lua | chosen |
[
{
"from": "system",
"value": "Fix the build for the build agent"
},
{
"from": "human",
"value": "assert(os.getenv(\"SOURCE_SDK\"), \"SOURCE_SDK environmental variable not set\")\n\nlocal SOURCE_SDK = os.getenv(\"SOURCE_SDK\") .. \"/mp/src\"\n\nsolution \"gm_stringtable\"\n\tlanguage \"C++\"\n\tl... | lua | chosen |
[
{
"from": "system",
"value": "Fix reversed boolean logic with Game.print_all\n"
},
{
"from": "human",
"value": "--- Game module\n-- @module game\n\nGame = {}\n\n--- Messages all players currently connected to the game\n-- @param msg message to send to players\n-- @param condition (optional) opti... | lua | chosen |
[
{
"from": "human",
"value": "Add some OpenGL Lua binding\n"
},
{
"from": "gpt",
"value": "local ffi = require 'ffi'\n\nffi.cdef [[\nenum {\n GL_DEPTH_BUFFER_BIT = 0x00000100,\n GL_STENCIL_BUFFER_BIT = 0x00000400,\n GL_COLOR_BUFFER_BIT = 0x00004000... | lua | chosen |
[
{
"from": "system",
"value": "Add check on Lua version to avoid silly failures.\n"
},
{
"from": "human",
"value": "-- Select the platform using the environment.\n\nif _G.js then\n return require \"cosy.platform.js\"\nelse\n return require \"cosy.platform.standalone\"\nend\n\n-- > local pla... | lua | chosen |
[
{
"from": "system",
"value": "Implement Build task - first draft\n"
},
{
"from": "human",
"value": "module(\"lunaci.tasks.build\", package.seeall)\n\nmath.randomseed(os.time())\n\n\n-- Dummy random placeholder task implementation.\nlocal build_package = function(package, target, manifest)\n l... | lua | chosen |
[
{
"from": "system",
"value": "Use the Final Cut Pro Trial Bundle ID if the trial is running on startup\n\n- Closes #3004\n"
},
{
"from": "human",
"value": "--- === cp.apple.finalcutpro.app ===\n---\n--- The [cp.app](cp.app.md) for Final Cut Pro. Will automatically determine\n--- if only the tria... | lua | chosen |
[
{
"from": "system",
"value": "Disable pause menu when using the input function\n"
},
{
"from": "human",
"value": "--DiskOS API Loader\n\nlocal Globals = (...) or {}\n\nGlobals.SpriteGroup = SpriteGroup\nGlobals.isInRect = isInRect\nGlobals.whereInGrid = whereInGrid\nGlobals.input = TextUtils.tex... | lua | chosen |
[
{
"from": "system",
"value": "Add an end-of-line after writing a file.\n"
},
{
"from": "human",
"value": "return function (loader)\n\n local Value = loader.load \"cosy.value\"\n\n local File = {}\n\n function File.encode (filname, data)\n local file, err = io.open (filname, \"w\")\n if ... | lua | chosen |
[
{
"from": "human",
"value": "test: Add unit tests to cover combineLatest\n"
},
{
"from": "gpt",
"value": "---\n-- @module RxInstanceUtils.spec.lua\n\nlocal require = require(game:GetService(\"ServerScriptService\"):FindFirstChild(\"LoaderUtils\", true).Parent).load(script)\n\nlocal RxInstanceUti... | lua | chosen |
[
{
"from": "system",
"value": "Change the CLI version to show (d|r)> as part of the prompt, not the stack output.\n"
},
{
"from": "human",
"value": "#!/usr/bin/env lua\n\n-- over-ride or define stubs for functions\nstrfind = string.find\nstrsub = string.sub\n\n\nfunction GetAddOnMetadata( )\n\tre... | lua | chosen |
[
{
"from": "system",
"value": "Correct check for whether __eq is applicable\n\nFor that to happen, both objects metatable need to be same, one\ntable having a metatable with __eq is not enough.\n"
},
{
"from": "human",
"value": "local util = {}\nfunction util.deepcompare(t1,t2,ignore_mt)\n local... | lua | chosen |
[
{
"from": "human",
"value": "Add torch gated negation network example.\n"
},
{
"from": "gpt",
"value": "local nn = require \"nn\"\nlocal nngraph = require \"nngraph\"\n\n-- set gated network hyperparameters\nlocal opt = {}\nopt.embedSize = 10\nopt.gateSize = 15\nopt.hiddenSize = 5\n\n-- define g... | lua | chosen |
[
{
"from": "system",
"value": "Change the default custom plugins path to\n/usr/lib/rackspace-monitoring-agent/plugins.\n"
},
{
"from": "human",
"value": "local os = require('os')\nlocal path = require('path')\n\nlocal exports = {}\n\n-- All intervals and timeouts are in milliseconds\n\nexports.CO... | lua | chosen |
[
{
"from": "system",
"value": "nvim: Add helper function to ignore dirs in fzy\n"
},
{
"from": "human",
"value": "local cmd = vim.cmd\nlocal map = vim.api.nvim_set_keymap\n\n-- map the leader key\nmap('n', '<Space>', '', {})\nvim.g.mapleader = ' '\n\n\noptions = { noremap = true }\nmap('n', '<lea... | lua | chosen |
[
{
"from": "system",
"value": "Hide errors when running tests and floaterm isn't already open\n"
},
{
"from": "human",
"value": "local keymap = require('lib.utils').keymap\n\nkeymap('n', '<Leader>tn', ':TestNearest<CR>', { silent = false })\nkeymap('n', '<Leader>tf', ':TestFile<CR>', { silent = f... | lua | chosen |
[
{
"from": "system",
"value": "Fix :IsDone() on debounce timer\n"
},
{
"from": "human",
"value": "--- DebounceTimer\n-- @classmod DebounceTimer\n\nlocal DebounceTimer = {}\nDebounceTimer.ClassName = \"DebounceTimer\"\nDebounceTimer.__index = DebounceTimer\n\nfunction DebounceTimer.new(length)\n\t... | lua | chosen |
[
{
"from": "system",
"value": "Fix error in date format\n"
},
{
"from": "human",
"value": "local topics = {}\n\nfunction topics.run()\n print('weekly topic identified')\n local topics = {\n ['August 26, 2018'] = \"**The Weird Things Allosexuals Do**\" .. newline ..\n \"What things do al... | lua | chosen |
[
{
"from": "system",
"value": "Add more debugging to the coro example\n"
},
{
"from": "human",
"value": "local uv = require('uv');\n\nlocal co = coroutine.create(function (filename) \n \n uv.fs_open(filename, 'r', \"0644\", resume)\n local fd = coroutine.yield()\n p(\"on_open\", {fd=fd})\n\n ... | lua | chosen |
[
{
"from": "system",
"value": "Fix the camera slightly bobbing along to the character\n\nThe character's PrimaryPart (its head) is animated, along with the rest of\nthe body, making the camera bob up and down slightly when the \"breathing\"\nanimation is playing.\n\nIt's hardly noticable, but definitly needs... | lua | chosen |
[
{
"from": "system",
"value": "Replace 'global' by 'window' in JS code.\n"
},
{
"from": "human",
"value": "-- Utilities to load Lua packages\n-- ==============================\n\njs.global:eval [[\n global.load = function (url) {\n var xhr = new XMLHttpRequest ();\n xhr.open (\"GET\", url,... | lua | chosen |
[
{
"from": "system",
"value": "Fix the :e test to take account of the escaping of \".\".\n"
},
{
"from": "human",
"value": "-- Test :e\ntest.keys(':e files/foo.xml')\ntest.key('enter')\n\ntest.assertEq(buffer.filename, 'files/foo.xml')\n\n-- test completion\ntest.keys(':e files/1_1')\ntest.key('t... | lua | chosen |
[
{
"from": "system",
"value": "Expand characters to ^N as appropriate\n"
},
{
"from": "human",
"value": "\nfunction on_key(k)\n if ( string.byte(k) == 1 ) then\n sol()\n elseif ( string.byte(k) == 5 ) then\n eol()\n else\n insert(k)\n end\nend\n\n\n--\n-- Called at load-tim... | lua | chosen |
[
{
"from": "system",
"value": "Use 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.5.0\n\n]])\n\nlocal version = \"3.4.1\"\nlocal base = \"/cvmfs/oasis.opensciencegrid.org/osg/modules/virtualen... | lua | chosen |
[
{
"from": "system",
"value": "Disable rootfs install in hi-sdk\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 { 'tools' },\n { 'prepare',\n ... | lua | chosen |
[
{
"from": "system",
"value": "Use custom keystroke fn to trigger esc faster after ctrl tap\n"
},
{
"from": "human",
"value": "-- Credit for this implementation goes to @arbelt and @jasoncodes 🙇⚡️😻\n--\n-- https://gist.github.com/arbelt/b91e1f38a0880afb316dd5b5732759f1\n-- https://github.co... | lua | chosen |
[
{
"from": "system",
"value": "Use a keymap for keybindings.\n\nThis is cleaner and neater.\n"
},
{
"from": "human",
"value": "\nfunction on_key(k)\n\n --\n -- Expand values less than \"a\" to be Ctrl-X.\n --\n if ( string.byte(k) < string.byte('a') ) then\n k = \"^\" .. ( string.cha... | lua | chosen |
[
{
"from": "system",
"value": "hs: Disable redshift since it's been added to OSX\n"
},
{
"from": "human",
"value": "-- install cli\nif not hs.ipc.cliStatus() then\n hs.ipc.cliInstall()\nend\n\n-- leader\nhs.settings.set('leader', {'ctrl', 'alt'})\nhs.settings.set('leadercmd', {'ctrl', '... | lua | chosen |
[
{
"from": "system",
"value": "net.http: Remove request from conn->request table when conn closed\n"
},
{
"from": "human",
"value": "\nlocal connlisteners_register = require \"net.connlisteners\".register;\n\n\nlocal requests = {}; -- Open requests\nlocal buffers = {}; -- Buffers of partial lines... | lua | chosen |
[
{
"from": "system",
"value": "Use a lower randomseed to work around potential platform limitations set by lua.\n"
},
{
"from": "human",
"value": "local ltrim = function(r, s)\n\tif s == nil then\n\t\ts, r = r, \"%s+\"\n\tend\n\treturn (string.gsub(s, \"^\" .. r, \"\"))\nend\n\nlocal reply = {\n\... | lua | chosen |
[
{
"from": "system",
"value": "Remove coroutine from player env\n"
},
{
"from": "human",
"value": "local T = {}\n\nlocal function shallow_copy(tbl)\n local new_tbl = {}\n for k, v in pairs(tbl) do\n new_tbl[k] = v\n end\n return new_tbl\nend\n\nlocal env = {\n print=print, -... | lua | chosen |
[
{
"from": "system",
"value": "Fix error in getting restrictions\n"
},
{
"from": "human",
"value": "local module = {}\n\nlocal mp = require 'MessagePack'\n\nlocal log = ngx.log\nlocal ERR = ngx.ERR\nlocal INFO = ngx.INFO\nlocal json = require 'cjson.safe'\n\nmodule.console = {}\n\nfunction module... | lua | chosen |
[
{
"from": "human",
"value": "Convert XC to apicast module\n"
},
{
"from": "gpt",
"value": "local xc = require 'xc/xc'\n\nlocal _M = require 'apicast'\n\nfunction _M.access()\n local request = ngx.var.request\n local service = ngx.ctx.service\n local credentials = service:extract_credentials(r... | lua | chosen |
[
{
"from": "human",
"value": "Solve Simple Calculate in lua\n"
},
{
"from": "gpt",
"value": "local s = 0\nwhile true do\n local line = io.read()\n\n if line == nil then break end\n\n for b, c in string.gmatch(line, \"%d+ (%d+) ([0-9.]+)\") do\n s = s + tonumber(b) * (tonumber(c) +... | lua | chosen |
[
{
"from": "system",
"value": "Allow raycaster to be injected\n"
},
{
"from": "human",
"value": "--- Identify parts that are potentially exposed to an explosion using a random vector raycasting\n-- @module GetPercentExposed\n\nlocal require = require(game:GetService(\"ReplicatedStorage\"):WaitFor... | lua | chosen |
[
{
"from": "human",
"value": "Add new held rate key class\n"
},
{
"from": "gpt",
"value": "local RunService = game:GetService(\"RunService\")\n\nlocal HeldRateInput = {}\nHeldRateInput.__index = HeldRateInput\nHeldRateInput.ClassName = \"HeldRateInput\"\nHeldRateInput.Rate = 0.25\nHeldRateInput.A... | lua | chosen |
[
{
"from": "human",
"value": "Add lte for lich death\n"
},
{
"from": "gpt",
"value": "-- Turns a weakened lich back to a normal one\n\nmodule(\"lte.weakenedLich\", package.seeall)\n\nfunction addEffect(theEffect, weakendLich) \t\t\t\t\n\nend\n\nfunction callEffect(theEffect, weakend... | lua | chosen |
[
{
"from": "system",
"value": "Use just x86 architecture for Capstone\n"
},
{
"from": "human",
"value": "project(\"Capstone\")\n defines({ \"CAPSTONE_X86_ATT_DISABLE_NO\", \"CAPSTONE_DIET_NO\", \"CAPSTONE_X86_REDUCE_NO\", \"CAPSTONE_HAS_ARM\", \"CAPSTONE_HAS_ARM64\", \"CAPSTONE_HAS_MIPS\", \"C... | lua | chosen |
[
{
"from": "system",
"value": "Add namespace to i18n messages.\n"
},
{
"from": "human",
"value": "return {\n available_dependency = \"%{component} is available using '%{dependency}'\",\n missing_dependency = \"%{component} is not available\",\n available_locale = \"i18n locale '%{loca... | lua | chosen |
[
{
"from": "system",
"value": "Add more 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": "system",
"value": "Revert \"Enable vRP world VoIP by default.\"\n\nThis reverts commit dbec797cbd0d9c2728e9f214bdc9f33ec825c0c7.\n"
},
{
"from": "human",
"value": "\nlocal cfg = {}\n\n-- VoIP\n\n-- VoIP websocket server\ncfg.voip_server = \"ws://localhost:40120\"\n\n-- VoIP Opus param... | lua | chosen |
[
{
"from": "system",
"value": "Add a test for completing files in current directory.\n"
},
{
"from": "human",
"value": "-- Test :e\ntest.keys(':e files/foo.xml')\ntest.key('enter')\n\ntest.assertFileEq(buffer.filename, 'files/foo.xml')\n\n-- test completion\ntest.keys(':e files/1_1')\ntest.key('t... | lua | chosen |
[
{
"from": "system",
"value": "Allow adapters to have a setup callback for the init_by_worker_phase.\n"
},
{
"from": "human",
"value": "local start_sockproc = require \"resty.auto-ssl.utils.start_sockproc\"\n\nreturn function()\n -- Startup sockproc. This background process allows for non-blocki... | lua | chosen |
[
{
"from": "human",
"value": "STU-14421: Copy certain parameters from smartmet data\n"
},
{
"from": "gpt",
"value": "--\n-- SmartMet NWC parameters\n--\n-- Copy certain set of parameters from Smartmet data so that they\n-- look like created from NWC (same analysis time etc)\n-- \n\nlocal MISS = m... | lua | chosen |
[
{
"from": "system",
"value": "Physics: Add new libraries for Windows\n\nFormer-commit-id: 93deb21045e66e786819066593dad466e7ce9742"
},
{
"from": "human",
"value": "MODULE.Name = \"Physics\"\n\nMODULE.Libraries = {\n\t\"NazaraCore\",\n\t\"newton\"\n}\n"
},
{
"from": "gpt",
"value": "M... | lua | chosen |
[
{
"from": "system",
"value": "Add start and select keybinds\n"
},
{
"from": "human",
"value": "-- An example script which allows playing via normal keyboard controls.\n-- Use the arrow keys to move, Z is A, X is B and S and A are save and load\n-- state respectively. The current measured FPS wil... | lua | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.