Skip to content

Instantly share code, notes, and snippets.

Working from getLocation()

Nymphea Studio nympheastudio

Working from getLocation()
View GitHub Profile
nympheastudio / unzip.php
Created Feb 2, 2021
dézipper .zip en PHP
View unzip.php
$fichier_zip = '';
$path = pathinfo(realpath($file), PATHINFO_DIRNAME);
$zip = new ZipArchive;
$res = $zip->open($fichier_zip);
if ($res === TRUE) {
} else {
echo "Erreur lors du dezippage ! ";
View gist:480572aa8634299288f108465cfbcda6
//source :
let spinnerWrapper = document.querySelector('.spinner-wrapper');
window.addEventListener('load', function(){ 'none';
nympheastudio / fullbackup.php
Created Aug 25, 2018 — forked from wei/fullbackup.php
CPanel Full Backup Cron Script
View fullbackup.php
// PHP script to allow periodic cPanel backups automatically, optionally to a remote FTP server.
// Cron Job Command: /usr/local/bin/php /home/<cpanel-username>/fullbackup.php
// This script contains passwords. It is important to keep access to this file secure (we would ask you to place it in your home directory, not public_html)
// You need create 'backups' folder in your home directory ( or any other folder that you would like to store your backups in ).
View gist:af514cbd917c2e6488f44de5b7100557
$field_name = 'block_img';
$temp_name = tempnam(_PS_TMP_IMG_DIR_, 'PS');
$salt = sha1(microtime());
$type = strtolower(substr(strrchr($_FILES[$field_name]['name'], '.'), 1));
if ($error = ImageManager::validateUpload($_FILES[$field_name]))
$this->_html .= $this->displayError($error);
elseif (!$temp_name || !move_uploaded_file($_FILES[$field_name]['tmp_name'], $temp_name))
$this->_html .= $this->displayError($this->l('An error occurred during the image upload'));
elseif (!ImageManager::resize($temp_name, dirname(__FILE__).'/img/'.$salt.'.'.$type))
$this->_html .= $this->displayError($this->l('An error occurred during the image upload.'));