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
EMAIL_HOST = 'smtp.yandex.ru' | |
EMAIL_HOST_USER = '[email protected]' | |
EMAIL_HOST_PASSWORD = 'password' | |
EMAIL_PORT = 465 | |
EMAIL_USE_TLS = True |
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
angular.module('app') | |
.directive 'idle', () -> | |
return { | |
restrict: 'E' | |
scope: | |
waitTime: '@ngIdleWaitTime' | |
afterRedirect: '&ngAfterRedirect' | |
link: (scope, element, attrs) -> | |
idleTimer = null | |
idleState = false |
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
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 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
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 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
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 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
psql -c "drop database dbName"; psql -c "create database dbName;"; ./manage.py syncdb; ./manage.py migrate; |
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
(python manage.py sqlclear APP_NAME | python manage.py dbshell) && python manage.py syncdb |
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
setContentHeight = () -> | |
$content = $('#content') | |
setMainHeight = () -> | |
height = $(window).height() - $('#menu').outerHeight() - $('#footer').outerHeight() | |
$content.height height | |
setMainHeight() | |
$(window).resize () -> |
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 -*- | |
import json | |
from django.http import HttpResponse | |
from django.views.generic import FormView | |
class BaseAJAXFormView(FormView): | |
mimetype = 'application/json' | |
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
server { | |
# ... | |
location /api/ { | |
uwsgi_pass unix:///var/run/uwsgi/app/project/socket; | |
include uwsgi_params; | |
uwsgi_buffers 8 128k; | |
client_max_body_size 10M; | |