Skip to content

Instantly share code, notes, and snippets.

Avatar

Maria Daniel Deepak mariadanieldeepak

View GitHub Profile
View checkout-submodule-tags.sh
# List available Tags
git tag
# Checkout a tag in the main repo.
git checkout <tagname>
# Initialize any uninitialized submodule and recursivesly update the Submodules.
git submodule update --init --recursive
View jit-compilation-failed-error.txt
Warning: preg_replace(): JIT compilation failed: no more memory in
/Applications/MAMP/htdocs/wordpress/wp-includes/formatting.php on line 2110
Warning: preg_match(): JIT compilation failed: no more memory in
/Applications/MAMP/htdocs/wordpress/wp-includes/functions.php on line 4947
Warning: preg_replace(): JIT compilation failed: no more memory in
/Applications/MAMP/htdocs/wordpress/wp-includes/functions.php on line 4843
Warning: preg_match(): JIT compilation failed: no more memory in
/Applications/MAMP/htdocs/wordpress/wp-includes/functions.php on line 4947
Warning: preg_match(): JIT compilation failed: no more memory in
/Applications/MAMP/htdocs/wordpress/wp-includes/functions.php on line 4947
@mariadanieldeepak
mariadanieldeepak / downgrade-node.sh
Created Jul 6, 2019
Downgrade Node in Mac OS using Homebrew without messing dependencies
View downgrade-node.sh
# Find existing version
node --version
# Search available Node versions.
brew search node
# I neeeded a version between > 10.0 < 11. So I chose node@10.
brew install node@10
# You can install multiple versions, but you cannot have them available all at once.
View functions.php
<?php
// To remove a hook, the $function_to_remove and $priority arguments must match with the hook when added.
remove_action( 'woocommerce_before_main_content', 'woocommerce_breadcrumb', 20 );
View wc-template-hooks.php
<?php
/**
* Breadcrumbs.
*
* @see woocommerce_breadcrumb()
*/
add_action( 'woocommerce_before_main_content', 'woocommerce_breadcrumb', 20, 0 );
View functions.php
<?php
// @see https://developer.wordpress.org/reference/functions/remove_action/
remove_action( string $tag, callable $function_to_remove, int $priority = 10 );
View install-git.sh
# Updates the packages list
sudo apt update
# Fetches the newwer versions of packages existing on the machine
sudo apt upgrade
# Install Git
sudo apt install git
@mariadanieldeepak
mariadanieldeepak / functions.php
Created Jun 30, 2018
Excludes Post IDs from Jetpack news sitemap
View functions.php
/**
* Excludes Post ID from Jetpack's news sitemap.
*
* @param bool $skip
* @param WP_Post $post
*
* @return bool
*/
function jpc_exclude_post_from_news_sitemap( $skip, $post ) {
if ( ! $post instanceof WP_Post ) {
View verify-nginx-config-and-restart
// Checking NGINX config file syntax
sudo nginx -t
// Restart NGINX server
sudo service nginx restart
You can’t perform that action at this time.