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 get_basename = function(path) | |
return path:match('/([^/]*)$') or path | |
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
from http.client import HTTPResponse | |
import urllib.parse | |
import asyncio | |
import json | |
import sys | |
import io | |
class FakeSocket: |
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 |
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
// ==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
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
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
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
#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
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", |