Skip to content

Instantly share code, notes, and snippets.

View sspross's full-sized avatar

Silvan Spross sspross

  • Zurich, Switzerland
View GitHub Profile
@sspross
sspross / 01_notes.md
Last active August 13, 2020 09:08
Switch to Windows
@sspross
sspross / problem.py
Last active March 17, 2017 15:57
how to
from django.views.generic import View
from django.http import QueryDict
import json
class Webhook(View):
def post(self, request):
"""
@sspross
sspross / 01_ubuntu.md
Last active December 14, 2015 16:20
Django Setup: Ubuntu 14.04, postgres, postgis, nginx, gunicorn, postfix, monit, redis, rabbitmq, celery, npm, gulp, pip wheel
passwd

apt-get update
apt-get upgrade

apt-get install fail2ban

useradd deploy

mkdir /home/deploy

@sspross
sspross / productivity.md
Last active August 29, 2015 13:57
Inspired by Danny Schreibers post about How to Scale Yourself and Get More Done Than You Thought Possible, https://zapier.com/blog/scale-yourself-scott-hanselman/

Getting back my productivity

Effectiveness is doing the right things.
Efficiency is doing things right.

Effectiveness

  • three outcomes for the day
@sspross
sspross / django.md
Last active December 18, 2015 03:39

Django

Entwicklungsumgebung einrichten

Brew installieren

  1. Existierende package manager löschen (fink, darwinports):

    sudo rm -r /sw /opt
    

sudo rm -r /usr/local/include/* /usr/local/lib/*

@sspross
sspross / DJANGO_TWISTED_HAPROXY.md
Last active November 13, 2023 03:15
Serving Django and Twisted using HAproxy

Serving Django and Twisted using HAproxy

Why?

Because we wanted to achive the following while developing a webapp using websockets:

Static serving (nginx), Django application (gunicorn) and Websockets service (twisted)

  • on the same IP
@sspross
sspross / globalize2_migration_helper.rb
Created March 28, 2010 12:35
migration helper to migrate existing data to a target language after adding globalize2 to an existing project
module Globalize2MigrationHelper
def migrate_existing_data_to_language(model, target_language)
say "migrating translated attributes of model '#{model}' to language '#{target_language}'"
# set language to use
I18n.locale = target_language
# iterate over all records
for object in model.all