Skip to content

Instantly share code, notes, and snippets.

@petemcw
petemcw / docker_instructions.md
Last active October 22, 2020 21:24
Mac OS X Docker Instructions using Dinghy

Docker Installation

A great way to get Docker running smoothly on OS X is to use the awesome project Dinghy. It is basically:

Docker on OS X with batteries included, aimed at making a more pleasant local development experience. Runs on top of docker-machine.

Some of the benefits are:

  • Faster volume sharing using NFS rather than built-in virtualbox/vmware file shares
  • Filesystem events work on mounted volumes
@dqminh
dqminh / jqtfilter.py
Created May 25, 2011 07:04
JS template filter for webassets
"""
Webasset filter to combine JQuery Templates files into javascript-safe strings,
and put them into a namespace
"""
import os
from webassets.filter import Filter
class JqtFilter(Filter):
name = 'jqt'
@m0n5t3r
m0n5t3r / generate_traffic.py
Created November 3, 2010 17:15
stats gathering with gunicorn; gstats.py should be run with one sync worker, gunicorn.conf.py should be in your config
#!/usr/bin/env python
import sys
from random import random
from time import sleep
from threading import Thread, active_count
execfile('gunicorn.conf.py')
class QuerySetDoubleIteration(Exception):
"A QuerySet was iterated over twice, you probably want to list() it."
pass
# "Skinny" here means we use iterator by default, rather than
# ballooning in memory.
class SkinnyManager(Manager):
def get_query_set(self):
return SkinnyQuerySet(self.model, using=self._db)