View get_ssl_expiry.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Return number of days before certificate expiry from a HTTPS URL | |
* Usage: get_ssl_certificate_expiry('https://www.framasoft.net/') | |
* => int(45) | |
* @author bohwaz | |
*/ | |
function get_ssl_certificate_expiry(string $url): ?int | |
{ |
View dns_get_record_from.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Make a DNS a request to a custom nameserver, this is similar to dns_get_record, but allows you to query any nameserver | |
* Usage: dns_get_record_from('ns.server.tld', 'A', 'mydomain.tld'); | |
* => ['42.42.42.42'] | |
* @author bohwaz | |
*/ | |
function dns_get_record_from(string $server, string $type, string $record): array | |
{ |
View save_twitter_thread.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env php | |
<?php | |
/* | |
This file is part of KD2FW -- <http://dev.kd2.org/> | |
Copyright (c) 2001-2019 BohwaZ <http://bohwaz.net/> | |
All rights reserved. |
View cavites.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Mode d'emploi : créer un répertoire vierge et lancer "php cavites.php" | |
const JSON_URL = 'https://www.georisques.gouv.fr/webappReport/ws/telechargement/cavites?anneemin=2003'; | |
const PROJECTIONS = [ | |
1 => 'LambertI', | |
2 => 'LambertII', | |
3 => 'LambertIII', |
View archive_twitter.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env php | |
<?php | |
/* | |
This file is part of KD2FW -- <http://dev.kd2.org/> | |
Copyright (c) 2001-2019 BohwaZ <http://bohwaz.net/> | |
All rights reserved. |
View garradin-plugin-login.diff
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Index: src/include/lib/Garradin/Membres/Session.php | |
================================================================== | |
--- src/include/lib/Garradin/Membres/Session.php | |
+++ src/include/lib/Garradin/Membres/Session.php | |
@@ -157,10 +157,21 @@ | |
protected function deleteAllRememberMeSelectors($user_id) | |
{ | |
return $this->db->delete('membres_sessions', $this->db->where('id_membre', $user_id)); | |
} |
View php-8.1-strftime.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace PHP81_BC; | |
/** | |
* Locale-formatted strftime using \IntlDateFormatter (PHP 8.1 compatible) | |
* This provides a cross-platform alternative to strftime() for when it will be removed from PHP. | |
* Note that output can be slightly different between libc sprintf and this function as it is using ICU. | |
* | |
* Usage: | |
* use function \PHP81_BC\strftime; |
View db.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* $db = new DB('file.sqlite'); | |
* var_dump($db->simple('SELECT * FROM table WHERE name = ?;', 'My Name')); | |
* var_dump($db->simpleSingle('SELECT * FROM table WHERE date > ? LIMIT 1;', '2020-01-01')); | |
* var_dump($db->simpleColumn('SELECT birthdate FROM table WHERE name = ?;', 'David Lynch')); | |
*/ | |
class DB extends \SQLite3 |
View mijia_temperature.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Reads data from LYWSD03MMC Xiaomi Mijia temperature sensor | |
* and stores it in a SQLite database. | |
* | |
* @author BohwaZ <https://bohwaz.net/> | |
* @see https://github.com/davi-domo/Xiaomi-Mijia-LYWSD03MMC-/blob/main/mijia_bd/MIJIA_MULTI_BD.sh | |
* @see https://smhosy.blogspot.com/2021/01/quelle-temperature-et-hydrometrie-dans.html | |
* @see https://www.fanjoe.be/?p=3911 | |
* |
View extract-paypal-csv.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Extracteur de données des relevés de compte Paypal | |
* à destination de Garradin (ou autre logiciel de compta) | |
* | |
* https://garradin.eu/ | |
* | |
* Ce script prend en argument un fichier CSV exporté de Paypal | |
* https://business.paypal.com/merchantdata/reportHome?reportType=DLOG | |
* et produit un import exploitable dans Garradin |
NewerOlder