Skip to content

Instantly share code, notes, and snippets.


Bouke Haarsma Bouke

View GitHub Profile
Bouke / ajax-request.d.ts
Created Jun 19, 2018
TypeScript typings for ember-ajax
View ajax-request.d.ts
declare module 'ember-ajax/ajax-request' {
import Ember from 'ember';
import AjaxRequestMixin from 'ember-ajax/mixins/ajax-request';
export default class AjaxRequest extends Ember.Object.extend(AjaxRequestMixin) { }
Bouke / StringDecimalConverter.cs
Last active Aug 27, 2020
Serialize decimal to string in Newtonsoft.Json
View StringDecimalConverter.cs
public class StringDecimalConverter : JsonConverter
public override bool CanRead
return false;
Bouke / gist:11261620
Last active Sep 29, 2020
Multiple Python installations on OS X
View gist:11261620

Previous versions used homebrew to install the various versions. As suggested in the comments, it's better to use pyenv instead. If you are looking for the previous version of this document, see the revision history.

$ brew update
$ brew install pyenv
$ pyenv install 3.5.0
$ pyenv install 3.4.3
$ pyenv install 3.3.6
$ pyenv install 3.2.6
$ pyenv install 2.7.10
$ pyenv install 2.6.9
Bouke / gist:10454272
Last active Dec 3, 2019
Install FreeTDS, unixODBC and pyodbc on OS X
View gist:10454272

First, install the following libraries:

$ brew install unixodbc
$ brew install freetds --with-unixodbc

FreeTDS should already work now, without configuration:

$ tsql -S [IP or hostname] -U [username] -P [password]
locale is "en_US.UTF-8"
locale charset is "UTF-8"
Bouke / postactivate
Created Jan 8, 2014
Python virtualenvwrapper
View postactivate
# This hook is run after every virtualenv is activated.
#create project directory and cd into it
env_name="`basename \"$VIRTUAL_ENV\"`"
if [ ! -d "$pwd_root" ] ; then
echo "Creating directory $pwd_root"
mkdir "$pwd_root"
Bouke / gist:7579228
Last active Dec 28, 2015
Fetch a pull request without adding the requester's repo as a remote
View gist:7579228
git fetch origin pull/[id]/head:pull/[id]
Bouke /
Created Nov 11, 2013
IANA Language Tag Parser
Parses the language tags provided by IANA_
For a definition of the tag types, see
from collections import OrderedDict
from pprint import pprint
Bouke /
Last active Apr 19, 2017 — forked from rcoup/
Catch login failures / captcha input
#!/usr/bin/env python
A script to query the Amazon Web Services usage reports programmatically.
Ideally this wouldn't exist, and Amazon would provide an API we can use
instead, but hey - that's life.
Basically takes your AWS account username and password, logs into the
website as you, and grabs the data out. Always gets the 'All Usage Types'
Bouke / ember-select.js
Created Apr 11, 2013
Ember.Select allowing options to be disabled. Usage `{{view Ember.Select ... optionDisabledPath="content.disabled"}}`
View ember-select.js
var get = Ember.get, getPath = Ember.getPath, set = Ember.set, fmt = Ember.String.fmt;
optionDisabledPath: null
attributeBindings: ['disabled'],
init: function() {
You can’t perform that action at this time.