View Performance .htacces
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
# ###################################################################### | |
# # WEB PERFORMANCE # | |
# ###################################################################### | |
# ---------------------------------------------------------------------- | |
# | Compression | | |
# ---------------------------------------------------------------------- | |
<IfModule mod_deflate.c> |
View gzipping .htacces
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
# ###################################################################### | |
# # WEB PERFORMANCE # | |
# ###################################################################### | |
# ---------------------------------------------------------------------- | |
# | Compression | | |
# ---------------------------------------------------------------------- | |
<IfModule mod_deflate.c> |
View gist:38bdc173ff323d9e0035
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 //different sizes ?> | |
<?php $large_image_urlLarge = wp_get_attachment_image_src( get_post_thumbnail_id(), 'imgBlogLarge' ); ?> | |
<?php $large_image_urlMedium = wp_get_attachment_image_src( get_post_thumbnail_id(), 'imgBlogMedium' ); ?> | |
<?php $large_image_urlSmall = wp_get_attachment_image_src( get_post_thumbnail_id(), 'imgBlogSmall' ); ?> | |
<?php //title == alt ?> | |
<?php $title = get_post(get_post_thumbnail_id())->post_title; //The Title ?> | |
<picture> | |
<!--[if IE 9]><video style="display: none;"><![endif]--> |
View Simple grid
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
//================================= | |
/* Simple grid */ | |
@mixin simple-grid($nombre-items , $margin-right ){ | |
width: ( (100% - ( ($nombre-items - 1) * $margin-right) ) / $nombre-items); | |
margin-right: $margin-right; | |
float:left; | |
&:nth-child(n) { | |
margin-right: $margin-right; |
View ImageLightbox.js
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
jQuery( function( $ ) | |
{ | |
// ACTIVITY INDICATOR | |
var activityIndicatorOn = function() | |
{ | |
$( '<div id="imagelightbox-loading"><div></div></div>' ).appendTo( 'body' ); | |
}, | |
activityIndicatorOff = function() | |
{ |
View Insert 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
<?php | |
// Connexion BDD | |
mysql_connect('localhost', 'hostname', 'password'); // | |
mysql_select_db('mybdd'); | |
mysql_query("SET NAMES 'utf8'"); | |
// on start la session | |
session_start(); | |
ini_set('session.gc_maxlifetime', 2592000); // durée de la session => 30 jours (2592000 secondes) |
View gist:11326078
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
//Remove [...] string using Filters | |
<?php | |
function new_excerpt_more( $more ) { | |
return '<div class="read-more"><a href="'. get_permalink( get_the_ID() ) . '">Read More</a></div>'; | |
} | |
add_filter('excerpt_more', 'new_excerpt_more'); | |
//Control Excerpt Length using Filters | |
function custom_excerpt_length( $length ) { | |
return 30; |
View .htaccess wp-config.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
<files wp-config.php> | |
order allow,deny | |
deny from all | |
</files> |
View Resume xmots
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
//---------------------------------------------------------------------------------------------------- | |
// Fonction pour limiter le nombre de caractere | |
//---------------------------------------------------------------------------------------------------- | |
function resume_xmots($MaChaine,$xmots) | |
{ | |
$ChaineTab=explode(" ",$MaChaine); | |
for($i=0;$i<$xmots;$i++) | |
{ | |
$NouvelleChaine.=" "."$ChaineTab[$i]"; | |
} |
View detectingIE
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 short snippet for detecting versions of IE in JavaScript | |
// without resorting to user-agent sniffing | |
// ---------------------------------------------------------- | |
// If you're not in IE (or IE version is less than 5) then: | |
// ie === undefined | |
// If you're in IE (>=5) then you can determine which version: | |
// ie === 7; // IE7 | |
// Thus, to detect IE: | |
// if (ie) {} |
NewerOlder