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
find . -name "????_*.py" | xargs sed -i "s/from django.db import models/from django.db import models\nfrom django.conf import settings/" | |
find . -name "????_*.py" | xargs sed -i "s/'32632'/'%s' % settings.SRID/g" | |
find . -name "????_*.py" | xargs sed -i "s/srid=32632/srid=settings.SRID/g" |
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
#! /bin/bash | |
### BEGIN INIT INFO | |
# Provides: yourapp | |
# Required-Start: nginx | |
# Required-Stop: | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: The main django process | |
# Description: The gunicorn process that receives HTTP requests | |
# from nginx |
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
CREATE OR REPLACE FUNCTION SimplifyEdgeGeom(atopo varchar, anedge int, maxtolerance float8) | |
RETURNS float8 AS $$ | |
DECLARE | |
tol float8; | |
sql varchar; | |
BEGIN | |
tol := maxtolerance; | |
LOOP | |
sql := 'SELECT topology.ST_ChangeEdgeGeom(' || quote_literal(atopo) || ', ' || anedge | |
|| ', ST_Simplify(geom, ' || tol || ')) FROM ' |
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
* FeatureCollection | |
* Feature properties contains unique ``id`` field |
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 csv | |
import json | |
def dms2latlng(value): | |
""" | |
Degres Minutes Seconds to Decimal degres | |
""" | |
degres, minutes, seconds = value.split() | |
seconds, direction = seconds[:-1], seconds[-1] |
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 urlparse import urlparse | |
from django.conf import settings | |
from django.contrib.auth import get_user_model | |
User = get_user_model() | |
CONVERSION_SERVER_HOST = urlparse(settings.CONVERSION_SERVER).hostname | |
try: |
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
<section> | |
<div class="header"> | |
<img class="logo" src="/media/logo.png" alt="logo"> | |
<h1>Rando, l'offre de randonnée pour découvrir le patrimoine du Parc.</h1> | |
</div> | |
<div class="row-fluid"> | |
<div class="span4"> | |
<a href="/#search" class="pjax profile"> | |
<img src="/media/search.jpg" alt="logo"> | |
<span class="caption">Recherche</span> |
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 | |
import os | |
import sys | |
import shutil | |
import subprocess | |
class UserError(Exception): | |
pass |
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 -*- | |
from django.contrib.admin.models import LogEntry, ADDITION, CHANGE, DELETION | |
from django.contrib.contenttypes.models import ContentType | |
from django.utils.encoding import force_unicode | |
from django.forms.models import model_to_dict | |
def log_addition(request, dbobject, oldobject=None, message=None): | |
_log_action(request, dbobject, oldobject, ADDITION, message) |
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
[user] | |
name = Your Name\n | |
email = you@email.com | |
[color] | |
ui = auto | |
[color "branch"] | |
current = yellow reverse | |
local = yellow |