Skip to content

Instantly share code, notes, and snippets.

Avatar
⚔️
Load average: 233.0

Alphadelta14

⚔️
Load average: 233.0
  • AlphaServ Computing Solutions
  • Massachusetts, USA
View GitHub Profile
@Alphadelta14
Alphadelta14 / certifi-2018.10.15-use-system-cert.patch
Created May 13, 2021
certifi-2018.10.15-use-system-cert.patch
View certifi-2018.10.15-use-system-cert.patch
diff -r -u certifi-2018.10.15.orig/certifi/core.py certifi-2018.10.15/certifi/core.py
--- certifi-2018.10.15.orig/certifi/core.py 2018-01-18 15:27:24.000000000 -0500
+++ certifi-2018.10.15/certifi/core.py 2018-12-13 11:08:30.834151536 -0500
@@ -19,9 +19,7 @@
def where():
- f = os.path.dirname(__file__)
-
- return os.path.join(f, 'cacert.pem')
@Alphadelta14
Alphadelta14 / cyargs.py
Created Apr 12, 2018
Cython breaks passing kwargs to functions with one args
View cyargs.py
from __future__ import print_function
def func_one_arg(a):
print('one arg')
def func_one_kwarg(a=1):
print('one kwarg')
View callback.py
class BoundCondition(ConditionalMixin):
def __init__(self, build=None, suite=None, callback=None):
self.bound_build = build
self.bound_suite = suite
self.bound_callback = callback
ConditionalMixin.__init__(self)
@staticmethod
def build(build_inst):
condition = BoundCondition(build=build_inst)
View entities.out
In [18]: expr
Out[18]: re.compile(r'&(zwnj|aring|gt|yen|ograve|Chi|bull|pound|Egrave|trade|Ntilde|upsih|Yacute|Atilde|radic|otimes|aelig|oelig|equiv|Psi|auml|cup|Epsilon|otilde|Eta|lt|rsquo|Icirc|Eacute|Lambda|yacute|Prime|prime|psi|Kappa|rsaquo|Tau|uacute|sigmaf|lrm|lceil|Alpha|cedil|atilde|theta|not|kappa|AElig|oslash|acute|zwj|laquo|dArr|rdquo|ge|Igrave|hArr|micro|lsaquo|euro|shy|sdot|supe|nbsp|lfloor|lArr|Auml|larr|brvbar|Otilde|szlig|clubs|agrave|Ocirc|ndash|Theta|Pi|OElig|Scaron|thetasym|egrave|sub|iexcl|frac12|ordf|sum|prop|Uuml|ntilde|sup|asymp|uml|prod|nsub|reg|Oslash|THORN|yuml|infin|Mu|le|thinsp|ecirc|bdquo|Sigma|Aring|tilde|nabla|mdash|uarr|permil|tau|Ugrave|fnof|Agrave|chi|forall|circ|eth|rceil|iuml|gamma|lambda|harr|rang|xi|dagger|divide|Ouml|Ograve|image|alefsym|rlm|igrave|Yuml|sube|alpha|frasl|ETH|lowast|Nu|plusmn|Euml|sup1|sup2|frac34|Aacute|cent|oline|Beta|perp|emsp|loz|pi|iota|empty|euml|notin|Upsilon|para|epsilon|Delta|weierp|there4|part|icirc|delta|omicron|upsilon|copy|Iuml|Oacute|Xi|ensp
View test_inline.py
def test_partitioning():
expr = re.compile(r'\*(.*)\*')
children = [docutils.nodes.Text('hello *world* goodbye')]
left, matched, right = inline.re_partition(children, expr)
print(left, matched, right)
assert len(left) == len(right) == 1
assert len(matched) == 2
assert len(matched[0]) == len(matched[1]) == 1
assert left[0] == 'hello '
assert right[0] == ' goodbye'
@Alphadelta14
Alphadelta14 / twitter_oauth.php
Last active Nov 26, 2016
IPS [bad] twitter oauth
View twitter_oauth.php
<?php
/**
* Send Request
*
* @param string $method HTTP Method
* @param string $url URL
* @param array $params Parameters
* @param string $token OAuth Token
* @return \IPS\Http\Response
* @throws \IPS\Http\Request\Exception
We couldn’t find that file to show.
View test_argpasser.py
def test_parseable():
parser = ArgumentPasserParser()
parser.add_optional_bool('-n')
parser.add_optional_bool('--rm')
parser.add_optional_bool('--detach')
parser.add_optional_bool('--interactive')
parser.add_argument('image')
parser.add_argument('command', nargs=argparse.REMAINDER)
args = parser.parse_args(['--interactive',
View docker run.man
DOCKER(1) JUNE 2014 DOCKER(1)
NAME
docker-run - Run a command in a new container
SYNOPSIS
docker run [-a|--attach[=[]]] [--add-host[=[]]]
[--blkio-weight[=[BLKIO-WEIGHT]]] [--blkio-weight-device[=[]]]
[--cpu-shares[=0]] [--cap-add[=[]]] [--cap-drop[=[]]]
[--cgroup-parent[=CGROUP-PATH]] [--cidfile[=CIDFILE]] [--cpu-period[=0]]