This file contains 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 subprocess | |
def string_replace_in_file(file_name_with_path, replacements=[]): | |
'''sed runs all the replacements in a single pass''' | |
sed_cmd = ['sed', '-i'] | |
for l in replacements: | |
find_str = l['find'].replace('/', '\/') | |
replace_str = l['replace'].replace('/', '\/') | |
sed_expr = "-e s/%s/%s/g" % (find_str, replace_str) |
This file contains 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 django.contrib.sessions.backends.base import SessionBase, CreateError | |
from django.conf import settings | |
from django.utils.encoding import force_unicode | |
import redis | |
class SessionStore(SessionBase): | |
""" Redis store for sessions""" | |
def __init__(self, session_key=None): | |
self.redis = redis.Redis( |
This file contains 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
""" | |
This fabric file makes setting up and deploying a django application much | |
easier, but it does make a few assumptions. Namely that you're using Git, | |
Apache and mod_wsgi and your using Debian or Ubuntu. Also you should have | |
Django installed on your local machine and SSH installed on both the local | |
machine and any servers you want to deploy to. | |
_note that I've used the name project_name throughout this example. Replace | |
this with whatever your project is called._ |
This file contains 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
/* Gmail style scrollbar */ | |
::-webkit-scrollbar { | |
width: 12px | |
} | |
::-webkit-scrollbar-thumb { | |
border-width: 1px 1px 1px 2px | |
} | |
::-webkit-scrollbar-track { | |
border-width: 0 | |
} |