This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
device_families_module = getattr(settings, 'DEVICE_FAMILIES', 'templateswitcher.device_families') | |
exec "from %s import %s" % ( | |
str().join(device_families_module.split('.')[:len(device_families_module.split('.')) - 1]), | |
device_families_module.split('.')[-1] | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import importlib | |
import os | |
from django.conf import settings | |
from mobile.sniffer.chain import ChainedSniffer | |
class TemplateDirSwitcher(object): | |
""" | |
Template Switching Middleware. Switches template dirs by using preset conditions |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from setuptools import setup, find_packages | |
setup( | |
name='django-mobiletv', | |
version='mtv.africa.api.generic.1.3', | |
description='Django mobiletv public facing portal(s) app.', | |
author='Praekelt Consulting', | |
author_email='[email protected]', | |
url='https://github.com/praekelt/django-mobiletv', | |
packages = find_packages(), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo chsh -s /bin/bash <user_name> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import csv | |
import sys | |
def convert_csv(file_path): | |
file_name = file_path.replace(".csv", "") | |
csv_reader = csv.reader(open("%s.csv" % file_name, "r")) | |
csv_writer = csv.writer(open("%s.fixed.csv" % file_name, "w"), quoting=csv.QUOTE_ALL, delimiter=';') | |
for line in csv_reader: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import profile | |
import random | |
from time import time | |
def insertion_sort(l): | |
for i, x in enumerate(l): | |
for j, y in enumerate(l[:i]): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from random import choice | |
from string import ascii_lowercase, ascii_uppercase, digits | |
from sys import argv | |
VOWELS = ['a', 'e', 'i', 'o', 'u'] | |
CONSONANTS = [l for l in ascii_lowercase if l not in VOWELS] | |
FIRST = choice([l for l in ascii_uppercase if l.lower() not in VOWELS]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tree scrollbar | |
{ | |
display: none !important; | |
} | |
treechildren, | |
treechildren::-moz-tree-row | |
{ | |
background-color: #D6DCE3 !important; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd () | |
{ | |
builtin cd "$@" | |
RETVAL=$? | |
# Test for successful real cd: | |
if [ 0 -ne $RETVAL ]; then | |
return $RETVAL | |
fi | |
OlderNewer