Skip to content

Instantly share code, notes, and snippets.

View spoutnik16's full-sized avatar
🦏
Focusing

Jérôme Hugon spoutnik16

🦏
Focusing
View GitHub Profile
@spoutnik16
spoutnik16 / french_grammar_tags.py
Last active May 14, 2018 13:07
django tempalte filter for french contraction for "à les", "à le", "à la"
from django import template
register = template.Library()
@register.filter(is_safe=False)
def à(value, upper=False, capitalize=False):
"""
French contraction for "à les", "à le", "à la"
@spoutnik16
spoutnik16 / compilemessages.py
Last active May 14, 2018 13:07
django-modeltranslation po file with makemessages and compilemessages
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import print_function
import os
import django
import polib
from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
@alarrosa14
alarrosa14 / artnet_middleware.py
Last active August 2, 2022 13:30
A Python ArtNet packet receiver that broadcasts its payload.
import sys
from socket import (socket, AF_INET, SOCK_DGRAM, SOL_SOCKET, SO_REUSEADDR,
SO_BROADCAST)
from struct import pack, unpack
UDP_IP = "127.0.0.1"
UDP_PORT = 6454