Skip to content

Instantly share code, notes, and snippets.

@mthchz
mthchz / acf-region.txt
Created December 31, 2019 15:26
Liste des départements français pour champs sélection ACF (code INSEE)
84 : Auvergne-Rhône-Alpes
27 : Bourgogne-France-Comté
53 : Bretagne
24 : Centre-Val de Loire
94 : Corse
44 : Grand Est
32 : Haut-de-France
11 : Île-de-France
28 : Normandie
75 : Nouvelle-Aquitaine
@mthchz
mthchz / acf-departement.txt
Created December 31, 2019 15:24
Liste des départements français pour champs sélection ACF
01 : Ain
02 : Aisne
03 : Allier
04 : Alpes-de-Haute-Provence
06 : Alpes-Maritimes
07 : Ardèche
08 : Ardennes
09 : Ariège
10 : Aube
11 : Aude
@mthchz
mthchz / .htaccess
Last active November 28, 2019 17:29
htaccess optimisé pour Wordpress
Options -Indexes
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
# WordPress
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

Keybase proof

I hereby claim:

  • I am mthchz on github.
  • I am mthchz (https://keybase.io/mthchz) on keybase.
  • I have a public key ASBuNxHzVsT4BvuHVK-xBhWtvDUKc1W--7HuIYzGZoVIIQo

To claim this, I am signing this object:

@mthchz
mthchz / get-outer-html.js
Created May 22, 2018 17:20
Get outer HTML jQuery/JS
/* OuterHtml
*******************************************************************************/
if( !$.outerHTML ){
$.extend({
outerHTML: function(ele) {
if( ele.length === 1 ) return ele[0].outerHTML;
var $return = [];
ele.each(function(i) {
$return.push($(this)[0].outerHTML);
});
@mthchz
mthchz / element-is-visible.js
Created May 22, 2018 17:20
JS element is visible ?
/* Element is visible ?
*******************************************************************************/
$.fn.isVisible = function(partial) {
if( typeof $(this).offset() === 'undefined' ) return false;
var $t = $(this),
$w = $(window),
viewTop = $w.scrollTop(),
viewBottom = viewTop + $w.height() - 100,
@mthchz
mthchz / scroll-to-anchor.js
Created May 22, 2018 17:19
Scroll to anchor jQuery/JS
/* SCROLLTO ANCHOR
*******************************************************************************/
$('.js-scroll-to').on('click', function(event) {
event.preventDefault();
var link = $(this).attr('href');
var hashExpression = new RegExp("#([a-zA-Z0-9\-\_]*)$");
if( hashExpression.test(link) ){
@mthchz
mthchz / foundation-button-effect.scss
Created December 19, 2017 14:17
Effet de survol pour les boutons de Foundation 6. Le mixin doit être inclus dans le components/_button.scss.
// Custom chema : hover effect
@mixin button-effect (
$background: $button-background,
$background-hover: $button-background-hover,
$color: $button-color,
$background-hover-lightness: $button-background-hover-lightness,
$style: $button-fill
) {
$background-hover-base: $color;
@mthchz
mthchz / wp-mail-force-smtp.php
Last active July 21, 2017 09:48
WP Mail force SMTP on send error
<?php
/**
* Force WP_Mail with SMTP
* Dependency : https://github.com/rohmann/global-smtp
*/
function WPMailOnSendFail($wp_error){
$GlobalSMTP = false;
if( file_exists( dirname(__FILE__).'/global-smtp.php' ) ){
include_once( dirname(__FILE__).'/global-smtp.php' );