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
angular.module('app') | |
.directive 'idle', () -> | |
return { | |
restrict: 'E' | |
scope: | |
waitTime: '@ngIdleWaitTime' | |
afterRedirect: '&ngAfterRedirect' | |
link: (scope, element, attrs) -> | |
idleTimer = null | |
idleState = false |
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
EMAIL_HOST = 'smtp.yandex.ru' | |
EMAIL_HOST_USER = 'login@example.com' | |
EMAIL_HOST_PASSWORD = 'password' | |
EMAIL_PORT = 465 | |
EMAIL_USE_TLS = True |
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
class Entity(models.Model): | |
somefile = model.FileField(upload_to='files') |
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.core.context_processors import csrf | |
str(csrf(request)['csrf_token']) |
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
# -*- coding: utf-8 -*- | |
from django import template | |
register = template.Library() | |
@register.filter() | |
def phone(value): | |
return '+%s %s %s %s %s' % (value[0], |
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
'use strict'; | |
angular.module('appName') | |
.directive 'birthday', () -> | |
return { | |
restrict: 'E' | |
scope: | |
date: '=' | |
yearBegin: '=' | |
yearEnd: '=' |
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
var server = require('webserver').create(); | |
var port = 9091; | |
var getPage = function(url, callback) { | |
var page = require('webpage').create(); | |
page.open(url, function() { | |
setTimeout(function() { | |
page.evaluate(function() { | |
$('meta[name=fragment], script').remove() |
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
# -*- coding: utf-8 -*- | |
from django import template | |
register = template.Library() | |
@register.assignment_tag(takes_context=True) | |
def is_owner(context, obj, user, field_name='user'): | |
return getattr(obj, field_name, None) == user |
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
# -*- coding: utf-8 -*- | |
from django.core.urlresolvers import reverse | |
from django.utils.translation import ugettext_lazy as _ | |
from admin_tools.dashboard import modules | |
from admin_tools.dashboard import Dashboard | |
from admin_tools.menu import Menu | |
from admin_tools.menu import items | |
from project.dashboard_modules import WorkedTaskDashboardModuleChart |
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
karma-angular |