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 asyncio.subprocess | |
@asyncio.coroutine | |
def demo(): | |
proc = yield from asyncio.create_subprocess_exec('ls', '-1', stdout=asyncio.subprocess.PIPE) | |
while True: | |
line = yield from proc.stdout.readline() | |
if not line: | |
break | |
print(line) |
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/sh | |
# http://www.alfredklomp.com/programming/shrinkpdf | |
# Licensed under the 3-clause BSD license: | |
# | |
# Copyright (c) 2014, Alfred Klomp | |
# All rights reserved. | |
# | |
# Redistribution and use in source and binary forms, with or without | |
# modification, are permitted provided that the following conditions are met: |
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 hashlib | |
import sys | |
from uuid import UUID | |
text = sys.stdin.read() | |
print UUID(hashlib.sha256(text).hexdigest()[:32]) |
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 http://snippet.gabory.fr/snippet/9/ | |
# Similar to `cut -d ":" -f 1 | sort | uniq -c | sort -n` | |
# | |
# Usage: flake8 venv | python cutfdu.py | |
# Mock : flake8 venv | cut -d ":" -f 1 | sort | uniq -c | sort -n | |
# | |
# From Natim with love (2014-02-14) | |
import itertools | |
import sys |
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
var value = 0; | |
var regex = /[+-]?\d+\,\d+/g; | |
$('.ember-view .price').each(function(){ value += $(this).html().match(regex).map(function(v) { return parseFloat(v.replace(',', '.')); })[0] }); | |
console.log(value); |
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
SELECT numero, geom FROM parcelle | |
WHERE ST_Intersects(geom, ST_Transform( | |
ST_ConvexHull('SRID=4326;MULTIPOINT(2.232 48.818, | |
2.246 48.82, | |
2.241 48.809, | |
2.232 48.818)'::geometry), | |
27572)); |
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 print_function | |
from six.moves import input, xrange, map | |
from string import ascii_letters | |
alphabet = "ABCDEFGHIJKLMNOPQRSTUVXYZ" | |
def get_maps(keyword): | |
keyword = keyword.upper().replace('W', 'V') |
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 -*- | |
M = [["A", "B", "C", "D", "E"], | |
["F", "G", "H", "IJ", "K"], | |
["L", "M", "N", "O", "P"], | |
["Q", "R", "S", "T", "U"], | |
["V", "W", "X", "Y", "Z"]] | |
def decode(texte): |
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
{% load static i18n i18nurl %} | |
{% get_available_languages as LANGUAGES %} | |
{% for language_code, language_name in LANGUAGES %} | |
{% language language_code %} | |
<li><a href="#{{ language_code }}" class="{% if language_code == LANGUAGE_CODE %} active{% endif %}" data-lang="{{ language_code }}" data-next="{% current_i18nurl language_code %}"><i class="sprite-flag-{{ language_code }}"></i>{{ language_name }}</a></li> | |
{% endlanguage %} | |
{% endfor %} | |
<script type="text/javascript"> |
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
postgresql_db_user: novaauth | |
postgresql_db_password: novaauth | |
postgresql_db_name: novaauth |