Skip to content

Instantly share code, notes, and snippets.

View rubenRP's full-sized avatar

Rubén Rodríguez rubenRP

View GitHub Profile
@rubenRP
rubenRP / .bash_profile
Last active August 29, 2015 14:27 — forked from natelandau/.bash_profile
Mac OSX Bash Profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
@rubenRP
rubenRP / jsInfiniteScroll.html
Created November 2, 2015 11:24
Script de scroll infinito en Category/list
<script type="text/javascript">
//<![CDATA[
function sendLoadMoreProductsRequest() {
if ($$('.next').first()) {
var url = $$('.next').first().readAttribute('href');
$$('.product-loading a').first().hide();
@rubenRP
rubenRP / getBrowser.js
Created December 21, 2016 11:10
Get browser JavaScript function
function get_browser() {
var ua=navigator.userAgent,tem,M=ua.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i) || [];
if(/trident/i.test(M[1])){
tem=/\brv[ :]+(\d+)/g.exec(ua) || [];
return {name:'IE',version:(tem[1]||'')};
}
if(M[1]==='Chrome'){
tem=ua.match(/\bOPR|Edge\/(\d+)/)
if(tem!=null) {return {name:'Opera', version:tem[1]};}
}
@rubenRP
rubenRP / terminalControls
Last active May 30, 2017 13:24
Commands for terminal
Stop using the arrow keys and navigate the command line more quickly with
ctrl+A: moves to the start of the line
ctrl+E: moves to the end of the line
ctrl+B: move back one character
ctrl+F: move forward one character
@rubenRP
rubenRP / HeaderPagination.php
Last active October 5, 2022 20:55 — forked from zack6849/HeaderPagination.php
SEO rel="next/prev" for Magento 2. Pagination in head
<?php
namespace Revival\Seo\Block;
use Magento\Framework\View\Element\Template;
/**
* To make this appear in the header for the catalog, you'd need to add this as a block in ${THEME_DIR}/Magento_Catalog/layout/catalog_category_view.xml
*
* EG:
@rubenRP
rubenRP / messages.js
Last active February 16, 2018 12:47
Magento 2. Medium post snippet
define([
'jquery',
'uiComponent',
'Magento_Customer/js/customer-data',
'underscore',
'jquery/jquery-storageapi'
], function ($, Component, customerData, _) {
'use strict';
return Component.extend({
@rubenRP
rubenRP / messages.phtml
Created February 16, 2018 12:48
Magento 2. Medium post snippet
<div data-bind="scope: 'messages'">
<div data-bind="visible: isVisible(), click: removeAll">
<!-- ko if: cookieMessages && cookieMessages.length > 0 -->
<div role="alert" data-bind="foreach: { data: cookieMessages, as: 'message' }" class="messages">
<div data-bind="attr: {
class: 'message-' + message.type + ' ' + message.type + ' message',
'data-ui-id': 'message-' + message.type
}">
<div data-bind="html: message.text"></div>
</div>
<?php
use Magento\Framework\App\Area;
require __DIR__ . '/app/bootstrap.php';
class testAbstractExtensibleModelApp extends \Magento\Framework\App\Http implements \Magento\Framework\AppInterface
{
/**
* @return \Magento\Framework\App\Response\Http
*/
@rubenRP
rubenRP / .bootstraprc
Created April 27, 2018 09:07
Bootstraprc file for support Bootstrap 4 in Deity.
---
# Output debugging info
# loglevel: debug
# Major version of Bootstrap: 3 or 4
bootstrapVersion: 4
# If Bootstrap version 4 is used - turn on/off flexbox model
useFlexbox: true
@rubenRP
rubenRP / AddImageToCompareProductsPlugin.php
Created February 14, 2019 15:44 — forked from denchev/AddImageToCompareProductsPlugin.php
Magento 2 show image in sidebar compare list
<?php
namespace Vendor\Namespace\Plugin;
use Magento\Catalog\Helper\ImageFactory;
use Magento\Catalog\Helper\Product\Compare;
use Magento\Catalog\Model\ProductRepository;
class AddImageToCompareProductsPlugin
{