Skip to content

Instantly share code, notes, and snippets.

@shauns
shauns / bullet.js
Created October 18, 2012 16:26
Bullet Chart Usage
// Example
// measuring performance for on-time delivery
var on_time_poor = 25;
var on_time_good = 50;
var ontime_markers = build_bullet_markers_higher_better(100, on_time_poor, on_time_good);
var on_time_percentage = 40;
draw_bullet_graph($('#ontime_placeholder'), 0, 100, null, on_time_percentage, ontime_markers, 0);
/**
@shauns
shauns / postprocess_sekizai.py
Created July 17, 2012 09:35 — forked from timmyomahony/postprocess_sekizai.py
django-sekizai postprocessor for enabling django-compressor compatibility
"""
Get django-sekizai, django-compessor (and django-cms) playing nicely together
re: https://github.com/ojii/django-sekizai/issues/4
using: https://github.com/jezdez/django_compressor.git
and: https://github.com/ojii/[email protected]
"""
from compressor.templatetags.compress import CompressorNode
from django.template.base import *
def compress(data, name):
@shauns
shauns / csvwrite.py
Created July 13, 2012 08:34
CSV Unicode Write example
# coding=utf-8
import cStringIO
import csv
import codecs
__author__ = 'shaun_stanworth'
class UnicodeWriter:
"""
A CSV writer which will write rows to CSV file "f",
@shauns
shauns / tester.js
Created April 3, 2012 14:21
Node base64 decode
console.log('Hello, World!');
var fs = require('fs');
var amqp = require('amqp');
var connection = amqp.createConnection({ url: 'amqp://subbydev/base64tests' });
// Wait for connection to become established.
connection.on('ready', function () {
// Create a queue and bind to all messages.
// Use the default 'amq.topic' exchange