Skip to content

Instantly share code, notes, and snippets.

Antoine Briand antoine-briand

  • France
Block or report user

Report or block antoine-briand

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View quick_text_index.py
'''
Nous avons deux textes en entrée, texte_a et texte_b qui parlent tous les deux de Labrador (l'un étant une région du Canada et l'autre étant une race de chien).
'''
import re
from tabulate import tabulate
texte_a = '''Le Labrador est la région continentale de la province canadienne de Terre-Neuve-et-Labrador. A ne pas confondre avec la race de chien labrador.'''
texte_b = '''Le retriever du Labrador, plus communément appelé labrador retriever ou plus simplement labrador, est une race de chiens originaire du Royaume-Uni. C'est un chien de taille moyenne, à l'allure ronde et robuste, de couleur entièrement sable, chocolat ou noir. Issu du chien de Saint-John, la race a été importée puis développée au Royaume-Uni et au Canada. Le labrador est actuellement l'une des races les plus répandues dans le monde.'''
@antoine-briand
antoine-briand / imapsync-interactive.py
Last active Mar 23, 2018
Interactive ImapSync tool written in python 3. Useful to sync imap accounts across different mail servers. Python 3 and imapsync must be installed on the machine.
View imapsync-interactive.py
# coding: utf8
import os, csv
print("Welcome to the ImapSync interactive")
mode = input("Interactive mode or Read CSV file ? (1/2) ")
if mode == "2":
#host1;user1;password1;host2;user2;password2
file = input("File path : ")
if file:
print("Reading file")
@antoine-briand
antoine-briand / client.py
Created Mar 10, 2017
python-mongo-reddit
View client.py
from flask import Flask, jsonify
from flask import request
from bson.json_util import dumps
from flask_cors import CORS
from pymongo import MongoClient
client = MongoClient('mongodb://localhost:27017/')
db = client['reddit']
@antoine-briand
antoine-briand / gsprpsc
Created Aug 17, 2016
ZSH Alias : Git push custom command (stash / pull rebase / push / stash apply / stash clear)
View gsprpsc
alias gsprpsc="git stash && git pull --rebase && git push && git stash apply && git stash clear"
@antoine-briand
antoine-briand / how-to-configure-mailgun-ghost-with-google-cloud
Created Aug 2, 2016
I had some trouble setting Mailgun for Ghost (Blog) with a server hosted on google cloud (compute engine). In fact it's really easy. Just replace the mail configuration in config.js with this gist and it's done !
View how-to-configure-mailgun-ghost-with-google-cloud
mail: {
transport: 'SMTP',
options: {
service: 'Mailgun',
port: 2525,
auth: {
user: 'postmaster@domain.example',
pass: 'myMailGunPassword'
}
}
@antoine-briand
antoine-briand / naive_and_aware_datetimes_python
Created Nov 18, 2013
To pass through the error "TypeError: can't compare offset-naive and offset-aware datetimes" (Python)
View naive_and_aware_datetimes_python
def compare_dates(last_entry):
utc = pytz.UTC
if last_entry.end_time > utc.localize(datetime.datetime.now()):
return True
return False
View lxc-kickstart.py
import os
print("LXC-KICKSTART - Ajinov : Network Setting")
ip = raw_input("Entrez l'adresse ip > ")
passerelle = raw_input("Entrez la passerelle > ")
hostname = raw_input("Entrez le hostname > ")
os_type = raw_input("Debian ou Ubuntu ? (0/1) > ")
hostname_file = "/etc/hostname"
interface_file = "/etc/network/interfaces"
@antoine-briand
antoine-briand / gist:62a35cb6749952fac206
Created Nov 20, 2015 — forked from pitch-gist/gist:2999707
HTML: Simple Maintenance Page
View gist:62a35cb6749952fac206
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>
You can’t perform that action at this time.