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
REGIONS = { | |
'Auvergne-Rhône-Alpes': ['01', '03', '07', '15', '26', '38', '42', '43', '63', '69', '73', '74'], | |
'Bourgogne-Franche-Comté': ['21', '25', '39', '58', '70', '71', '89', '90'], | |
'Bretagne': ['35', '22', '56', '29'], | |
'Centre-Val de Loire': ['18', '28', '36', '37', '41', '45'], | |
'Corse': ['2A', '2B'], | |
'Grand Est': ['08', '10', '51', '52', '54', '55', '57', '67', '68', '88'], | |
'Guadeloupe': ['971'], | |
'Guyane': ['973'], | |
'Hauts-de-France': ['02', '59', '60', '62', '80'], |
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 | |
""" | |
Pre-commit hook for git written in Python. | |
Check if there is any migration number used more than one in each | |
migrations folder of South or Django >= 1.7. | |
You can install this pre-hook by executing the command: | |
ln -s ./git-pre-commit-hook .git/hooks/pre-commit | |
chmod +x .git/hooks/pre-commit |
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 re | |
import oauth2 as oauth | |
from dateutil.parser import parse | |
from json import loads | |
CONSUMER_KEY = "***************" | |
CONSUMER_SECRET = "***************" | |
ACCESS_TOKEN = "***************" | |
ACCESS_TOKEN_SECRET = "***************" |
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
<?php | |
define('SALT_LENGTH', 6); | |
define('ITERATIONS', 10000); | |
/** Génère le hash complet d'un mot de passe donné en clair */ | |
function create_hash($password) { | |
$salt = get_rand_salt(); | |
$hash = get_hash($password, $salt, ITERATIONS); | |
return ITERATIONS."$".$salt."$".$hash; |
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 re | |
# List of format available on Youtube | |
YOUTUBE_CHOICES = ("default", "hqdefault", "0", "1", "2") | |
# Default image if no thumbnail is found | |
NO_PREVIEW = "/static/img/no_preview.png" | |
def get_video_thumbnail(url, version="hqdefault"): |