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
(python manage.py sqlclear APP_NAME | python manage.py dbshell) && python manage.py syncdb |
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
psql -c "drop database dbName"; psql -c "create database dbName;"; ./manage.py syncdb; ./manage.py migrate; |
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
convertPostGisToYandex = (point) -> | |
coords = /POINT\s*\(\s*([0-9\.]+)\s*([0-9.]+)\s*\)/.exec point | |
if coords.length != 2 | |
console.error 'Bad parse PostGIS point data', point | |
return [] | |
return [parseFloat(coords[1]), parseFloat(coords[2])] |
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
toggleClass = angular.module('jobMapApp') | |
.directive 'ngToggleClass', () -> | |
return { | |
restrict: 'A' | |
scope: | |
condition: '&ngToggleCondition' | |
link: (scope, element, attrs) -> | |
scope.timerId = null | |
scope.$watch () -> | |
return scope.condition() |
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
module.exports = (grunt) -> | |
grunt.initConfig | |
pkg: grunt.file.readJSON 'package.json' | |
watch: | |
coffee: | |
files: ['static/coffee/**/*.coffee'] | |
tasks: ['coffee:dist'] | |
less: | |
files: ['static/css/**/*.less'] | |
tasks: ['less:dist'] |
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
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
karma-angular |
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 __future__ import unicode_literals | |
urlpatterns = [ | |
# ... | |
] | |
handler400 = 'apps.common.views.handler400' | |
handler403 = 'apps.common.views.handler403' |