This file contains hidden or 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 | |
| /** | |
| * SQLite search ranking user defined function | |
| * Converted from C from SQLite manual: https://www.sqlite.org/fts3.html#appendix_a | |
| */ | |
| function sqlite_rank(string $aMatchinfo, ...$weights): float | |
| { | |
| /* Check that the number of arguments passed to this function is correct. | |
| ** If not, jump to wrong_number_args. Set aMatchinfo to point to the array |
This file contains hidden or 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, string $protocol = 'udp'): array | |
| { |
This file contains hidden or 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/php | |
| <?php | |
| // Note: this code does not contain any DRM removal, DRM removal is made by https://notabug.org/NewsGuyTor/DeDRM_tools-LCP | |
| // | |
| // Install steps: | |
| // Debian/Ubuntu/Mint: apt install php-cli python3 python3-cryptodome python3-lxml zip unzip | |
| // | |
| // How to use? | |
| // Just run: php lcp_download.php FILE.LCPL PASSWORD | |
| // A new FILE_decrypted.epub will be created in the same directory |
This file contains hidden or 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 du Crédit Mutuel | |
| * à destination de Garradin (ou autre logiciel de compta) | |
| * | |
| * https://garradin.eu/ | |
| * | |
| * Ce script prend en argument un répertoire contenant des extraits | |
| * de compte en PDF (ou un seul extrait de compte) et crée un fichier | |
| * CSV importable directement dans Garradin. |
This file contains hidden or 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 | |
| /** | |
| * Returns UNIX timestamp from a NTP server (RFC 5905) | |
| * | |
| * @param string $host Server host (default is pool.ntp.org) | |
| * @param integer $timeout Timeout in seconds (default is 10 seconds) | |
| * @return integer Number of seconds since January 1st 1970 | |
| */ | |
| function getTimeFromNTP($host = 'pool.ntp.org', $timeout = 10) |
This file contains hidden or 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; |
This file contains hidden or 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 | |
| // Licence : domaine public ou WTFPL | |
| // 2018 BohwaZ <http://bohwaz.net/> | |
| function check_ine($ine) | |
| { | |
| if (!function_exists('bcmod')) | |
| { | |
| throw new \LogicException('bcmath is required'); |
This file contains hidden or 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
| #!/bin/bash | |
| which mutool &> /dev/null || (echo "mutool is not installed" && exit 1) | |
| which convert &> /dev/null || (echo "imagemagick is not installed" && exit 1) | |
| which zip &> /dev/null || (echo "zip is not installed" && exit 1) | |
| if [ "$1" = "" ] | |
| then | |
| echo "Usage: $0 File.pdf" | |
| exit |
This file contains hidden or 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
| // Facebook is fascist network AND makes it super hard to delete all your photos! | |
| // Here is a script that will automatically click on buttons | |
| // to delete all your photos one by one from your Facebook account. | |
| // | |
| // 1. Click on the "Photos" tab of your Facebook profile | |
| // 2. Click on the pencil on the right-top corner of a photo | |
| // 3. Note the label of the button to delete a photo | |
| // 4. Click on this button | |
| // 5. Note the label of the confirm button | |
| // 6. Change the following three labels to match the real buttons labels, |
This file contains hidden or 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
| // Instagram doesn't allow to select all your posts, or all your comments, etc. to delete them. | |
| // You can only select them one by one. This is slow as hell. | |
| // Use this to select all the photos, comments, etc. | |
| // 1. Open this page: https://www.instagram.com/your_activity/interactions/likes/ | |
| // 2. click on the "select" button | |
| // 3. Press the F12 key to open the developer tools | |
| // 4. open the console tab in the developer tools | |
| // 5. copy-paste the following code in the command prompt of the console and press enter | |
| // 6. Click on Delete/Unlike button |
NewerOlder