This file contains hidden or 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
| if check_po /home/sam/opquast/pdn/locale/fr/LC_MESSAGES/django.po | grep 'FUZZY'; then | |
| echo "\033[44m----------------------------------------------------\033[0m" | |
| echo "\033[31m FUZZY présent dans locale/fr/LC_MESSAGES/django.po\033[0m" | |
| exit 1 | |
| else | |
| echo -n "\033[32m" | |
| check_po /home/sam/opquast/pdn/locale/fr/LC_MESSAGES/django.po | |
| echo -n "\033[0m" | |
| fi |
This file contains hidden or 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
| dans ~/.gitconfig | |
| [alias] | |
| prev = checkout HEAD^1 | |
| next = "!sh -c 'git log --reverse --pretty=%H master | awk \"/$(git rev-parse HEAD)/{getline;print}\" | xargs git checkout'" | |
| Permet : | |
| git next | |
| git prev |
This file contains hidden or 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
| Mettez le code suivant du le fichier .git/hooks/post-merge de votre repo en local : | |
| #!/bin/bash | |
| # On met ici tous les fichiers (ou pattern de nom) qu'on veut surveiller | |
| # changez les pour les adapter à votre projet | |
| files=('settings.py' 'migrations'); | |
| # on récupère tous les noms de fichiers modifiés depuis le dernier merge | |
| modified_files=`git diff "HEAD@{1}" --name-only` |
This file contains hidden or 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
| # GET DATA | |
| pdftk example.pdf dump_data | |
| pdftk example.pdf dump_data output info.txt | |
| # SET DATA | |
| pdftk example.pdf update_info info.txt output example.pdf |
This file contains hidden or 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 struct | |
| from Crypto.Cipher import DES | |
| def base36encode(number): | |
| """Encode number to string of alphanumeric characters (0 to z). (Code taken from Wikipedia).""" | |
| if not isinstance(number, (int, long)): | |
| raise TypeError('number must be an integer') | |
| if number < 0: | |
| raise ValueError('number must be positive') |
This file contains hidden or 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
| * Mentionner l'url | |
| * Décrire précisemment la procédure | |
| * Identifier le couple OS / UA (plateforme : Exemple Windows 7 IE 8) | |
| * Définir un vocabulaire commun | |
| * Définir la gravité du bug | |
| * Rédiger dans un français correct votre rapport | |
| * Relisez vous | |
| * Vérifier si le bug est reproductible |
This file contains hidden or 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
| #attention vérfier que swap < mémoire vive restante | |
| sudo swapoff -a && swapon -a | |
This file contains hidden or 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 pdn import constants | |
| @register.simple_tag | |
| def get_constant(constant, value, constant_type="CHOICES_DICT"): | |
| try: | |
| return getattr(getattr(constants, constant), constant_type)[int(value)] | |
| except AttributeError: | |
| return "NC" |
This file contains hidden or 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 email import message_from_string | |
| email = message_from_string(data) | |
| for part in email.walk(): | |
| if type_email == "multipart/alternative": | |
| if part.get_content_type() == "text/html": | |
| body = part.get_payload(decode=True) | |
| else: | |
| if part.get_content_type() == "text/plain": | |
| body = part.get_payload(decode=True) |
This file contains hidden or 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 pyquery import PyQuery as pq | |
| from lxml import etree | |
| from django.template.defaultfilters import slugify | |
| my_file = open('/home/sam/feedlist.opml', 'r') | |
| data = my_file.read() | |
| opml = pq(data) | |
| outlines = opml("body > outline") | |