Skip to content

Instantly share code, notes, and snippets.

View bazooka07's full-sized avatar

bazooka07 bazooka07

View GitHub Profile
@bazooka07
bazooka07 / critical-functions.php
Created August 1, 2022 09:23
Contenu d'une page statique dans le CMS PluXml pour lister les fonctions critiques de PHP
<?php
/**
* Script à insérer dans une page statique de PluXml pour vérifier les fonctions critiques de PHP
* encore actives.
* les fonctions à désactiver peuvent être listées dans la directive disable_functions du fichier php.ini
*
* https://pluxml.org/
* https://forum.pluxml.org/discussion/7232/pluxml-5-8-8-released
* https://www.php.net/manual/fr/ini.core.php#ini.disable-functions
* https://www.tarlogic.com/blog/disable_functions-bypasses-and-php-exploitation/
@bazooka07
bazooka07 / _boot.py
Created January 18, 2022 08:56
_boot.py for Micropython on esp32 board
import gc
import uos
from flashbdev import bdev
from machine import Pin, Timer, Signal
from time import sleep_ms
# For ESP32-C3 LilyGo-T-OI-PLUS
LED_IN = Pin(3, Pin.OUT, 1)
LED_IN.off()
@bazooka07
bazooka07 / commentaires.php
Last active January 17, 2021 11:19
Modification du template commentaires.php dans le thème "defaut" de PluXml pour afficher un avatar à chaque commentaire
<?php if(!defined('PLX_ROOT')) exit; ?>
<?php if($plxShow->plxMotor->plxRecord_coms): ?>
<?php
/*
* Rajouter la règle suivante dans theme.css :
.comment.avatar {
display: grid;
@bazooka07
bazooka07 / parthenay.php
Created January 15, 2021 22:06
Gére un avatar depuis une collection de blasons
<!DOCTYPE html>
<?php
// https://forum.pluxml.org/discussion/6935/image-personnalisee-pour-chaque-commentaire
// https://fr.wikipedia.org/wiki/Armorial_des_communes_de_France
// Demo : https://kazimentou.fr/divers/parthenay/
// wget -x -B https://armorial.cc-parthenay-gatine.fr/data/medias/ -i parthenay.lst
const URL_SOURCE = 'https://armorial.cc-parthenay-gatine.fr/';
@bazooka07
bazooka07 / static-contact.php
Last active November 2, 2020 15:20
Modèle de page statique pour PLuXml pour une demande de contact
<?php
if(!defined('PLX_ROOT')) { exit; }
if(version_compare(PLX_VERSION, '6.0.0', '<')) {
include_once PLX_CORE . 'lib/class.plx.token.php';
if($plxShow->plxMotor->aConf['capcha']) {
include_once PLX_CORE . 'lib/class.plx.capcha.php';
}
}
@bazooka07
bazooka07 / script.js
Created September 12, 2020 07:30
Example for nodemcu-firmware
(function() {
'use strict'
const $ = function(id) { return document.getElementById(id);}
$('setTime').onclick = function(event) {
const d = new Date();
ws.send('setTime=' + d.getTime());
};
$('relayBtn').onclick = function(event) {
@bazooka07
bazooka07 / admin.css
Created May 25, 2020 21:39
Interface plus agréable du back-office de PLuXml 5.8.3
thead,
tbody tr:not(.new) td:first-of-type:not([colspan]),
table[data-rows-num] tr[draggable] td:first-of-type,
form .sidebar {
background-color: #e0e0e0;
color: #000;
}
.menu.expanded li {
margin-left: 0.75rem;
}
@bazooka07
bazooka07 / index.html
Created January 14, 2020 16:04
Gestion de CORS : infos.html est téléchargé dans un iframe du fichier index.html. Quand on clique sur une playlist, il envoie un message avec la valeur de href à index.html. Les 2 fichiers sont sur des serveurs différents
<!DOCTYPE html>
<html lang="en">
<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>sans titre</title>
<style>
* { margin: 0; padding: 0; }
table { width: 100%; border-collapse: collapse; border: 1px solid #444; }
@bazooka07
bazooka07 / sendLostpassword.php
Last active January 13, 2020 16:08
Ré-écriture de plxAdmin::sendLostPasswordEmail pour pluxml.org
// A modifier dans le fichier core/lib/class.plx.admin.php
public function sendLostPasswordEmail($loginOrMail) {
if (!empty($loginOrMail) and plxUtils::testMail(false)) {
foreach($this->aUsers as $user_id => $user) {
if(!$user['active'] or $user['delete'] or empty($user['email'])) { continue; }
if($user['login'] == $loginOrMail OR $user['email'] == $loginOrMail) {
// Attention à l'unicité des logins !!!
// token and e-mail creation
@bazooka07
bazooka07 / ka_radio.py
Created April 21, 2019 20:56
Play your .pls or .m3u file with Ka-Radio32
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
Listen on Ka-Radio your .pls or .m3u file from :
- your computer
- https://laradiofm.com (choose pls format for streaming)
- https://directory.shoutcast.com/ (choose downloading)
- https://www.internet-radio.com
- https://dirble.com