This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local luaversion = function() | |
if ({false, [1] = true})[1] then -- luacheck: ignore 314 | |
return 'LuaJIT' | |
elseif 1 / 0 == 1 / '-0' then | |
return 0 + '0' .. '' == '0' and 'Lua 5.4' or 'Lua 5.3' | |
end | |
local f = function() return function() end end | |
return f() == f() and 'Lua 5.2' or 'Lua 5.1' | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
curl https://en.wikipedia.org/w/api.php -F format=json -F action=parse -F contentmodel=wikitext -F text='<-' 2> /dev/null | jq -r '.parse.text["*"]' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package = "lua-cmsgpack" | |
version = "0.4.0-0" | |
source = { | |
url = "git://github.com/antirez/lua-cmsgpack.git", | |
tag = "0.4.0" | |
} | |
description = { | |
summary = "MessagePack C implementation and bindings for Lua 5.1/5.2/5.3", | |
homepage = "http://github.com/antirez/lua-cmsgpack", | |
license = "Two-clause BSD", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#compdef _just just | |
#autoload | |
_just() { | |
local -a subcmds | |
subcmds=($(just --summary)) 2> /dev/null || return 1 | |
_describe 'command' subcmds | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
return { | |
servers = { | |
foo = {'127.0.0.1', 9001}, | |
bar = {'127.0.0.1', 9002}, | |
baz = {'127.0.0.1', 9003}, | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
console.log(Array.from(document.querySelectorAll('a[title="Download this torrent using magnet"]')).map(e => e.href).join('\n')) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import print_function, unicode_literals | |
def metaclass(meta): | |
def metaclass_decorator(cls): | |
dct = cls.__dict__.copy() | |
slots = dct.get('__slots__') | |
if slots is not None: | |
if not isinstance(slots, (list, tuple)): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Jira sub-tasks keys | |
// @version 1 | |
// @grant none | |
// @include http://*.atlassian.net/browse/* | |
// @include https://*.atlassian.net/browse/* | |
// ==/UserScript== | |
document.querySelectorAll('#issuetable tr.issuerow').forEach(el => el.insertBefore(document.createElement('td').appendChild(document.createTextNode(el.dataset.issuekey)).parentNode, el.firstChild)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def pytest_collection_modifyitems(items): | |
for item in items: | |
if inspect.iscoroutinefunction(item.function): | |
item.add_marker('asyncio') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from inspect import isfunction, signature, Parameter | |
import pytest | |
def make_fixture(value, scope='function'): | |
if isfunction(value): | |
sig = signature(value) | |
if 'self' in sig.parameters: | |
fixture = lambda self, **fxs: value(self, **fxs) # noqa: E731 |