grep -r Mage::dispatchEvent /path/to/your/Magento/* > events.txt
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
mysqldump -u root -pyourpass --default-character-set=latin1 -c --insert-ignore --skip-set-charset your_database > dev.db | |
for i in dev; do iconv -f ISO-8859-1 -t UTF-8 <$i.db >${i}8.db; done | |
for i in *8.db; do perl -pi -w -e 's/CHARSET=latin1/CHARSET=utf8/g;' $i; done | |
for i in your_database; do mysql --user=root --password=yourpassword --execute "DROP DATABASE $i; CREATE DATABASE $i CHARACTER SET utf8 COLLATE utf8_general_ci;"; done | |
mysql --user=root --password=yourpassword --max_allowed_packet=16M --default-character-set=utf8 your_database < dev8.db |
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
(function($) { | |
var $arr_checkall = $('[data-ride="ap-checkboxall"]'); | |
/* bind checkall */ | |
$arr_checkall.click(function() { | |
var $this = $(this), | |
_data = $this.data(); | |
$(_data.child_selector).prop('checked', $(this).is(':checked')); |
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
<?php | |
$deleteCatByName = function($catname) { | |
$category = Mage::getModel('catalog/category'); | |
$tree = $category->getTreeModel(); | |
$tree->load(); | |
$ids = $tree->getCollection()->getAllIds(); | |
if ($ids){ | |
foreach ($ids as $id){ |
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
change_param_in_query_by_key_value = function(key, value, query) { | |
var arrParams = query.parseQuery(); | |
if(typeof arrParams[key] === "undefined") { | |
return query; | |
} | |
var _value = arrParams[key], _arr = _value.split('-'); | |
var position_occur_in_value_query = $j.inArray(value, _arr); | |
if(position_occur_in_value_query === -1) { | |
return query; |
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
/* | |
$primary_img_sel: main image you want to drop | |
boxWidth: box contain image. which you want. I usally less than image size | |
boxHeight: same boxWidth | |
trueSize: True size of image | |
keySupport: there are on bug in current i write. When i press image it alwasy go to bottom of page | |
onChange: when we click on the image. I will change coordinate and width and height. c.w, c.h, c.x, c.y, c.x2, c.y2 | |
*/ | |
$primary_img_sel.Jcrop({ |
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
require_once(ABSPATH . "wp-admin" . '/includes/image.php'); | |
require_once(ABSPATH . "wp-admin" . '/includes/file.php'); | |
require_once(ABSPATH . "wp-admin" . '/includes/media.php'); | |
if(!$_FILES) { | |
wp_die(''); // Do nothing | |
} | |
// check max allowed | |
$max_upload_gal_img = of_get_option(Apollo_DB_Schema::_MAX_UPLOAD_GALLERY_IMG, Apollo_Display_Config::MAX_UPLOAD_GALLERY_IMG); |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
NewerOlder