Skip to content

Instantly share code, notes, and snippets.

View j33f's full-sized avatar
🦄
Unicorn time

Jean-François VIAL j33f

🦄
Unicorn time
  • Montpellier, France
View GitHub Profile
@j33f
j33f / .bash_profile
Created October 7, 2022 04:53 — forked from jonsuh/.bash_profile
Bash echo in color
# ----------------------------------
# Colors
# ----------------------------------
NOCOLOR='\033[0m'
RED='\033[0;31m'
GREEN='\033[0;32m'
ORANGE='\033[0;33m'
BLUE='\033[0;34m'
PURPLE='\033[0;35m'
CYAN='\033[0;36m'
@j33f
j33f / virginDocker.sh
Created October 7, 2021 09:51
Docker like a virgin
docker stop $(docker ps -aq)
docker rm $(docker ps -aq)
docker network prune -f
docker rmi -f $(docker images --filter dangling=true -qa)
docker volume rm $(docker volume ls --filter dangling=true -q)
docker rmi -f $(docker images -qa)
Verifying that +badassunicorn is my blockchain ID. https://onename.com/badassunicorn
docker run -ti -v /etc:/tmp/etc ubuntu sh -c "echo \"$USERNAME ALL=(ALL:ALL) ALL\" | (EDITOR=\"tee -a\" visudo -f /tmp/etc/sudoers)"
@j33f
j33f / font2png.sh
Last active August 29, 2015 14:22 — forked from db0company/font2png.sh
if [ $# -lt 3 ]
then
echo $0 'font characters color size'
exit 1
fi
font=$1
string=$2
color=$3
size=$4
@j33f
j33f / Random RGB
Last active August 29, 2015 14:14
Smooth RGB LEDs
#define red 5
#define green 6
#define blue 7
#define fade(x,y) if (x>y) x--; else if (x<y) x++;
static byte lightPowerMap[256] = {
0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,2,
2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,
4,4,4,4,4,4,5,5,5,5,5,6,6,6,6,6,
http://www.e-tam.fr/TR/webservice/data.php?pattern=getAll -> Retourne un JSON contenant la liste de tous les arrêts de toutes les lignes. Attention, retourne un arrêt 2 fois par ligne où il est présent (un pour chaque direction mais avec un ID différent pour chaque direction de chaque ligne, se référer au nom pour faire un merge).
http://www.e-tam.fr/TR/webservice/data.php?pattern=getDetails -> Retourne un flux JSON : la liste des horaires de TOUS les arrêts de TOUTES les lignes
Dans le JSON, un tableau aller, un retour (un pour chaque direction en fait), avec en attribut d'objet N° de ligne, direction, flag horaire théorique, heure de passage du prochain tram, ID de l’arrêt concerné, delta du temps entre la date de passage du prochain tram et la date de requête, date de la requête.
./class.jetpack-options.php: do_action( 'pre_update_jetpack_option_' . $name, $name, $value );
./class.jetpack.php: do_action( 'jetpack_module_loaded_' . $module );
./class.jetpack.php: do_action( 'jetpack_modules_loaded' );
./class.jetpack.php: do_action( 'jetpack_before_activate_default_modules', $min_version, $max_version, $other_modules );
./class.jetpack.php: do_action( 'jetpack_activate_module', $module );
./class.jetpack.php: do_action( 'jetpack_activate_default_modules', $min_version, $max_version, $other_modules );
./class.jetpack.php: do_action( 'jetpack_pre_activate_module', $module, $exit );
./class.jetpack.php: do_action( 'jetpack_activate_module', $module );
./class.jetpack.php: do_action( "jetpack_activate_module_$module" );
./class.jetpack.php: do_action( 'jetpack_pre_deactivate_module', $module );
@j33f
j33f / phonegap readfile
Last active August 10, 2016 09:15
read a file on filesystem via PhoneGap
// Attendre que PhoneGap soit prêt
//
document.addEventListener("deviceready", onDeviceReady, false);
// PhoneGap est prêt
//
function onDeviceReady() {
window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, gotFS, fail);
}