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
function do_post_request($url, $data, $optional_headers = null) { | |
$params = array('http' => array( | |
'method' => 'POST', | |
'content' => $data | |
)); | |
if ($optional_headers !== null) { | |
$params['http']['header'] = $optional_headers; | |
} | |
$ctx = stream_context_create($params); |
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
### Install new version of gcc | |
tar xzf gcc-4.6.2.tar.gz | |
cd gcc-4.6.2 | |
./contrib/download_prerequisites | |
cd .. | |
mkdir objdir | |
cd objdir | |
$PWD/../gcc-4.6.2/configure --prefix=/opt/gcc-4.6.2 | |
make |
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
Boot from live CD | |
Start Terminal | |
sudo apt-get purge ubiquity-slideshow-mint | |
Close Terminal | |
Start installation process |
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
error_reporting(E_ALL); | |
ini_set('display_errors', '1'); |
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
dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d' | xargs sudo apt-get -y purge |
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
if(!function_exists('isFrenchHoliday')) | |
{ | |
function isFrenchHoliday($str) | |
{ | |
$ts = (preg_match('/^[0-9]{10}$/', $str)) ? $str : strtotime($str); | |
$date = date("md", $ts); | |
if($date == '0101') return true; // 1er janvier | |
if($date == '0501') return true; // 1er mai | |
if($date == '0508') return true; // 8 mai | |
if($date == '0714') return true; // 14 juillet |
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
SELECT CONCAT('ALTER TABLE ',table_schema,'.',table_name,' ENGINE=InnoDB;') | |
FROM information_schema.tables | |
WHERE table_schema NOT IN ('mysql','test','performance_schema','information_schema') | |
AND ENGINE='MyISAM' |
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
// init multi handler | |
$multihandler = curl_multi_init(); | |
$handlers = $result = array(); | |
... | |
// init each url | |
foreach ($urls as $i) { | |
$handlers[$i] = curl_init($i); | |
curl_setopt($handlers[$i], CURLOPT_RETURNTRANSFER, TRUE); |
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
/*! | |
* _prompt - A pure JavaScript prompt modal v1.0 | |
* https://gist.github.com/spin0us/0fbfe6b0d2cca8a0efca2b67c14b3876 | |
* | |
* Author: Spin0us | |
* | |
* Date: 2022-03-30 | |
*/ | |
'use strict'; | |
const _prompt = function(args){ |
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
/*! | |
* A pure JavaScript combobox v1.3 | |
* https://gist.github.com/spin0us/fb81680d5761bfb810446005b2fe6e6c | |
* | |
* Author: Spin0us | |
* | |
* Date: 2022-04-01 | |
*/ | |
'use strict'; | |
document.querySelectorAll('select[data-search="true"]').forEach(elm => { |
OlderNewer