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
| define(function(){ | |
| var instance = null; | |
| function MySingleton(){ | |
| if(instance !== null){ | |
| throw new Error("Cannot instantiate more than one MySingleton, use MySingleton.getInstance()"); | |
| } | |
| this.initialize(); | |
| } |
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
| <!-- Add to the package layout (via local.xml or however you prefer) --> | |
| <!-- Also, best to remove before deployment, as some users report --> | |
| <!-- it makes IE 7 crash --> | |
| <default> | |
| <reference name="content"> | |
| <block type="core/text" name="fix.console" as="fix.console"> | |
| <action method="setText"> | |
| <text><![CDATA[<script type="text/javascript"> | |
| iframe = document.createElement('iframe'); | |
| iframe.style.display = 'none'; |
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
| // Usage: http://localhost:8080/image.jpg/100x50 | |
| var http = require('http'); | |
| var spawn = require('child_process').spawn; | |
| http.createServer(function(req, res) { | |
| var params = req.url.split('/'); | |
| var convert = spawn('convert', [params[1], '-resize', params[2], '-']); | |
| res.writeHead(200, {'Content-Type': 'image/jpeg'}); | |
| convert.stdout.pipe(res); |
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
| # Magento Connect 2 cache directories and files | |
| downloader/pearlib/cache/ | |
| downloader/*.cfg | |
| # Magento runtime media files | |
| media/catalog/product/cache/ | |
| media/tmp/ | |
| media/js/ | |
| media/css/ | |
| media/.thumbs/ |
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
| // ---------------------------------------------------------- | |
| // A short snippet for detecting versions of IE in JavaScript | |
| // without resorting to user-agent sniffing | |
| // ---------------------------------------------------------- | |
| // If you're not in IE (or IE version is less than 5) then: | |
| // ie === undefined | |
| // If you're in IE (>=5) then you can determine which version: | |
| // ie === 7; // IE7 | |
| // Thus, to detect IE: | |
| // if (ie) {} |
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 | |
| class TimezonesHelper extends AppHelper { | |
| function show() { | |
| $zones = array( | |
| 'Pacific/Apia' => 'Apia, Upolu, Samoa', // UTC-11:00 | |
| 'US/Hawaii' => 'Honolulu, Oahu, Hawaii, United States', // UTC-10:00 | |
| 'US/Alaska' => 'Anchorage, Alaska, United States', // UTC-09:00 | |
| 'US/Pacific' => 'Los Angeles, California, United States', // UTC-08:00 | |
| 'US/Mountain' => 'Phoenix, Arizona, United States', // UTC-07:00 |
NewerOlder