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 APP = { | |
config: { | |
selector: '.app', | |
}, | |
}; | |
var app_selector = ((APP || {}).config || {}).selector || ''; |
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 $output = document.querySelector('.js-output'); | |
function debugRender(obj) { | |
$output.innerHTML = ''; | |
$output.appendChild(document.createTextNode(JSON.stringify(obj, function(key, value) { | |
if (value === window || (value && typeof value.nodeName === 'string')) { | |
return '[DOM]'; | |
} | |
return value; | |
}, 4))); |
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 | |
// Add to existing function.php file | |
// Disable support for comments and trackbacks in post types | |
function df_disable_comments_post_types_support() { | |
$post_types = get_post_types(); | |
foreach ($post_types as $post_type) { | |
if(post_type_supports($post_type, 'comments')) { | |
remove_post_type_support($post_type, 'comments'); | |
remove_post_type_support($post_type, 'trackbacks'); |
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 | |
class WPMediaBlur { | |
public function __construct() { | |
$this->add_media_sizes(); | |
add_action( 'updated_post_meta', array( $this, 'post_updated' ), 10, 4 ); | |
add_action( 'added_post_meta', array( $this, 'post_updated' ), 10, 4 ); | |
} | |
public function add_media_sizes() { |
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
# "www." to "local." | |
sed 's/www.mysite.fr/local.mysite.fr/g' mysql.sql > mysql-new.sql | |
# HTTPS to HTTP | |
sed 's/https:\/\/www.mysite.fr/http:\/\/www.mysite.fr/g' mysql.sql > mysql-new.sql | |
# If bug "sed: RE error: illegal byte sequence" | |
LC_CTYPE=C sed 's/www.mysite.fr/local.mysite.fr/g' mysql.sql > mysql-new.sql |
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
# Pass the default character set | |
AddDefaultCharset utf-8 | |
# BEGIN Rewrite rules | |
RewriteEngine On | |
RewriteBase / | |
# Redirection www | |
RewriteCond %{HTTP_HOST} ^site\.com$ [NC] | |
RewriteRule ^(.*)$ https://www.site.com/$1 [R=301,L] |
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
# Step 1: Install PHP Code Sniffer (global) | |
composer global require squizlabs/php_codesniffer | |
# path: "/Users/MyUserName/.composer/vendor/squizlabs/php_codesniffer/bin" | |
# Step 2: Install WordPress Coding Standards (global) | |
# stock the git in user folder | |
cd ~ | |
mkdir ~/terminal-tools |
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
Options +FollowSymlinks | |
RewriteEngine on | |
RewriteCond %{REQUEST_URI} !/maintenance.html$ | |
RewriteRule $ /maintenance.html [R=302,L] |
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
{* | |
* Prestashop 1.6 Documentation | |
* http://doc.prestashop.com/display/PS16/Module+translation | |
* https://stackoverflow.com/questions/11340742/pass-a-variable-inside-translation-string-in-prestashop | |
*} | |
{* Translate Back-Office Key *} | |
{l s='This is translation' mod='my_module'} | |
{* Variables *} |