Skip to content

Instantly share code, notes, and snippets.

View khennt's full-sized avatar

Khen Nguyen khennt

View GitHub Profile
@khennt
khennt / tech-reading
Created August 3, 2015 03:48
tech, reading, learning, all-in-one
http://devdocs.io/
http://www.sitepoint.com/
http://www.smashingmagazine.com/
http://techcrunch.com/
@khennt
khennt / Reindex
Created August 3, 2015 03:41
reindex
- cd shell/
php indexer.php reindexall
php indexer.php --reindex [Index Option Code]
- Index Option Code:
catalog_product_attribute Product Attributes
catalog_product_price Product Prices
catalog_url Catalog Url Rewrites
catalog_product_flat Product Flat Data
catalog_category_flat Category Flat Data
catalog_category_product Category Products
@khennt
khennt / grunt.txt
Last active August 29, 2015 14:01
Grunt: Sass - Compass - Jshint - Casperjs
1. Zurb-foundation:
sudo gem install zurb-foundation -v 3.2.5
2. Grunt + Sass + Compass
## GRUNT + COMPASS + SASS ##
- Ruby
sudo apt-get install ruby-full
- Sass:
sudo gem install sass -v 3.4.9
@khennt
khennt / perl_warning.txt
Created May 6, 2014 08:38
perl: warning: Setting locale failed
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LC_CTYPE = "UTF-8",
LANG = "en_US.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
-- Run commands in terminal --
@khennt
khennt / fitler_add_ajax
Created March 20, 2014 08:45
Admin Grid
1. Add follwing code into __construct() function in :
app/code/local/[Name_Space]/[Module_Name]/Block/Adminhtml/[Module_Name]/Grid.php file.
$this->setUseAjax(true);
2. Add following function at last of this file.
@khennt
khennt / url.html
Created March 18, 2014 04:55
URL Getting
http://www.magentocommerce.com/wiki/5_-_modules_and_development/reference/geturl_function_parameters
@khennt
khennt / SS_table.php
Created March 14, 2014 09:07
Work with table in setup script
// Add column
$installer->getConnection()->addColumn($installer->getTable('sales/quote'), '<field>', 'TEXT DEFAULT NULL');
// Add an index
$installer->getConnection()
->addKey(
$installer->getTable('sales/quote'),
'IDX_PRODUCT',
'field'
);
@khennt
khennt / tips.txt
Last active August 29, 2015 13:56
Magento - Tips
1. Check handles in controller:
$this->getLayout()->getUpdate()->getHandles()
2. ** REINDEX **
- cd shell of project
- Reindex all:
php.exe indexer.php reindexall
- Reindex item:
php.exe -f indexer.php -- -reindex <option>
- option can be:
@khennt
khennt / cron.xml
Created December 17, 2013 11:43
Create cron jobs
<crontab>
<jobs>
<cron_name>
<schedule>
<cron_expr>0 0 * * SUN</cron_expr>
</schedule>
<run>
<model>module/observer::jobsFunction</model>
</run>
</cron_name>
@khennt
khennt / getRootPath.php
Created December 17, 2013 10:34
Get the Magento root directory or path
// Get the Magento root directory or path
$root = dirname(Mage::getRoot());