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
#!/bin/bash | |
# | |
# PostgreSQL Backup Script Ver 1.0 | |
# http://autopgsqlbackup.frozenpc.net | |
# Copyright (c) 2005 Aaron Axelsen <axelseaa@amadmax.com> | |
# | |
# This script is based of the AutoMySQLBackup Script Ver 2.2 | |
# It can be found at http://sourceforge.net/projects/automysqlbackup/ | |
# | |
# The PostgreSQL changes are based on a patch agaisnt AutoMySQLBackup 1.9 |
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 _ from 'lodash'; | |
function buildParams(prefix, obj, traditional, add) { | |
let name, i, v, | |
rbracket = /\[\]$/; | |
if (_.isArray(obj)) { | |
// Serialize array item. | |
for (i = 0; obj && i < obj.length; i++) { | |
v = obj[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
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 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
export WORKON_HOME=~/.envs | |
export PROJECT_HOME=$HOME/project | |
source /usr/local/bin/virtualenvwrapper.sh |
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
a = [('airport', u'аэропорт'), # Аэропорт | |
('showplace', u'достопримечательность'), # Достопримечательности | |
('conference',u'конференц-центр'), # Конференц-центры | |
('museum',u'музей'), # Музеи | |
('monument',u'памятник'), # Памятники | |
('landmark',u'ориентир'), # Ориентиры | |
('park',u'парк'), # Парки | |
('arena',u'стадион'), # Стадионы или арены | |
('arena',u'арена'), | |
('theater',u'театр')] |
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
# -*- encoding: utf-8 -*- | |
from models import * | |
from annoying.functions import get_object_or_None | |
from comments.utils import load_comments_userdata | |
from django.contrib.auth.decorators import login_required | |
from django.contrib.admin.views.decorators import staff_member_required | |
from django.conf import settings | |
from django.core.urlresolvers import reverse |
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 project.models import Category | |
>>> Category.objects.all() | |
[<Category: Test1>, <Category: test without projects>, <Category: dsfsdf>] | |
>>> Category.objects.filter(project=True).all() | |
[<Category: Test1>] |
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
<a href="#" onclick="return fb_login();" id="facebook">Login with facebook</a> | |
<script type="text/javascript" src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php"></script> | |
<script type="text/javascript"> | |
FB.init("{{ request.facebook.api_key }}", "{% url publicauth-facebook-xdreceiver %}"); | |
function fb_login() { | |
FB.Connect.requireSession(function(test) { | |
window.location = "{% url publicauth-complete 'facebook' %}?next={{ request.GET.next }}"; | |
}); |
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
#! -*- coding: utf-8 -*- | |
from models import * | |
from django.contrib import admin | |
import multilingual | |
from multilingual.admin import MultilingualModelAdmin | |
class ContentAdmin(MultilingualModelAdmin): | |
use_prepopulated_fields = {"slug": ("name",)} | |
use_fieldsets = [ |
NewerOlder