Skip to content

Instantly share code, notes, and snippets.

View atierant's full-sized avatar
👨‍💻
Man@Work

Arnaud Tiérant atierant

👨‍💻
Man@Work
View GitHub Profile
@atierant
atierant / helper.php.sh
Created October 11, 2016 15:31 — forked from Avalarion/helper.php.sh
First Try with GitLab CI
#!/bin/sh
# Settings for a PHP Project
# Using:
# * PHP Lint
# *- PHP CS
# *- PHP Analyzer
# *- EmptyLines Checker
# *- Scrutinizer
# * PHPCPD
@atierant
atierant / genColorCodeFromText.php
Created March 2, 2016 14:21 — forked from mrkmg/genColorCodeFromText.php
Generate a unique color based on text input
<?php
/*
* Outputs a color (#000000) based Text input
*
* @param $text String of text
* @param $min_brightness Integer between 0 and 100
* @param $spec Integer between 2-10, determines how unique each color will be
*/
function genColorCodeFromText($text,$min_brightness=100,$spec=10)
@atierant
atierant / load-google-maps.js
Created February 4, 2016 16:26 — forked from gbakernet/load-google-maps.js
Load Google Maps API using jQuery Deferred.
/*!
* JavaScript - loadGoogleMaps( version, apiKey, language )
*
* - Load Google Maps API using jQuery Deferred.
* Useful if you want to only load the Google Maps API on-demand.
* - Requires jQuery 1.5
*
* Copyright (c) 2011 Glenn Baker
* Dual licensed under the MIT and GPL licenses.
*/
To install redis from debian backports we need to add the backports sources.
1. Add to /etc/apt/sources.list:
deb http://backports.debian.org/debian-backports squeeze-backports main
2. Retrieve debian key
$ gpg --keyserver pgp.mit.edu --recv-keys AED4B06F473041FA
@atierant
atierant / cheerlights.php
Last active December 16, 2015 00:19
LedBorg examples ported to PHP. All examples are ported from the Python orginals @ http://piborg.org/ledborg/examples
#!/usr/bin/env php
<?php
/**
* Script to make your LedBorg pick random colours at a regular interval
*
* PHP version 5
*
* @category PiBorg
* @package PiBorg
* @author Arnaud TIERANT <at@synap.fr>
import imaplib
import email
#connect to gmail
mail = imaplib.IMAP4_SSL('imap.gmail.com')
mail.login('email@gmail.com','yourPassWordPlease')
mail.select('inbox')
mail.list()
@atierant
atierant / readIMAP.class.php
Last active December 14, 2015 20:18
Permet de lire en IMAP le contenu d'une boite via EZC avec ezcMailImap*
<?php
/*
/// File containing the ReadIMAPController class
*/
class ReadIMAPController {
/******************************** Class Attributes ***********************************/
/*
/// URL of the server
///