git config --global alias.st 'status -sb'
git config --global alias.ll 'log --oneline'
git config --global alias.last 'log -1 HEAD --stat'
git config --global alias.cm 'commit -m'
git config --global alias.rv 'remote -v'
git config --global alias.d 'diff'
git config --global alias.gl 'config --global -l'
git config --global alias.br 'branch'
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 rebase $1~ --onto $2; | |
$1 = first commit branch | |
$2 = rebased branch | |
ex: git rebase 118689f~ --onto origin/main |
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
SET @oldsite='http://oldsite.com'; | |
SET @newsite='http://newsite.com'; | |
UPDATE wp_options SET option_value = replace(option_value, @oldsite, @newsite) WHERE option_name = 'home' OR option_name = 'siteurl'; | |
UPDATE wp_posts SET post_content = replace(post_content, @oldsite, @newsite); | |
UPDATE wp_links SET link_url = replace(link_url, @oldsite, @newsite); | |
UPDATE wp_postmeta SET meta_value = replace(meta_value, @oldsite, @newsite); | |
/* only uncomment next line if you want all your current posts to post to RSS again as new */ | |
#UPDATE wp_posts SET guid = replace(guid, @oldsite, @newsite); |
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
## useful git aliases | |
git config --global alias.st 'status -sb' | |
git config --global alias.ll 'log --oneline' | |
git config --global alias.last 'log -1 HEAD --stat' | |
git config --global alias.cm 'commit -m' | |
git config --global alias.rv 'remote -v' | |
git config --global alias.d 'diff' | |
git config --global alias.gl 'config --global -l' | |
git config --global alias.br 'branch' |
Mysql import
docker exec -i [container_name] mysql -u[mysql_user] -p[mysql_password] < [dump_name].sql
Mysql dump
docker exec -i [container_name] mysqldump -u[mysql_user] -p[mysql_password] [DB_name] > [dump_name].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
import { JwtModule, JWT_OPTIONS } from '@auth0/angular-jwt'; | |
import { Plugins } from '@capacitor/core'; | |
// ... | |
export function jwtOptionsFactory() { | |
return { | |
tokenGetter: () => { | |
return Plugins.Storage.get({ key: 'jwt_token' }).then(storedData => storedData.value); | |
}, |
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/sh | |
if [ "$(whoami)" != 'root' ]; then | |
echo 'This script must be run as "root".' | |
echo 'Enter password to elevate privileges:' | |
SCRIPTPATH=$( cd $(dirname $0) ; pwd -P ) | |
SELF=`basename $0` | |
sudo $SCRIPTPATH'/'$SELF | |
exit 1 | |
fi |