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 | |
namespace Company\Module\Block\Product\ProductList; | |
class Toolbar extends \Magento\Catalog\Block\Product\ProductList\Toolbar | |
{ | |
public function setCollection($collection) { | |
$this->_collection = $collection; | |
$this->_collection->setCurPage($this->getCurrentPage()); | |
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 | |
namespace Gideon\Returns\Setup; | |
use Magento\Eav\Setup\EavSetupFactory; | |
use Magento\Framework\Setup\ModuleContextInterface; | |
use Magento\Framework\Setup\ModuleDataSetupInterface; | |
use Magento\Framework\Setup\UpgradeDataInterface; | |
use \Magento\Framework\App\ObjectManager; | |
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
//$eavSetup->updateAttribute(Product::ENTITY, $attributeCode, $attributeField, $value); | |
$eavSetup->updateAttribute('catalog_product', 'price', 'position', 100); |
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
$writer = new \Zend\Log\Writer\Stream(BP . '/var/log/test.log'); | |
$logger = new \Zend\Log\Logger(); | |
$logger->addWriter($writer); | |
$logger->info('Your text message'); |
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
Compress: tar -czvf name-of-archive.tar.gz /path/to/directory-or-file | |
Extract: tar -xzvf archive.tar.gz | |
compress with exclusion of some folders: | |
tar --exclude='./folder' --exclude='./upload/folder2' -zcvf /backup/filename.tgz . | |
To find the files using it's name: | |
find <path> -name "filename-with-extension" |
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 bin/magento s:up - Setup Upgrade | |
php bin/magento s:up --keep-generated | |
php bin/magento c:c - Cache Flush | |
php bin/magento c:f - Cache Flush | |
php bin/magento c:d - Disable Cache | |
php bin/magento c:e - Enable Cache | |
php bin/magento i:rei - Reindexing | |
php bin/magento i:i - View the list of indexers | |
php bin/magento i:st - Indexer status | |
php bin/magento i:res - Indexer Resets |
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
ssh username@domain.com -p 22 | |
cd public_html/blogdemo/ | |
wget http://wordpress.org/latest.tar.gz | |
tar xfz latest.tar.gz | |
mv wordpress/* ./ | |
rmdir ./wordpress/ | |
rm -f latest.tar.gz |
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
onselectstart="return false" onpaste="return false;" onCopy="return false" onCut="return false" onDrag="return false" onDrop="return false" autocomplete=off |
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 | |
define( 'API_ACCESS_KEY', 'AIzaSyA7TJAvFZrD_asZM92xoWM5u5MD-uMyYH0' ); | |
$registrationIds = array( | |
"cQ8E8TvwQxg:APA91bHGxk5NBPze0_zOTQLif9s5VpOYzCyEvPmFlP3PD5FI6_5LyIVNkTKlfpSS9wy4SpO5iIX7Jdvp3nNLMYvCk6IbNRE_ykplP-Es8ebuJPF_tHhhzVS6TjWS5gDlC0Fp8JIkckNy", | |
"d5ttcEFtdg8:APA91bGu7QvkTkGKi4l6GviGCYgSQsv0bRLmgxlbJCDmM6iBmcOT5XAtwyQ1vprQCeTIkAvXwxb_IlitoQF335ynDyrvZXRTaN8HgDe8WFf__RI06ahec1yx0EbwkuzUI5h_s5WWP_tl" | |
); | |
$msg = array | |
( | |
'body' => 'The Chennai Silks', | |
'title'=> 'Welcome to TCS!', |
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
#!/usr/bin/python | |
import MySQLdb | |
import datetime | |
# Open database connection | |
db = MySQLdb.connect("localhost","root","","know_your_beat" ) | |
# prepare a cursor object using cursor() method | |
cursor = db.cursor() |
OlderNewer