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
import os | |
import tarfile | |
import progressbar | |
import django.apps | |
from datetime import datetime | |
from django.core.management.base import BaseCommand | |
from django.utils.encoding import smart_str | |
class Command(BaseCommand): |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import re | |
import os | |
import shutil | |
SHUUP_PATH = '~/.pyenv/versions/project/lib/python3.5/site-packages/shuup' | |
SOURCE_PATH = '~/projects/project' |
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' |
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
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
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
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
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
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
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])] |