Skip to content

Instantly share code, notes, and snippets.


laike9m laike9m

Block or report user

Report or block laike9m

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
thirtythreeforty /
Last active Aug 29, 2015
A TCP hole puncher
# By George Hilliard ("thirtythreeforty")
# A simple TCP hole puncher for a firewall accepting only ESTABLISHED,RELATED packets
# This currently binds to the localhost address, although that's easy to fix by changing
# the bind() calls.
# This is based on the theory found at
# You may use this software under the terms of the Creative Commons CC-0 license.
#!/usr/bin/env python3
# encoding: utf-8
I saw a similar script on the homepage of Miguel Grinberg (the Flask book guy),
but he was using webscraping. Here I use simple API calls instead.
The script takes the presentations of a Python conference and orders the
presentations in descending order by the number of youtube views. It
is an indicator about the popularity of a video.
View gist:26fb3b7e365dce527886
Results of running this script:
Views Ups Downs Title (Speakers)
9,810 166 3 Keynote - Jacob Kaplan-Moss - Pycon 2015 (Jacob Kaplan-Moss)
7,044 64 0 Type Hints - Guido van Rossum - PyCon 2015 (Guido van Rossum)
4,742 121 0 David Beazley - Python Concurrency From the Ground Up: LIVE! - PyCon 2015 (David Beazley)
4,684 66 3 Keynote - Guido van Rossum - PyCon 2015 (Guido van Rossum)
4,272 78 1 Dan Callahan - My Python's a little Rust-y - PyCon 2015 (Dan Callahan)
2,694 34 0 How to build a brain with Python (Trevor Bekolay)
2,391 29 0 Andrew T. Baker - Demystifying Docker - PyCon 2015 (Andrew T. Baker)
vsajip /
Created Feb 9, 2012
Example of logging formatter factory usage with fileConfig()
import logging
class CustomFormatter(logging.Formatter):
def __init__(self, default):
self.default = default
def format(self, record):
if record.levelno in (logging.WARNING,
davesque / vassal.ini
Created Jan 7, 2013
Uwsgi ini file for django
View vassal.ini
socket = /tmp/
; Worker processes
master = 1
processes = 4
; Virtualenv and home directory
virtualenv = /var/virtualenvs/
chdir = /var/www/
View stackify.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
mbostock / .block
Last active Apr 30, 2019
Force-Directed Graph
View .block
license: gpl-3.0
height: 600
koenbollen /
Created Jul 5, 2010
Proof of Concept: UDP Hole Punching
#!/usr/bin/env python
# Proof of Concept: UDP Hole Punching
# Two client connect to a server and get redirected to each other.
# This is the client.
# Koen Bollen <meneer koenbollen nl>
# 2010 GPL
mbostock / .block
Last active Sep 6, 2019 — forked from mbostock/.block
Radial Cluster Dendrogram
View .block
license: gpl-3.0
height: 950
border: no
zyxar / exercise.tour.go
Created Apr 6, 2012
tour.golang exercise solutions
View exercise.tour.go
/* Exercise: Loops and Functions #43 */
package main
import (
func Sqrt(x float64) float64 {
z := float64(2.)
You can’t perform that action at this time.