Skip to content

Instantly share code, notes, and snippets.

View freyes's full-sized avatar
🥑

Felipe Reyes freyes

🥑
View GitHub Profile
convertion = [
(1024 ** 5, 'P'),
(1024 ** 4, 'T'),
(1024 ** 3, 'G'),
(1024 ** 2, 'M'),
(1024 ** 1, 'K'),
(1024 ** 0, 'B'),
]
def size_suffix(bytes):
#!/usr/bin/env python
# Jorge Niedbalski <jnr@pyrosome.org>
class Query:
def __init__(self):
(self.c, self.d) = ([],[])
def a(self, d):
self.d.append(d)
import zmq
import sys
context = zmq.Context()
socket = context.socket(zmq.PUSH)
socket.connect("tcp://172.21.0.49:5000")
socket.send_json({'video': sys.argv[1]})
sys.exit(0)
@freyes
freyes / jkbox.py
Created January 18, 2013 15:00 — forked from niedbalski/jkbox.py
import zmq
import urlparse
import urllib
import json
DEFAULT_TIMEOUT=5
def parse(link):
url_data = urlparse.urlparse(link)
query = urlparse.parse_qs(url_data.query)