Skip to content

Instantly share code, notes, and snippets.

View moshez's full-sized avatar

Moshe Zadka moshez

View GitHub Profile
@moshez
moshez / panda-jump.ipynb
Created June 21, 2020 02:26
Panda Jumping Game
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@moshez
moshez / france-twisted.rst
Last active April 27, 2018 14:47
From France to Twisted

Keybase proof

I hereby claim:

  • I am moshez on github.
  • I am moshez (https://keybase.io/moshez) on keybase.
  • I have a public key whose fingerprint is 892D D96A 0A37 2F5E 7941 9F93 CCA3 ADC2 53AF C674

To claim this, I am signing this object:

def deepdict():
return collections.defaultdict(deepdict)
def deepdictify(tupdict):
res = deepdict()
for key, val in tupdict.items():
tempres = res
for kpart in key[:-1]:
tempres = tempres[kpart]
tempres[key[-1]] = val

Keybase proof

I hereby claim:

  • I am moshez on github.
  • I am moshez (https://keybase.io/moshez) on keybase.
  • I have a public key whose fingerprint is EC9F EF3A C5B1 E856 B3CA ED27 0E46 DCC1 1A77 FCF1

To claim this, I am signing this object:

moshez@mcgyver:~/src/games$ virtualenv forwarner
Running virtualenv with interpreter /usr/bin/python2
New python executable in forwarner/bin/python2
Also creating executable in forwarner/bin/python
Installing setuptools, pip...done.
moshez@mcgyver:~/src/games$ ./forwarner/bin/pip install tox
Downloading/unpacking tox
Downloading tox-2.1.1-py2.py3-none-any.whl
Downloading/unpacking pluggy>=0.3.0,<0.4.0 (from tox)
Downloading pluggy-0.3.0-py2.py3-none-any.whl
Collecting twisted
Using cached Twisted-15.1.0.tar.bz2
Requirement already satisfied (use --upgrade to upgrade): zope.interface>=3.6.0 in ./venv/site-packages (from twisted)
Requirement already satisfied (use --upgrade to upgrade): setuptools in ./venv/site-packages (from zope.interface>=3.6.0->twisted)
Installing collected packages: twisted
Running setup.py install for twisted
Complete output from command /home/moshez/src/pypy-games/venv/bin/pypy -c "import setuptools, tokenize;__file__='/tmp/pip-build-cyqLBs/twisted/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-U2dS1I-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/moshez/src/pypy-games/venv/include/site/python2.7/twisted:
running install
running build
running build_py
from werkzeug.routing import Map, Rule
a=Map(rules=[Rule('/<__rest__>')])
c=a.bind('foo', path_info='/foo/%0A%0D')
c.match()
~
In [18]: from werkzeug.routing import Map, Rule
In [19]: a=Map()
In [20]: b=Rule('/<__rest__>')
In [21]: a.add(b)
In [22]: c=a.bind('foo', path_info='/foo/%0A%0D')
@moshez
moshez / gist:6513b2f55211defcf9f4
Created March 20, 2015 03:10
Patch for thing
(env)moshez@mcgyver:~/src/ncolony$ git diff -r 196c8dd
diff --git a/ncolony/tests/test_ctllib.py b/ncolony/tests/test_ctllib.py
index 5ff4514..b9a24cf 100644
--- a/ncolony/tests/test_ctllib.py
+++ b/ncolony/tests/test_ctllib.py
@@ -70,6 +70,16 @@ class TestArgParsing(unittest.TestCase):
self.assertEquals(res.gid, 6)
self.assertIs(res.func, ctllib.add)
+ def test_port(self):