Skip to content

Instantly share code, notes, and snippets.

View pior's full-sized avatar

Pior Bastida pior

View GitHub Profile
@pior
pior / statsd-from-shell.sh
Last active November 3, 2016 19:59
How to push metric to StatsD from a shell
# Bash solution
echo -e -n "my.metric:1|c|@1" > /dev/udp/127.0.0.1/8125
# nc solution
echo "my.metric:1|c" | nc -w 1 -u 127.0.0.1 8125
for server in $(dig +short ns io| sort); do echo -e "\nTrying to get NS for shopify.io from ${server}"; dig NS shopify.io. @${server} | egrep '(Query time|timed out|HEADER)'; done
@pior
pior / overpass.geojson
Created June 27, 2016 23:21 — forked from anonymous/overpass.geojson
Montréal Island boundary coordinates
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
(short_link) pior@misaki:~/dev/py/tests/short_link (master)$ webserver/manage.py runserver
Performing system checks...
System check identified no issues (0 silenced).
March 18, 2016 - 14:04:22
Django version 1.9.4, using settings 'webserver.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.
Not Found: /
[18/Mar/2016 14:04:29] "GET / HTTP/1.1" 404 2044
@pior
pior / app.py
Created March 6, 2016 01:39
Using a multiprocessing.pool.ThreadPool wih uWSGI -- Tested with gevent
from gevent.monkey import patch_all
patch_all()
import time
from multiprocessing.pool import ThreadPool
import uwsgi
emitter = ThreadPool(10)

Backend Developer - Python

We’re looking for back-end developers with a passion for Python, open-source and good development practices.

As a member of a team, you will play an important role in the definition and development of core technologies that make up Ludia’s game services.

Within the first 3 months, you will design, prototype, implement and deploy major services underlying Ludia's games. The documentation you will write has the quality of the best open-source projects.

You will also collaborate with other development teams about technical designs and system integrations.

Bike Computer

Features

  • single power source for all equipments
  • auto on/off based on bike movements
  • battery smart indicator
@pior
pior / arc.py
Last active January 30, 2025 12:14
Adaptive replacement cache implementation in Python
"""
ARC implementation
Based on
http://code.activestate.com/recipes/576532-adaptive-replacement-cache-in-python/
Original Paper
https://www.usenix.org/legacy/events/fast03/tech/full_papers/megiddo/megiddo.pdf
Warning: patented by IBM