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 | |
class BackupDatabaseCronModuleFrontController extends ModuleFrontController | |
{ | |
public function init() | |
{ | |
try { | |
$this->checkAccess(); | |
$this->module->cron(); | |
header( "backup ok", true ,200 ); |
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 | |
/** | |
* playground | |
* | |
* functionnal use is at the bottom. | |
* | |
* Don't damn me, that's a playground. | |
*/ | |
class Pipe { |
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
<html> | |
<head> | |
<script type="text/javascript"> | |
document.addEventListener("DOMContentLoaded", (event) => { | |
console.log('hello') | |
}) | |
</script> | |
</head> | |
<body> | |
<button>Action !</button> |
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 declare(strict_types=1); | |
/** | |
* Writes messages to stderr or stdout. | |
* | |
* @author Sébastien Monterisi <https://gist.github.com/SebSept/> | |
* @throws FailureToWriteToFile | |
*/ | |
function stdErr(string $message): void { stdLog('php://stderr', $message); } | |
function stdOut(string $message): void { stdLog('php://stdout', $message); } |
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 declare(strict_types=1); | |
// this may be defined in the enviroment, not in the code. | |
// or can we find a system path for auto setup persistent cache ? | |
define('CACHE_FILE_TEMPLATE','/home/seb/.cache/test_php_{file}.txt'); | |
// usage : get some data : get('the key') // return some string content | |
print 'get("the stuff to fetch") -> "'.get('some stuffx.').'"'.PHP_EOL; | |
// you can also use the 'tool' functions |
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
// document.ready without js | |
document.addEventListener("DOMContentLoaded", function(event) { | |
//do work | |
}); |
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 declare(strict_types=1); | |
/** | |
* Script pour vider le cache de prestashop. | |
* | |
* Résoud le problème de lenteur lié a l'exces de ressource consommé par le vidage du cache. | |
* Script a placer à la racine de l'installation de prestashop. | |
* | |
* Fonctionnement | |
* 1 - création d'un dossier vide destiné a être le nouveau dossier de cache. | |
* 2 - renomage du dossier de cache actuel |
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 | |
class imu | |
{ | |
/** | |
* @var float | |
*/ | |
private $one; | |
/** | |
* @var float |
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
#!/bin/env bash | |
# installation des versions de php | |
PHPS=('php56' 'php72' 'php73' 'php80') | |
EXTENSIONS=('fpm' 'gd' 'xml' 'zip' 'mysqlnd' 'mysqli' 'yaml' 'soap' 'mbstring' 'intl' 'pecl-zip') | |
dnf install "https://rpms.remirepo.net/fedora/remi-release-33.rpm" -y | |
for PHP in "${PHPS[@]}" | |
do |
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 SebSept\Adminproductquantities\Controller; | |
use PrestaShopBundle\Api\Stock\Movement; | |
use PrestaShopBundle\Controller\Admin\FrameworkBundleAdminController; | |
use PrestaShopBundle\Entity\ProductIdentity; | |
use PrestaShopBundle\Entity\Repository\StockRepository; | |
use PrestaShopBundle\Service\ProductService; |