Skip to content

Instantly share code, notes, and snippets.

View bazooka07's full-sized avatar

bazooka07 bazooka07

View GitHub Profile
<?php
$staticGroups = array();
foreach($this->plxMotor->aStats as $staticId=>$staticPage) {
if(
intval($staticPage['active']) === 1 and
// $staticPage['menu'] !== 'oui' and
!empty(trim($staticPage['group']))
) {
$group = $staticPage['group'];
if(!array_key_exists($group, $staticGroups)) {
@bazooka07
bazooka07 / class.plx.medias.partiel.php
Created November 27, 2018 21:19
3 fonctions ré-écrites dans class.plx.medias.php pour le CMS PluXml
/**
* Méthode qui retourne un tableau de tous les dossiers et sous-dossiers d'un répertoire.
*
* @author J.P. Pourrez (bazooka07)
**/
private function _getAllDirs() {
$result = array();
$pattern = '*/';
$offset = strlen($this->path);
for($i=1; $i<10; $i++) {
@bazooka07
bazooka07 / prechauffage.php
Last active October 24, 2018 15:18
Pour Pluxml
/**
* Méthode qui effectue une analyse de la situation et détermine
* le mode à appliquer. Cette méthode alimente ensuite les variables
* de classe adéquates
*
* @return null
* @author Anthony GUÉRIN, Florent MONTHEL, Stéphane F
**/
public function prechauffage() {
@bazooka07
bazooka07 / plxshow-staticlist.php
Last active October 19, 2018 16:08
plxShow::staticlist(...)
/*
Ajouter les cosntantes de class comme ceci :
class plxShow {
const STATICLIST_FORMAT = <<< FMT1
<li class="#static_class #static_status" id="#static_id"><a href="#static_url">#static_name</a></li>\n
FMT1;
const STATICLIST_GROUP_FORMAT = <<< FMT2
<span class="#group_class #group_status">#group_name</span>
FMT2;
@bazooka07
bazooka07 / french-radios.m3u
Last active September 21, 2018 09:08
Convert m3u playlist in Ka-Radio format
#EXTM3U
# Hello, mostly webradios from France.
# They are independant radios. Support them !
# Ferarock network. Mostly rock music
# http://ferarock.org/
#EXTINF: -1, 666
http://radio666.net:8000/666.mp3
<?php
/* --------- plxShow::artThumbnail() ---------- */
public function artThumbnail($format='<a href="#img_url"><img class="art_thumbnail" src="#img_thumb_url" alt="#img_alt" title="#img_title" /></a>', $echo=true) {
$filename = trim($this->plxMotor->plxRecord_arts->f('thumbnail'));
if(!empty($filename)) {
$img_url = $this->plxMotor->urlRewrite($filename);
$img_thumb = plxUtils::thumbName($filename);
$replaces = array(
'#img_url' => $img_url,
@bazooka07
bazooka07 / blur.html
Last active June 15, 2018 12:18
Flouter une page au survol d'une image
<!DOCTYPE html>
<html lang="fr">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Flouter une page au survol d'une image</title>
<style>
.container {
display: flex;
@bazooka07
bazooka07 / encrypt.lua
Last active March 11, 2024 16:28
ESP8266 - encryption with LUA, Python 3 and PHP 7.1
-- Nodemcu 2.2.0.0 - LUA version 5.1.4
method = 'AES-CBC'
key = '1aec7447f7a919ef2910bd897bf869fe' -- md5('You are completely crazy')
values = '{"epoc":1528711193,"temperature":28.2,"humidity":41.1,"timestamp":"2018-06-11T09:59:53","client_id":"esp8266-1458415"}'
iv = 'tARGGrNw39xRlQ4D' -- length of 16 chars
print('length of values : '..#values)
print('key : '..key)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Hexagone-1</title>
<style>
* { margin:0; padding:0; box-sizing: border-box; }
body {
font-size: 12pt;
font-family: 'Noto Sans';
Options +Indexes
IndexOptions HTMLTable Charset=UTF-8 NameWidth=* DescriptionWidth=*
AddDescription "Les trois grâces" p1120276.jpg
AddDescription "Coucou, c'est nous !'" p1120283.jpg
AddDescription "L'homme de fer" p1120285.jpg
AddDescription "Ça grimpe !" p1260042.jpg
AddDescription "Place de l'Obélisque" p2030071.jpg
AddDescription "Émetteur radio" p3030099.jpg
AddDescription "Le Rhône à Andance" p4070117.jpg