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 format_date_range($start_date, $end_date, $start_time = null, $end_time = null){ | |
$start_date = new \DateTime($start_date); | |
$end_date = new \DateTime($end_date); | |
$return = ''; | |
if($start_date->format('d/m/Y') != $end_date-> format('d/m/Y')){ | |
$return .= 'Du '.$start_date->format('d/m/Y').' '; | |
if($start_time){ | |
$return .= $start_time.' '; |
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
RewriteCond %{HTTPS} off | |
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L] |
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 id | |
FROM events | |
WHERE start >= '2013-07-22' AND end <= '2013-06-13' |
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
/*** | |
* _ _____ | |
* | | | ___| | |
* __ _ __ _ ___ _ __ ___ ___ | |__ ___ |___ \ | |
* / _` |/ _` |/ _ \ '_ \ / __/ _ \ | '_ \ / _ \ \ \ | |
* | (_| | (_| | __/ | | | (_| __/ | | | | (_) /\__/ / | |
* \__,_|\__, |\___|_| |_|\___\___| |_| |_|\___/\____/ | |
* __/ | | |
* |___/ | |
* |
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 | |
/*** | |
* _ _____ | |
* | | | ___| | |
* __ _ __ _ ___ _ __ ___ ___ | |__ ___ |___ \ | |
* / _` |/ _` |/ _ \ '_ \ / __/ _ \ | '_ \ / _ \ \ \ | |
* | (_| | (_| | __/ | | | (_| __/ | | | | (_) /\__/ / | |
* \__,_|\__, |\___|_| |_|\___\___| |_| |_|\___/\____/ | |
* __/ | | |
* |___/ |
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
RewriteEngine On | |
RewriteCond %{REQUEST_URI} !^web | |
RewriteRule ^(.*)$ web/$1 [L] | |
RewriteBase / |
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/sh | |
# | |
# Pour lancer ce script, lancer la commande ci-dessous : | |
# curl -o- https://gist.githubusercontent.com/fabienlege/5dee0d89df4cdbce6d6a42ca43b9b535/raw/webserver_install.sh | bash | |
# | |
echo " | |
_ _____ | |
| | | ___| |
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 | |
$debug_tags = array(); | |
add_action( 'all', function ( $tag ) { | |
global $debug_tags; | |
if ( in_array( $tag, $debug_tags ) ) { | |
return; | |
} | |
echo "<pre>" . $tag . "</pre>"; | |
$debug_tags[] = $tag; | |
} ); |
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
# 1 - Vérifier les performance en temps réel avec htop ou top | |
top | |
# 2 - Vérifier l'espace utilisé du disque dur avec df | |
df -h | |
# 3 - Vérification des performances passés enregistrés par le serveur | |
### 3.a - Vérification de l'usage du CPU | |
### Il faut bien vérifier la colone %idle. |
OlderNewer