Skip to content

Instantly share code, notes, and snippets.

@wojas
wojas / docker-compose.yml
Created June 3, 2016 06:29
docker-compose for nginx with php5-fpm using small alpine images
version: '2'
services:
php:
image: php:5.6-fpm-alpine
volumes:
- data:/_data
- ./site:/var/www/html:ro
networks:
- backend
command: sh -c 'chown www-data /_data && exec php-fpm'
@wojas
wojas / feincms_delete_fix.py
Created November 12, 2012 12:40
Workaround for FeinCMS bug, where objects cannot be deleted if there are content types linking to it (IntegrityError)
# Workaround for: https://github.com/feincms/feincms/issues/323
# "Unable to delete pages containing custom content types"
from django.db.models.signals import pre_delete
import logging
log = logging.getLogger(__name__)
def fix_content_model_delete(model):
"""Register a pre-delete handler that will remove all content when a
@wojas
wojas / chat.py
Created August 30, 2011 12:05
gevent+Redis experiment: very basic async console chat application using Redis pub/sub and storage
import gevent.monkey
gevent.monkey.patch_all()
import os
import sys
import fcntl
import gevent
from gevent.socket import wait_read
from redis import Redis