This is a collection of information on PostgreSQL and PostGIS for what I tend to use most often.
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 echo $this->getSkinUrl('images/image.gif');?> => Current Theme Skin URL | |
<?php echo $this->getUrl('url-here');?> => Current Theme Base URL | |
<!-- ===================================================================== --> | |
Mage::getBaseUrl() => Gets base url path e.g. http://my.website.com/ | |
Mage::getBaseUrl('media') => Gets MEDIA folder path e.g. http://my.website.com/media/ |
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 | |
//get product price snippet | |
echo $this->getPriceHtml($_product, true); | |
//get $_product price | |
echo $_product->getPrice(); | |
echo number_format($_product->getPrice(), '2', '.', ','); | |
//get $_product special price |
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
// Clean Up Dashboard | |
add_action('admin_init', 'rw_remove_dashboard_widgets'); | |
function rw_remove_dashboard_widgets() { | |
remove_meta_box('dashboard_recent_comments', 'dashboard', 'normal'); // recent comments | |
remove_meta_box('dashboard_incoming_links', 'dashboard', 'normal'); // incoming links | |
remove_meta_box('dashboard_plugins', 'dashboard', 'normal'); // plugins | |
remove_meta_box('dashboard_quick_press', 'dashboard', 'normal'); // quick press | |
remove_meta_box('dashboard_recent_drafts', 'dashboard', 'normal'); // recent drafts |
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
First Load Coupon Object | |
-------------------------- | |
<?php $coupon = Mage::getModel('salesrule/coupon'); | |
$coupon->load($this->getQuote()->getCouponCode(), 'code'); | |
$couponObj = Mage::getModel('salesrule/rule')->load($coupon->getRuleId()); | |
?> | |
Then Use the Following to get the Name or Description | |
----------------------------------------------------- | |
<?php echo $couponObj->getName(); ?> |
In your command-line run the following commands:
brew doctor
brew update
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
/** | |
* Calculate stripe fee from amount | |
* so you can charge stripe fee to customers | |
* lafif <hello@lafif.me> | |
*/ | |
var fees = { | |
USD: { Percent: 2.9, Fixed: 0.30 }, | |
GBP: { Percent: 2.4, Fixed: 0.20 }, | |
EUR: { Percent: 2.4, Fixed: 0.24 }, | |
CAD: { Percent: 2.9, Fixed: 0.30 }, |
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
function useSelectors(reducer, mapStateToSelectors) { | |
const [state] = reducer; | |
const selectors = useMemo(() => mapStateToSelectors(state), [state]); | |
return selectors; | |
} | |
function useActions(reducer, mapDispatchToActions) { | |
const [, dispatch] = reducer; | |
const actions = useMemo(() => mapDispatchToActions(dispatch), [dispatch]); | |
return actions; |
OlderNewer