Skip to content

Instantly share code, notes, and snippets.

View strindhaug's full-sized avatar

Stein Strindhaug strindhaug

  • NoA Ignite
  • Oslo
View GitHub Profile
@alexissmirnov
alexissmirnov / locale.py
Created June 15, 2011 20:24
Django QueryParameterLocaleMiddleware
from django.middleware import locale
from django.utils import translation
class QueryParameterLocaleMiddleware(locale.LocaleMiddleware):
"""
Django's LocaleMiddleware picks the locale setting of the request from
multiple sources such as a cookie, Accept-Language header and server-side
session.
This middleware adds one more way to specify the language by supplying
@alexeds
alexeds / move-stashes.md
Created September 5, 2012 18:00
Move your stashes from one repo to another

Move your stashes from one repo to another


This was useful for me when we created a new branch for a new major release, but were still working on our current version as well. I cloned our repo again and kept the new project on our new branch, but also wanted to get my stashes there.

Download your stashes

git stash show -p > patch

You'll have to specify your stash and name your file whatevery you want. Do this for as all your stashes, and you'll have patch files in your pwd.

@arulrajnet
arulrajnet / MXEmailVerifier.py
Last active May 25, 2023 14:23
Verify the given mail id is valid or not, without sending mail. Verifying the email id directly from mail exchange server.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Verify the given mail id is valid or not without sending mail. Verifying the email id directly from mail exchange server.
"""
import argparse
import smtplib
import dns.resolver