Skip to content

Instantly share code, notes, and snippets.


Bouke Haarsma Bouke

View GitHub Profile
Bouke / Batch-import-into-GitHub-from-flyspray.php
Created May 4, 2010
import issues from flyspray into github
View Batch-import-into-GitHub-from-flyspray.php
* Example database from flyspray
* @author Bouke Haarsma <>
mysql_connect("localhost", "(user)", "(pass)");
View snippet-singleton.php
class ${ClassName} {
protected static $instance;
* Returns an instance of this Singleton
* @return ${ClassName}
public static function getInstance() {
if(!isset(self::$instance)) {
self::$instance = new self();
Bouke / .bashrc
Created Nov 2, 2010
git branch styled in prompt
View .bashrc
# if GIT_PS1_SHOWDIRTYSTATE is set to a nonempty value,
# unstaged (*) and staged (+) changes will be shown next to the branch name
# if GIT_PS1_SHOWSTASHSTATE is set to a nonempty value,
# a ‘$’ will be shown next to the branch name if something is stashed
# if GIT_PS1_SHOWUNTRACKEDFILES is set to a nonempty value,
# a ‘%’ will be shown next to the branch name if there’re untracked files
Bouke /
Created Sep 16, 2012
fabric test: hosts/roles command line overrides
from fabric.api import *
## hosts
def first():
Bouke / gist:4059634
Created Nov 12, 2012
OSX: wx, Grid, ChoiceEditor and empty cell -> render issue
View gist:4059634
import wx
import wx.grid
class Frame1(wx.Frame):
def __init__(self, parent):
wx.Frame.__init__(self, id=-1, name='', parent=None,
pos=wx.Point(100, 100), size=wx.Size(480, 250),
style=wx.DEFAULT_FRAME_STYLE, title='Spam & Eggs')
self.SetClientSize(wx.Size(400, 250))
Bouke / gist:4110867
Created Nov 19, 2012
OSX-like toolbar wxpython
View gist:4110867
import wx
class DemoFrame(wx.Frame):
def __init__(self):
wx.Frame.__init__(self, None, wx.ID_ANY, "Somewhat Native OSX Toolbar", size=(700,400))
self.toolbar = self.CreateToolBar(wx.TB_FLAT | wx.TB_TEXT)
self.toolbar.AddLabelTool(wx.ID_NEW, 'Label', wx.Bitmap('wrench.png'))
self.toolbar.AddCheckLabelTool(wx.ID_NEW, 'Check', wx.Bitmap('wrench.png'))
self.toolbar.AddRadioLabelTool(wx.ID_NEW, 'Radio 1', wx.Bitmap('wrench.png'))
View fb.achievement.html
<head prefix="og: fb: je-eigen-ronde:">
<title>OG Sample Object - Sample Track</title>
<meta property="og:type" content="game.achievement" />
<meta property="og:title" content="Completed All Tracks!" />
<meta property="fb:app_id" content="121286284698132" />
<meta property="og:image" content="" />
<meta property="og:url" content="" />
<meta property="og:description" content="Marvelous achievement" />
<meta property="game:points" content="50" />
Bouke / gist:5150181
Last active Dec 14, 2015
Random Password Generator Bookmarklet
View gist:5150181
javascript:(function() {
tmp = "";
for (var i=0; i<24; i++) {
tmp += String.fromCharCode((Math.random() * 94 | 0) + 33);
prompt("Your password", tmp);
Bouke / gist:5187280
Created Mar 18, 2013
run all tests on pre-push
View gist:5187280
while read local_ref local_sha remote_ref remote_sha
if [ "$remote_ref" == "refs/heads/master" ]; then
# echo "Pushing to refs/heads/master, running test cases"
if [ "$local_ref" == "HEAD" ]; then
[virtualenv's]python test --failfast
exit $?
You can’t perform that action at this time.