Skip to content

Instantly share code, notes, and snippets.

@philwinkle
philwinkle / keybase.md
Last active August 29, 2015 13:57
Keybase.io identity

Keybase proof

I hereby claim:

  • I am philwinkle on github.
  • I am philwinkle (https://keybase.io/philwinkle) on keybase.
  • I have a public key whose fingerprint is 60A1 B554 D364 2133 72FA E6E2 2820 5D5D 3273 2182

To claim this, I am signing this object:

@philwinkle
philwinkle / ce-1.6.2.0\app\code\core\Mage\Usa\Model\Shipping\Carrier\Fedex.php
Last active October 7, 2016 00:38
Git diff of Fedex SOAP API endpoint change - CE 1.6, 1.7, 1.8 and EE 1.11, 1.12, 1.13
diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Fedex.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Fedex.php
index d567b6e..9a98440 100644
--- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Fedex.php
+++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Fedex.php
@@ -119,8 +119,8 @@ class Mage_Usa_Model_Shipping_Carrier_Fedex
{
$client = new SoapClient($wsdl, array('trace' => $trace));
$client->__setLocation($this->getConfigFlag('sandbox_mode')
- ? 'https://wsbeta.fedex.com:443/web-services/rate'
- : 'https://ws.fedex.com:443/web-services/rate'
// Drop this javascript in the page where your grid is - maybe using a .phtml
// in before_body_end or whatever.
$$(".admin-autoemail-adminhtml-rule-index td:contains('Inactive')").each(function(status) {
$(status).up().select('td, a').invoke('setStyle',{ color: '#aaa' });
});
@philwinkle
philwinkle / end_of_the_road.js
Created December 19, 2013 20:19
Bookmarklet to add Boyz II Men's "End of the Road" to any webpage
javascript:(function(){var iframe='<iframe width="640" height="360" src="//www.youtube.com/embed/zDKO6XYXioc?feature=player_detailpage&autoplay=1" frameborder="0" allowfullscreen style="position: fixed; top: 0; left: 0; z-index: 999;"></iframe>';var bodyElement = document.body;bodyElement.innerHTML = iframe + bodyElement.innerHTML;})();
@philwinkle
philwinkle / Philwinkle\Module\Helper\Data.php
Last active December 28, 2015 22:19
**Edited 4/19/14** see http://blog.philwinkle.com/updates-in-magento-2/ || [Quickcast] Magento Module creation part 4. Part 4 of our ongoing series. We dive into the new dependency injection pattern in Magento 2 by creating and then referring to a helper in the module we created in parts 1-3.Link: http://quick.as/bbpzf6e4
<?php
namespace Philwinkle\Module\Helper;
class Data extends \Magento\Core\Helper\Data
{
public function l33t($string)
{
return strtr($string, 'leto', '1370');
}
@philwinkle
philwinkle / app\code\local\YourCompany\YourModule\etc\system.xml
Last active December 28, 2015 09:09
@ajzele feature request :) https://twitter.com/ajzele/status/401116018551971840 Create a new module and you can annotate any field with a system.xml comment node
<?xml version="1.0"?>
<config>
<sections>
<system>
<groups>
<backup>
<fields>
<maintenance>
<comment>supercalifrag</comment>
</maintenance>
@philwinkle
philwinkle / app\code\Philwinkle\Module2\Model\Plugin.php
Last active December 28, 2015 01:09
[Quickcast] Creating a new module in Magento2 A 3-part quickcast series demonstrating how to create a new module in Magento2, how to utilize the new Interception functionality, and how to chain multiple plugins targeting the same functionality together.
<?php
namespace Philwinkle\Module2\Model;
class Plugin
{
public function afterGetTitle($value)
{
return '==' . $value . '==';
}
<?php
require('app/Mage.php');
Mage::app();
$model = Mage::getModel('catalog/fakeproduct');
var_dump($model);
//=>bool(false)
$helper = Mage::helper('fakemodule');
@philwinkle
philwinkle / example.php
Last active December 22, 2015 20:59
Load product collection by IDs
<?php
$ids = array(1,2,3,4);
//DON'T DO THIS
foreach($ids as $id){
Mage::getModel('catalog/product')->load($id);
}
@philwinkle
philwinkle / closures.php
Created September 11, 2013 17:14
Closures and Mage::register
<?php
#file: closures.php
require('app/Mage.php');
Mage::app();
//testing Mage::registry closure support
Mage::register('testing',function($v){