Skip to content

Instantly share code, notes, and snippets.

View revolunet's full-sized avatar
🐫
Killing bugz

Julien Bouquillon revolunet

🐫
Killing bugz
View GitHub Profile
@revolunet
revolunet / countries.py
Created April 2, 2012 19:50
Countries list + en/fr
# -*- encoding: UTF-8 -*-
COUNTRIES = {
u'DZA': {'code': u'DZA', 'fr': u'Algerie', 'en': u'Algeria', 'num': 12},
u'AGO': {'code': u'AGO', 'fr': u'Angola', 'en': u'Angola', 'num': 24},
u'EGY': {'code': u'EGY', 'fr': u'Egypte', 'en': u'Egypt', 'num': 818},
u'BGD': {'code': u'BGD', 'fr': u'Bangladesh', 'en': u'Bangladesh', 'num': 50},
u'NER': {'code': u'NER', 'fr': u'Niger', 'en': u'Niger', 'num': 562},
u'LIE': {'code': u'LIE', 'fr': u'Liechtenstein', 'en': u'Liechtenstein', 'num': 438},
u'NAM': {'code': u'NAM', 'fr': u'Namibie', 'en': u'Namibia', 'num': 516},
@revolunet
revolunet / xor.py
Created April 18, 2012 09:14
Simple python XOR encrypt/decrypt
#
# NB : this is not secure
# from http://code.activestate.com/recipes/266586-simple-xor-keyword-encryption/
# added base64 encoding for simple querystring :)
#
def xor_crypt_string(data, key='awesomepassword', encode=False, decode=False):
from itertools import izip, cycle
import base64
if decode:
@revolunet
revolunet / geolocate.php
Created April 26, 2012 11:19
sql based geolocation query
#
# geolocate points 50km around a defined latitude/longitude
#
$latitude = 42.45679;
$longitude = 8.345678;
$sql = "SELECT ID, 3956 * 2 * ASIN(SQRT(POWER(SIN((" . $latitude . " - LAT) * 0.0174532925 / 2), 2) + ";
$sql .= "COS(" . $latitude . " * 0.0174532925) * COS(LAT * 0.0174532925) * POWER(SIN((" . $longitude . " - LON) * 0.0174532925 / 2), 2) ";
$sql .= ")) as DISTANCE from houses having DISTANCE < 50 ORDER BY DISTANCE ASC ";
@revolunet
revolunet / github.md
Last active October 6, 2015 08:27
Whats missing from Github

Missing features on Github

After some years enjoying github awesomeness, heres what i miss most. Add your comments :)

Id love to use github for agile project management so issues are very important to me :)

Repositories :

@revolunet
revolunet / revolunet.ascii
Created June 21, 2012 15:09
revolunet ascii logo
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▄▄▄[38;5;
@revolunet
revolunet / proxy.py
Created June 26, 2012 14:17
proxify http with django
# -*- encoding: UTF-8 -*-
#
# sample django HTTP proxy
#
import urlparse
import requests
import logger
@revolunet
revolunet / regions.json
Last active September 6, 2017 10:13
liste regions et departements francais france
{
"regions": {
"alsace": [67, 68],
"aquitaine": [40, 47, 33, 24, 64],
"auvergne": [43, 3, 15, 63],
"basse-normandie": [14, 61, 50],
"bourgogne": [21, 58, 71, 89],
"bretagne": [29, 35, 22, 56],
"centre": [45, 37, 41, 28, 36, 18],
"champagne-ardenne": [10, 8, 52, 51],
@revolunet
revolunet / imgmixer.kv
Created July 27, 2012 09:10
sample kivy image mixer
#:kivy 1.3
<WonPopup>:
title: 'YOU WIN'
auto_dismiss: False
size_hint: None, None
size: 300, 200
btn_restart: btn_restart
btn_close: btn_close
content: content
@revolunet
revolunet / agile.md
Last active October 9, 2015 04:58
Agile web tools