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 script return the currency symbol position (before/after) depending of the locale | |
const getCurrencySymbolPosition = function (locale, currency) { | |
let currencyString = new Intl.NumberFormat(locale, { | |
style: "currency", | |
currency: currency, | |
currencyDisplay: "code" | |
}).format(99); // number doesn't matter here | |
if (currencyString.slice(0, 3) == currency) { |
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
'use strict'; | |
function testPromise() { | |
// synchrone | |
var my_promise = new Promise( | |
function(resolve, reject) { | |
// asynchrone | |
if (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
var user_keys = [], | |
konami = '38,38,40,40,37,39,37,39,66,65'; | |
document.onkeydown = function(e){ | |
user_keys.push(e.keyCode) | |
if (user_keys.toString().indexOf(konami) >= 0) { | |
console.log('KONAMI!'); | |
user_keys = []; | |
} | |
} |
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
@mixin bp($width) { | |
@media screen and (min-width: $width) { | |
@content; | |
} | |
} | |
.block { | |
width: 100%; | |
@include bp(970px) { |
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
/* in functions.php */ | |
// Admin messages | |
function show_admin_messages() { | |
$plugin_messages = array(); | |
include_once(ABSPATH . 'wp-admin/includes/plugin.php'); | |
// Requiered plugins | |
if(!is_plugin_active('advanced-custom-fields/acf.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
<? | |
/* in functions.php*/ | |
// remove emoticons external script | |
remove_action('wp_head', 'print_emoji_detection_script', 7); | |
// remove completely CSS/JS scripts (new emoticons are always enabled) | |
remove_action('wp_head', 'print_emoji_detection_script', 7); | |
remove_action('admin_print_scripts', 'print_emoji_detection_script'); |
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
<? | |
/* add one of this lines in WP-config.php (before Auth key) */ | |
// Define number of days old to empty trash | |
define('EMPTY_TRASH_DAYS', 3); |
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
<? | |
/* add one of this lines in WP-config.php (before Auth key) */ | |
/** Define revision number */ | |
define('WP_POST_REVISIONS', 10); | |
/** Disabled revision */ | |
define('WP_POST_REVISIONS', false); |
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
<? | |
/* add this in functions.php */ | |
// remove elements from head | |
remove_action('wp_head', 'rsd_link'); | |
remove_action('wp_head', 'wp_generator'); | |
remove_action('wp_head', 'feed_links', 2); | |
remove_action('wp_head', 'index_rel_link'); | |
remove_action('wp_head', 'wlwmanifest_link'); |
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
<? | |
/* add this in functions.php */ | |
// avoid auto <p> | |
remove_filter('the_content', 'wpautop'); |