Skip to content

Instantly share code, notes, and snippets.

George Psarakis georgepsarakis

Block or report user

Report or block georgepsarakis

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
enricofoltran / main.go
Last active Jul 19, 2019
A simple golang web server with basic logging, tracing, health check, graceful shutdown and zero dependencies
View main.go
package main
import (
dabeaz /
Last active May 19, 2019
Live-coded examples from my PyCon Brasil 2015 Keynote
from socket import *
import asyncio
loop = asyncio.get_event_loop()
async def echo_server(address):
sock = socket(AF_INET, SOCK_STREAM)
sock.setsockopt(SOL_SOCKET, SO_REUSEADDR, 1)
ipmb / ratelimit.nginxconf
Last active May 23, 2019
Nginx reverse proxy with rate limiting
View ratelimit.nginxconf
upstream myapp {
limit_req_zone $binary_remote_addr zone=login:10m rate=1r/s;
server {
listen 443 ssl spdy;
server_name _;
from sqlalchemy import engine
from sqlalchemy import event
class DbStats():
def __init__(self):
def clear(self):
self.total_queries = 0
self.total_time = 0
lelandbatey /
Last active Jul 20, 2019
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!


This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"


georgepsarakis /
Created Dec 12, 2013
Extended list. Maintains a dictionary for faster lookups (optionally keeps hash of item object representation by marshalling) and with some operator overloading can perform mathematical operations among instances.
from collections import MutableSequence
import marshal
from operator import add, div, mul, neg, mod, sub
from operator import ge, gt, le, lt, eq
from itertools import imap
Extended list class
- fast lookups by maintaining a dictionary with the values
- numeric operations between 2 instances are possible (like Octave matrices)
randyzwitch /
Created Nov 21, 2013
Setting up IPython Notebook as a remote server
#### Start IPython, generate SHA1 password to use for IPython Notebook server
$ ipython
Python 2.7.5 |Anaconda 1.8.0 (x86_64)| (default, Oct 24 2013, 07:02:20)
Type "copyright", "credits" or "license" for more information.
IPython 1.1.0 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
georgepsarakis /
Last active Dec 28, 2015
REPL-CLI boilerplate for simple DSLs with built-in help, autocomplete (like Redis-CLI)
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import argparse
import readline
import rlcompleter
import shlex
import os
import re
georgepsarakis /
Last active Nov 12, 2018
Python MapReduce (itertools, multiprocessing)
#!/usr/bin/env python
import os
import itertools
import multiprocessing as mp
from math import ceil
from types import GeneratorType as generator
from functools import partial
from time import time
You can’t perform that action at this time.