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 funcionality to change the focus using tab and shiftkey | |
*/ | |
function matrixTabIndex() { | |
var tabKey = 9; | |
$('#product-matrix-std .owl-item').each(function(){ | |
$(this).find('INPUT[type=hidden]').attr('tabindex', '-1'); |
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 | |
/* | |
To make the cleaning expired carts automatic, override cleanExpiredQuotes with the following | |
version which will also take care of the old active carts: app/code/core/Mage/Sales/Model/Observer.php | |
*/ | |
public function cleanExpiredQuotes($schedule) | |
{ | |
// extending limit |
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
// @overright = app/code/core/Mage/Core/Controller/Response/Http.php | |
public function sendHeaders() | |
{ | |
if (!$this->canSendHeaders()) { | |
Mage::log('HEADERS ALREADY SENT: '.mageDebugBacktrace(true, true, true)); | |
return $this; | |
} | |
if (in_array(substr(php_sapi_name(), 0, 3), array('cgi', 'fpm'))) | |
{ |
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 | |
$isMobile = Zend_Http_UserAgent_Mobile::match( | |
Mage::helper('core/http')->getHttpUserAgent(), | |
$_SERVER | |
); |
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
# robots.txt for Magento 1.9.x / v1.6 2018-08-19 / Peeter Marvet | |
# (original version from 2015, edited in 2017 to add filter query parameter disallow samples + some wildcards, | |
# edited in 2018 to add query params blocking to Yandex as named User-agent does not read *) | |
# based on: | |
# http://inchoo.net/ecommerce/ultimate-magento-robots-txt-file-examples/ | |
# http://www.byte.nl/blog/magento-robots-txt/ | |
# https://astrio.net/blog/optimize-robots-txt-for-magento/ | |
# | |
# comment and clone at https://gist.github.com/petskratt/016c9dbf159a81b9d6aa | |
# Keep in mind that by standard robots.txt should NOT contain empty lines, except between UA blocks! |
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
/** | |
* @ngdoc directive | |
* @name radioTabbable | |
* @requires none | |
* @description | |
* Makes individual radio buttons focuseable using the TAB key. | |
* (By default, pressing TAB while on a radio button would have shifted focus to the next control outside of the radio group.) | |
* @usage | |
* <input type="radio" name="radioGroup" value="0" radio-tabbable="" /> | |
* <input type="radio" name="radioGroup" value="1" radio-tabbable="" /> |
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
## cmd vim /etc/nginx/sites-available/default | |
upstream node { | |
server 127.0.0.1:8080; | |
keepalive 64; | |
} | |
server { | |
listen 80; | |
# server_name domain.com; |
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
/* | |
##Device = Desktops | |
##Screen = 1281px to higher resolution desktops | |
*/ | |
@media (min-width: 1281px) { | |
//CSS | |
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
export default function flatten(arr) { | |
return arr.reduce((flat, toFlatten) => { | |
return flat.concat(Array.isArray(toFlatten) ? flatten(toFlatten) : toFlatten); | |
}, []); | |
} | |
// Test | |
flatten([[1,2,[3]],4]); |