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
git config --global alias.it '!f() { \ | |
# Try to get current branch, suppress stderr from rev-parse itself | |
current_branch=$(git rev-parse --abbrev-ref HEAD 2>/dev/null); \ | |
# Check exit status AND content | |
if [ $? -ne 0 ] || [ -z "$current_branch" ] || [ "$current_branch" = "HEAD" ]; then \ | |
echo "Error: Failed to determine current branch." >&2; \ | |
echo "Please ensure you are in a valid Git repository with at least one commit." >&2; \ | |
return 1; \ | |
fi; \ | |
\ |
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
/** | |
* Disable the Gutenberg’s CSS loading on the front-end | |
*/ | |
function tw_unload_files() { | |
wp_dequeue_style ( 'wp-block-library' ); | |
wp_dequeue_style ( 'wp-block-library-theme' ); | |
} | |
add_action( 'wp_enqueue_scripts', 'tw_unload_files', 100 ); | |
/** |
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
#!/bin/bash | |
if [ $# -eq 0 ]; then | |
echo "no arguments" | |
exit 1 | |
fi | |
react_repo=$1 | |
react_branch=$2 | |
api_repo=$3 |
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
# | |
# Table of contents | |
# | |
# Force https ✓ | |
# Wordpress ✓ | |
# Enable gzip compression ✓ | |
# Enable browser caching ✓ | |
# Disable directory browsing ✓ | |
# Disable access to sensitive files ✓ | |
# MIME types association ✓ |
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
UPDATE wp_options SET option_value = replace(option_value, 'http://www.oldurl', 'http://www.newurl') WHERE option_name = 'home' OR option_name = 'siteurl'; | |
UPDATE wp_posts SET guid = replace(guid, 'http://www.oldurl','http://www.newurl'); | |
UPDATE wp_posts SET post_content = replace(post_content, 'http://www.oldurl', 'http://www.newurl'); | |
UPDATE wp_postmeta SET meta_value = replace(meta_value,'http://www.oldurl','http://www.newurl'); |
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
Show hidden characters
{ | |
"rich-text#grumpy-cat": { // @see https://vtex.io/docs/components/all/[email protected]/ | |
"props": { // notice the ?target=_blank added in the markdown below | |
"text": "# Grumpy Cat \n [Link](http://www.bankers-anonymous.com/wp-content/uploads/2014/12/Grumpy-Cat.jpg?target=_blank)" | |
} | |
} | |
} |
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
{ | |
"image#grumpy-cat": { // @see https://vtex.io/docs/components/all/[email protected]/image/ | |
"props": { | |
"src": "http://www.bankers-anonymous.com/wp-content/uploads/2014/12/Grumpy-Cat.jpg", | |
"alt": "Grumpy Cat", | |
"link": { | |
"url": "https://en.wikipedia.org/wiki/Grumpy_Cat", | |
"attributeTitle": "", // disables the title option of the anchor tag | |
"newTab": true // the only way to open in new tab | |
}, |
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
[alias] | |
yeah = push origin master | |
nah = checkout -- . | |
q = status | |
pushitgood = push -u origin master | |
alias = !git config --get-regexp alias | |
undo = reset --soft HEAD^ | |
release = "!f() { git tag -a $1 -m \"Release $1\"; }; f" | |
go = "!f() { git add . && git commit -m \"$1\"; }; f" | |
nope = "!f() { git checkout -- . && git clean -fd; }; f" |
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
git config --global alias.pushitgood 'push -u origin master' | |
git config --global alias.yeah 'push origin master' | |
git config --global alias.nah 'checkout -- .' | |
git config --global alias.alias '!git config --get-regexp alias' | |
git config --global alias.undo 'reset --soft HEAD^' | |
git config --global alias.q 'status' | |
git config --global alias.release '!f() { git tag -a $1 -m "Release $1"; }; f' | |
git config --global alias.go '!f() { git add . && git commit -m "$1"; }; f' |
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
/** | |
* Generates a numeric random key with fixed length | |
* @param {int} length | |
*/ | |
const randomKey = (length) => { | |
return Math.floor(Math.pow(10, length) + Math.random() * 9 * Math.pow(10, length)) | |
} |
NewerOlder