Skip to content

Instantly share code, notes, and snippets.

View dazza-codes's full-sized avatar

Darren Weber dazza-codes

View GitHub Profile
@mmellison
mmellison / grpc_asyncio.py
Last active April 3, 2024 15:48
gRPC Servicer with Asyncio (Python 3.6+)
import asyncio
from concurrent import futures
import functools
import inspect
import threading
from grpc import _server
def _loop_mgr(loop: asyncio.AbstractEventLoop):
@sgillies
sgillies / benchmark.py
Last active February 7, 2019 01:02
GeoJSON: json vs msgpack vs shapely.wkb vs geobuf
# Comparing serialization of complex GeoJSON geometries using:
#
# - standard lib json, marshal, pickle, cPickle
# - umsgpack
# - shapely.wkb
# - geobuf (protobuf)
#
# The test case is a nearly circular polygon with 128 vertices.
#
# Python 2.7 because geobuf isn't possible on Python 3 (because
## install pyenv on ds dev cluster
yum -y install git gcc readline-devel zlib-devel bzip2-devel sqlite-devel openssl-devel
git clone git://github.com/yyuu/pyenv.git /usr/local/pyenv
chmod -R 777 /usr/local/pyenv/
echo 'export PYENV_ROOT=/usr/local/pyenv' >>/etc/profile
echo 'export PATH=$PYENV_ROOT/bin:$PATH' >> /etc/profile
echo 'eval "$(pyenv init -)"' >> /etc/profile
echo 'pyenv global 2.7.7' >> /etc/profile
. /etc/profile
pyenv install -v 3.7.3
<!-- ~/Library/Application Support/Sublime Text 3/Packages/User/Ruby/pry.sublime-snippet -->
<snippet>
<content><![CDATA[require 'pry'; binding.pry]]></content>
<tabTrigger>pry</tabTrigger>
<scope>source.ruby</scope>
<description>binding.pry</description>
</snippet>