- Status in current branch:
git status
- Show all remotes:
git remote
- Check to see if you are up to date with the current branch:
git fetch
- Switch to a different branch within current remote:
git checkout branch_name
(Example:git checkout master
or gitcheckout zubaer
) - Switch to a different branch within a different remote:
git branch -u remote_name/branch_name
(Example:git branch -u production/master
orgit branch -u origin/master
). It is important to provide-u
. Otherwise, it will try to create a new Branch. - Create a new Branch:
git branch branch_name
(Example:git branch zubaer
). - Show commit history:
git log
- Git add all:
git add .
- Git commit:
git commit -m 'Commit text'
- Push to a branch:
git push remote_name branch_name
(Example:git push production master
orgit push origin master
)
This file contains 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
// Add to your theme's functions.php file. De-queues Select2 styles & scripts. Useful to keep Boostrap form control formatting | |
/** | |
* Remove Woocommerce Select2 - Pre WC 3.2.1-ish | |
*/ | |
function woo_dequeue_select2() { | |
if ( class_exists( 'woocommerce' ) ) { | |
wp_dequeue_style( 'select2' ); | |
wp_deregister_style( 'select2' ); |
This file contains 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
.flex { | |
display: flex; | |
display: -webkit-flex; | |
display: -moz-flex; | |
} | |
.flex-row { | |
flex-direction: row; | |
} |
This file contains 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
DELETE FROM wp_usermeta | |
WHERE NOT EXISTS ( | |
SELECT * FROM wp_users | |
WHERE wp_usermeta.user_id = wp_users.ID | |
) |
I felt the importance of directly editing a file from a DigitalOcean droplet on my Ubuntu Server. I research on the internet and made a way to do it.
- Install "rsub" in your Sublime Text.
- Hit Ctrl+Shift+P, start typing “install” and select “Install Package”
- Start typing “rsub” and select it.
- first command:
sudo whoami
- Create a file named "testfile":
touch testfile
- make a directory named "testdir":
mkdir testdir
- list or show all files and folders in a dir: ls
- For showing hidden files also run this command with a flag:
ls -a
- For showing hidden files also run this command with a flag:
- change directory:
cd
- back on directory:
cd ..
- go to the root directory:
cd ~
This file contains 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
<?php | |
/** | |
* This Scheduler will run once every minute unlike the Heroku scheduler which only runs every 10 mintues. | |
* To use this scheduler with Laravel 5.4+ add this file to /app/Console/Commands/RunScheduler.php | |
* Register this file in app/Console/Kernel.php | |
* protected $commands = [ | |
* ... |
This file contains 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
xcopy J:\*.* /s/e/f H: | |
// Note: Generally you can't copy files or folder from a CD or DVD which is protected. But with this windows command you can copy all files and folders from one drive or folder or cd to another derive or folder or pendrive |
This file contains 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
Change mysql root password: sudo dpkg-reconfigure mysql-server-5.5 | |
// Note: To check mysql version: mysql -V |