Skip to content

Instantly share code, notes, and snippets.

View 3kwa's full-sized avatar

Eugene Van den Bulke 3kwa

  • Sydney, Australia
View GitHub Profile
"""
A radix sort implementation to illustrate:
+ testing with doctest
+ __main__
+ yield
+ refactoring for legibility (your future self may thank you)
+ Python is __magic__
+ PEP 8
+ ...

Keybase proof

I hereby claim:

  • I am 3kwa on github.
  • I am egn (https://keybase.io/egn) on keybase.
  • I have a public key whose fingerprint is 174B 5A36 EC17 5B65 DB5D 2432 7C7C 2503 A299 6FDB

To claim this, I am signing this object:

"""
Bootstrap in Python using numpy ... mind expanding!
source: http://people.duke.edu/~ccc14/pcfb/analysis.html
"""
from collections import namedtuple
import numpy
@3kwa
3kwa / fanout.py
Last active August 29, 2015 14:03
Turn key websocket broadcasting
"""
Turn key websocket broadcasting: POST a message on a channel it will be
broadcasted to all the websockets listening on that channel.
Channels are identified by the URL path e.g. connecting a websocket to
/listen/to/a/channel registers the websocket on the channel to-a-channel.
Symmetrically a POST on /broadcast/to/a/channel will send a message to all
listeners on to-a-channel.
@3kwa
3kwa / .gitignore
Last active December 19, 2015 00:19
No standard library allowed exercise :S
__pycache__
details.csv
errors.csv
*.pyc
@3kwa
3kwa / bootstrap.sh
Last active December 18, 2015 10:39
Dependencies for dead simple acceptance testing using pytest and selenium
curl -O https://raw.github.com/pypa/pip/master/contrib/get-pip.py
echo -e "Installing pip..."
sudo python get-pip.py
rm get-pip.py
echo -e "Done."
echo -e "Installing Python packages..."
sudo pip install pytest
sudo pip install selenium
@3kwa
3kwa / Python has R envy
Last active December 16, 2015 14:39
PANDAS: Python has R envy
{
"metadata": {
"name": "Python has R envy"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
@3kwa
3kwa / __slots__.ipynb
Created April 5, 2013 07:35
SyPy presentation on __slots__ using iPython notebook
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@3kwa
3kwa / qtkit.py
Created April 24, 2012 07:15
PyQT + WebKit application
#!/usr/bin/env python
"""
If you use landslide to create slideshows using markdown, you may have found
yourself repeating endlessly:
+ save source document
+ switch to the terminal to run landslide
+ reload the generated html in your browser
This QT (using webkit) based "application" monitor changes to the source file
@3kwa
3kwa / .tmux.conf
Created March 23, 2012 05:02
my tmux conf
# ctrl-b -> ctrl-a
set -g prefix C-a
# ctrl-a ctrl-a last window
bind-key C-a last-window
# we are humans numbering from 1
set -g base-index 1
# faster input (not waiting for escape)