Skip to content

Instantly share code, notes, and snippets.

View rafaelpatro's full-sized avatar

Rafael Patro rafaelpatro

  • Lisbon, Portugal
View GitHub Profile
@rafaelpatro
rafaelpatro / magento-scrolling-menu.js
Last active December 12, 2019 13:33
Magento Scrolling Menu (RWD)
/**
* Magento Scrolling Menu (RWD)
*
* Author:
* Rafael Patro <[email protected]>
*
* Source:
* https://gist.github.com/rafaelpatro/f3d62f82a6ae4c0f75465d99655dd791
*
* Intallation:
@rafaelpatro
rafaelpatro / magento-catalog-product-view-cc.js
Last active June 17, 2020 01:56
Magento Catalog Product View shows Credit Card Installments
/**
* Credit Card Installments to Product Page
*
* Author:
* Rafael Patro <[email protected]>
*
* Intallation:
* Configure the variables ccording to your credit card plan.
* maxInstallments (integer) Maximum number of installments the cc plan accept
* minPlotValue (number) Minimum installment value
@rafaelpatro
rafaelpatro / correios-rastro.js
Last active April 9, 2017 00:19
Servidor Node.JS para consulta de CEP nos Correios
var soap = require('soap');
var fs = require('fs');
var app = require('express')();
var privateKey = fs.readFileSync('/etc/apache2/ssl.crt/mydomain.key');
var certificate = fs.readFileSync('/etc/apache2/ssl.crt/87g4d56efa87af4.crt');
var chainFile = fs.readFileSync('/etc/apache2/ssl.crt/gd_bundle-g2-g1.crt');
var credentials = {key: privateKey, cert: certificate, chain: chainFile};
var https = require('https').Server(credentials, app);
@rafaelpatro
rafaelpatro / magento-address-autocomplete.js
Last active September 23, 2024 12:44
Magento Address Auto Fill based on Postcode
/**
* Address Auto Fill based on Postcode
*
* Author:
* Rafael Patro <[email protected]>
*
* Intallation:
* Add a CMS Static Block applying the entire script below.
* Add a Widget to pages with address forms.
*
@rafaelpatro
rafaelpatro / magento-frontend-scripts.md
Last active July 20, 2018 16:07
Magento Frontend Scripts

Improve Magento frontend

The scripts below require nothing but itself.

  • No module installation
  • No FTP access
  • No third party integration
  • No plans
  • Only CMS > Blocks/Widgets
@rafaelpatro
rafaelpatro / html-domparser.js
Created June 8, 2017 01:38 — forked from eligrey/html-domparser.js
DOMParser HTML extension - Now a polyfill since HTML parsing was added to the DOMParser specification
/*
* DOMParser HTML extension
* 2012-09-04
*
* By Eli Grey, http://eligrey.com
* Public domain.
* NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
*/
/*! @source https://gist.github.com/1129031 */
@rafaelpatro
rafaelpatro / magento-xhrcart.js
Last active February 22, 2018 13:11
Add ajax compatibility to Magento action buttoms
/**
* Add XHR compatibility to Magento action buttoms
*
* Author:
* Rafael Patro <[email protected]>
*
* Requirements:
* DOMParser HTML fixes
* jQuery Growl library
*
@rafaelpatro
rafaelpatro / jquery.qDefer.min.js
Created October 23, 2017 00:25 — forked from RonnyO/jquery.qDefer.min.js
Simply mimic the 'defer' attribute for inline scripts across all browsers (jQuery helper)
// http://bit.ly/qDefer
$(function(){$('script[type="text/javascript/defer"]').each(function(){$(this).clone().attr('type','').insertAfter(this)})});
#!/bin/bash
URL='domain.com'
wget --quiet http://$URL/sitemap.xml --no-cache --output-document - | egrep -o "http://$URL[^<]+" | while read line; do
time curl -A 'Cache Warmer' -s -L $line > /dev/null 2>&1
echo $line
done
## How to install mcrypt in php7.2
##
## https://lukasmestan.com/install-mcrypt-extension-in-php7-2/
##
#
# Check version php and pecl
#
php -v # if default php is not 7.2 then use /usr/bin/php7.2 instead php