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
@3kwa
3kwa / .vimrc
Created August 31, 2011 06:22
vimrc using vundle
" Vundle
filetype off
set rtp+=~/.vim/bundle/vundle
call vundle#rc()
Bundle 'gmarik/vundle'
" github
Bundle 'scrooloose/nerdtree'
Bundle 'scrooloose/nerdcommenter'
Bundle 'mattn/zencoding-vim'
@3kwa
3kwa / handling_template.py
Created September 1, 2011 08:06
Various ways to use template with CherryPy
"""
experimenting with templates (pystache but could be any other) and cherrypy
reading http://streamhacker.com/2011/08/27/python-3-web-development-review/
annoyed the crap out of me!
hence let's illustrate some of the many ways to graft templates on the cherry
tree ... pistachio:
+ string interpolation PHP-esque?
@3kwa
3kwa / sikuli.py
Created March 13, 2012 23:46
using Sikuli to test a GUI user scenario
# java -cp ~/Downloads/Sikuli-X-1.0rc3\ \(r905\)-linux-x86_64/Sikuli-IDE/sikuli-script.jar org.python.util.jython test.py
from __future__ import with_statement
import unittest
from sikuli.Sikuli import *
class Firefox(object):
"""
very simple firefox browser context manager
@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)
@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 / __slots__.ipynb
Created April 5, 2013 07:35
SyPy presentation on __slots__ using iPython notebook
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@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 / 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 / .gitignore
Last active December 19, 2015 00:19
No standard library allowed exercise :S
__pycache__
details.csv
errors.csv
*.pyc
@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.