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
source = ogr.Open(path) | |
if source is None: | |
raise IOError('The source file {} is invalid or inexistant'.format(path)) | |
layer = source.GetLayer(0) | |
time_zones = [] | |
for feature in layer: |
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 datetime import tzinfo, timedelta | |
from math import floor | |
from django.contrib.gis.db.models.fields import PolygonField | |
from django.contrib.gis.db.models.manager import GeoManager | |
from django.contrib.gis.geos.geometry import GEOSGeometry | |
from django.db import models | |
from osgeo import ogr | |
from pytz import timezone | |
from pytz.exceptions import UnknownTimeZoneError |
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
def default(cb, value=None): | |
# noinspection PyBroadException | |
try: | |
return cb() | |
except: | |
return value | |
o = object() | |
print(default(lambda: o.does.noot.exist, 42)) |
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 python3 | |
# vim: fileencoding=utf-8 tw=100 expandtab ts=4 sw=4 : | |
import sys | |
import subprocess | |
from email.parser import Parser | |
from email.utils import parseaddr, formataddr | |
# --- |
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 python3 | |
# vim: fileencoding=utf-8 tw=100 expandtab ts=4 sw=4 : | |
# | |
# ssh_replacer | |
# (c) 2015 ActivKonnect | |
from sys import argv, exit, stderr | |
from re import compile | |
from os import walk, path |
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'; | |
const DIST_DIR = 'gif/static'; | |
const SRC_DIR = 'gif/static_src'; | |
const MAPS_DIR = 'maps'; | |
const JS_SRC = [ | |
'node_modules/angular/angular.js', | |
'node_modules/angular-route/angular-route.js', | |
'node_modules/angular-touch/angular-touch.js', |
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
# vim: fileencoding=utf-8 tw=100 expandtab ts=4 sw=4 : | |
# | |
# gmc_api | |
# (c) 2015 ActivKonnect | |
from django.core.exceptions import ValidationError | |
from django.utils.six import string_types | |
from django.utils.translation import get_language | |
from django.conf import settings |
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/python | |
# vim: fileencoding=utf-8 tw=100 expandtab ts=4 sw=4 : | |
from __future__ import unicode_literals | |
try: | |
from deis import DeisClient | |
except ImportError: | |
DeisClient = None |
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/python | |
# vim: fileencoding=utf-8 tw=100 expandtab ts=4 sw=4 : | |
from __future__ import unicode_literals | |
from unittest import TestCase | |
try: | |
from dopy.manager import DoError, DoManager |
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
<a href="?{% qspatch page=clients.paginator.num_pages %}"><span>{{ clients.paginator.num_pages }}</span></a> |