[DEPRECATED] Install NVM, NodeJS, Yarn via Homebrew
DEPRECATED WARNING
Dear all Github friends,
I moved this gist to the Github repository.
Following this repository https://github.com/nijicha/install_nodejs_and_yarn_homebrew
<?php | |
/** | |
* Redirect posts within a date range to new URL with wp_redirect() | |
* @url https://paulund.co.uk/get-posts-between-certain-dates-wordpress-rest-api | |
*/ | |
add_action( 'template_redirect', function() { | |
$args = array( | |
'date_query' => array( | |
array( | |
'after' => 'November 1, 2020', |
<?php | |
/** | |
* Functions | |
* | |
* @package Facebook Conversions API | |
* @since 1.0 | |
* @link https://rotsenacob.com/ | |
* @author Rotsen Mark Acob <rotsenacob.com> | |
* @copyright Copyright (c) 2020, Rotsen Mark Acob | |
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License |
<?php | |
// Validate Phone Numbers for US | |
function validate_phone( $phone ) { | |
return preg_match( "/^\(?([0-9]{3})\)?[-.●]?([0-9]{3})[-.●]?([0-9]{4})$/i", $phone ); // @link https://www.oreilly.com/library/view/regular-expressions-cookbook/9781449327453/ch04s02.html | |
} | |
add_filter( 'wpcf7_validate_tel', 'tc_validate_tel', 20, 2 ); | |
add_filter( 'wpcf7_validate_tel*', 'tc_validate_tel', 20, 2 ); | |
function tc_validate_tel( $result, $tag ) { |
<?php | |
/** | |
* Functions | |
* | |
* @package Twenty Twenty Child | |
* @since 1.0 | |
* @link https://rotsenacob.com | |
* @author Rotsen Mark Acob <rotsenacob.com> | |
* @copyright Copyright (c) 2020, Rotsen Mark Acob | |
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License |
// modifys contact form 7's default select value of --- to Please select... | |
function my_wpcf7_form_elements($html) { | |
$text = 'Please select...'; | |
$html = str_replace('<option value="">---</option>', '<option value="">' . $text . '</option>', $html); | |
return $html; | |
} | |
add_filter('wpcf7_form_elements', 'my_wpcf7_form_elements'); | |
// Modify multiple selects | |
function my_wpcf7_form_elements($html) { |
Dear all Github friends,
I moved this gist to the Github repository.
Following this repository https://github.com/nijicha/install_nodejs_and_yarn_homebrew
Related tutorial: https://code64.de/visionerdy/wordpress-backups/
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc. | |
# Initialization code that may require console input (password prompts, [y/n] | |
# confirmations, etc.) must go above this block; everything else may go below. | |
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then | |
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" | |
fi | |
# Composer Path | |
export PATH="$PATH:$HOME/.composer/vendor/bin" |
ssh username@websitename.com
mysqldump -u dbusername -p dbname > backup_dbname.sql
rsync -avz public_html/ testservername@testserver.com:public_html/testfolder
cd public_html/subdomain-folder
.find . -type f -exec chmod 644 {} \;
for files.find . -type d -exec chmod 755 {} \;
for directories.# BEGIN WordPress | |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteBase / | |
# If images not found on development site, load from production | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteRule ^wp-content/uploads/[^/]+/.+\.(jpe?g|jpg|png|gif)$ https://example.com/$0 [R=302,L] |