This file contains hidden or 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 | |
/* | |
* Documentation : | |
* https://docs.gravityforms.com/ | |
* https://gravitywiz.com/gravity-forms-hook-reference/ | |
*/ | |
// On execute ce code sinon il fait les modifications également quand on est dans le panneau d'administration | |
if (!is_admin()) { |
This file contains hidden or 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
// http://ryanve.com/lab/dimensions/ | |
document.documentElement.clientWidth | |
window.innerWidth | |
window.outerWidth | |
window.screen.width | |
window.screen.availWidth | |
$(document).width() 1552 | |
document.body.clientWidth 1080 |
This file contains hidden or 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
var mobile_browser_urlbar_height = window.innerHeight - document.documentElement.clientHeight; | |
console.log(mobile_browser_urlbar_height) |
This file contains hidden or 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 | |
function getShortcodeGalleryImagesLinks ($shortcode = null) { | |
if (!is_string($shortcode)) { return false; } | |
preg_match_all('/[0-9]+/', $shortcode, $images); | |
if (!empty($images[0])) { | |
$images = array_map('intval', $images[0]); | |
} else { | |
$images = array(); |
This file contains hidden or 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
# https://fr.wikipedia.org/wiki/Expression_r%C3%A9guli%C3%A8re | |
# [^liste] Un caractère n'étant pas entre crochets ("classe de caractères") | |
# ([^/]+) prend tout les caractères jusqu'au prochain slash | |
# /actualites/international/the-world-change-now-with-regex | |
^/actualites/([^/]+)/([^/]+)$ |
This file contains hidden or 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 isInViewport (el) { | |
var rect = el.getBoundingClientRect(); | |
return ( | |
rect.left >= 0 && rect.right <= (window.innerWidth || document.documentElement.clientWidth) || | |
rect.left < 0 && rect.right >= 0 || | |
rect.left >= 0 && rect.left < (window.innerWidth || document.documentElement.clientWidth) || | |
rect.top >= 0 && rect.bottom <= (window.innerHeight || document.documentElement.clientHeight) || | |
rect.top < 0 && rect.bottom >= 0 || | |
rect.top >= 0 && rect.top < (window.innerHeight || document.documentElement.clientHeight) |
This file contains hidden or 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
$is_mobile = false; | |
if (preg_match('/(android|webos|avantgo|iphone|ipad|ipod|blackberry|iemobile|bolt|boost|cricket|docomo|fone|hiptop|mini|opera mini|kitkat|mobi|palm|phone|pie|tablet|up\.browser|up\.link|webos|wos)/i', $_SERVER['HTTP_USER_AGENT'])) { | |
$is_mobile = true; | |
} |
This file contains hidden or 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
#301 Redirects for .htaccess | |
#Redirect a single page: | |
Redirect 301 /pagename.php http://www.domain.com/pagename.html | |
#Redirect an entire site: | |
Redirect 301 / http://www.domain.com/ | |
#Redirect an entire site to a sub folder | |
Redirect 301 / http://www.domain.com/subfolder/ |
This file contains hidden or 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
// Setup the animation loop. | |
function animate(time) { | |
requestAnimationFrame(animate); | |
TWEEN.update(time); | |
} | |
requestAnimationFrame(animate); |
This file contains hidden or 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
<script> | |
window.fbAsyncInit = function() { | |
FB.init({ | |
appId : '', | |
autoLogAppEvents : true, | |
xfbml : true, | |
version : 'v2.12' | |
}); | |
}; |