Skip to content

Instantly share code, notes, and snippets.

View mariadanieldeepak's full-sized avatar

Maria Daniel Deepak mariadanieldeepak

View GitHub Profile
@mariadanieldeepak
mariadanieldeepak / remove-files.sh
Last active May 7, 2023 16:57
List Files Modified X Days Ago
# Remove all files that were modified until two days ago.
find /path/to/directory -type f -mtime +2 -delete
# Remove all files in current directory.
find . -type f -mtime +2 -delete
p {
text-transform: capitalize;
}
@mariadanieldeepak
mariadanieldeepak / checkout-submodule-tags.sh
Created November 20, 2019 02:24
Checkout Tag On Git Submodules
# 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
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 July 6, 2019 01:18
Downgrade Node in Mac OS using Homebrew without messing dependencies
# 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.
<?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 );
<?php
/**
* Breadcrumbs.
*
* @see woocommerce_breadcrumb()
*/
add_action( 'woocommerce_before_main_content', 'woocommerce_breadcrumb', 20, 0 );
<?php
// @see https://developer.wordpress.org/reference/functions/remove_action/
remove_action( string $tag, callable $function_to_remove, int $priority = 10 );
@mariadanieldeepak
mariadanieldeepak / install-git.sh
Created August 31, 2018 14:01
Install Git in Linux
# 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 June 30, 2018 08:48
Excludes Post IDs from Jetpack news sitemap
/**
* 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 ) {