#Stored procedure and function ##Bulk delete stored procedure
delete from mysql.proc WHERE db LIKE 'yourDbName';
##mysqldump/backup stored procedure only
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
/** | |
* Return parent product id(s) array. | |
* | |
* @param Mage_Catalog_Model_Product $product | |
* @return array|bool|null | |
*/ | |
public function getParentIds(Mage_Catalog_Model_Product $product) | |
{ | |
$id = $product->getId(); | |
$type = $product->getTypeId(); |
#!/usr/bin/env bash | |
#This script backups selected databases in local MySQL server | |
#REQUIREMENTS | |
##mysqldump gzip | |
##mysql database has no root password. This script uses 'root' MySQL user without password as no 'root' password is set. | |
##This is not good practice. User with more restrictive permission should be used. | |
#set database user |
#Install proftpd
Digital Ocean: How To Set Up ProFTPD on CentOS 6
thesysad.com: Setting Up FTP Server Using ProFTPD in CentOS
ProFTPD: Virtual Users
ProFTPD: Logins and Authentication
ProFTPD: Using AuthUserFiles
ftpasswd: tool for ProFTPD's AuthUserFile, AuthGroupFile, UserPassword
Linux and Unix umask command
How to Enable EPEL Repository for RHEL/CentOS 7.x/6.x/5.x
Source stackoverflow.com
#Use the awesome interactive rebase:
git rebase -i @~9 # Show the last 9 commits in a text editor
Find the commit you want, change pick to e (edit), and save and close the file. Git will rewind to that commit, allowing you to either:
#Prerequisit
cd ~
curl -O https://storage.googleapis.com/golang/go1.6.linux-amd64.tar.gz
tar xvf go1.6.linux-amd64.tar.gz
sudo chown -R root:root ./go
sudo mv go /usr/local
#Install Magento cli glovally
export PATH=$PATH:/var/www/html/magento2/bin
#Enable Disable Maintanance mode
Enable or disable maintenance mode
magento maintenance:enable [--ip=<ip address> ... --ip=<ip address>] | [ip=none]
magento maintenance:disable [--ip=<ip address> ... --ip=<ip address>] | [ip=none]
magento maintenance:status
For this example I have used magento2 cli. Asuming magento2 cli is located in /var/www/magento2/bin.
#create the script file
echo "export PATH=$PATH:/var/www/magento2/bin" > /etc/profile.d/magento2_bin.sh
#run the file to load
source /etc/profile.d/magento2_bin.sh
/** | |
* @param string $moduleName | |
* @param string $type [optional] | |
* @return string | |
* @throws \InvalidArgumentException | |
*/ | |
function df_module_dir($moduleName, $type = '') { | |
/** @var \Magento\Framework\ObjectManagerInterface $om */ | |
$om = \Magento\Framework\App\ObjectManager::getInstance(); | |
/** @var \Magento\Framework\Module\Dir\Reader $reader */ |