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
server { | |
listen 80; | |
server_name project.ru www.project.ru; | |
access_log /var/log/nginx/project-access.log; | |
error_log /var/log/nginx/project-error.log; | |
root /home/www/project/; | |
location /static/ { |
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
[uwsgi] | |
processes = 2 | |
env = DJANGO_SETTINGS_MODULE=project.settings | |
module = project.wsgi | |
chdir = /home/www/%n/ | |
virtualenv = /home/www/%n/.env/ | |
pythonpath = /home/www/%n/ |
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
server { | |
# ... | |
location /api/ { | |
uwsgi_pass unix:///var/run/uwsgi/app/project/socket; | |
include uwsgi_params; | |
uwsgi_buffers 8 128k; | |
client_max_body_size 10M; | |
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 -*- | |
import json | |
from django.http import HttpResponse | |
from django.views.generic import FormView | |
class BaseAJAXFormView(FormView): | |
mimetype = 'application/json' | |
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
setContentHeight = () -> | |
$content = $('#content') | |
setMainHeight = () -> | |
height = $(window).height() - $('#menu').outerHeight() - $('#footer').outerHeight() | |
$content.height height | |
setMainHeight() | |
$(window).resize () -> |
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'] |
OlderNewer