Skip to content

Instantly share code, notes, and snippets.

View hans2103's full-sized avatar
🏠
Working from home

Hans Kuijpers hans2103

🏠
Working from home
View GitHub Profile
@jonathonbyrdziak
jonathonbyrdziak / Collection.php
Created April 17, 2015 14:22
Sorting Configurable Product Options
<?php
/**
* Magento 1.9.1 has a problem Sorting Configurable Product Attribute Options and Dropdowns
* [solved] File Patched by Jonathon Byrd
* http://magentosupport.help/knowledgebase/solved-sort-configurable-product-attribute-options-and-dropdowns/
*
* Magento
*
* NOTICE OF LICENSE
*
@ttscoff
ttscoff / font_grabber.rb
Last active May 13, 2021 06:14
Give it a <link> from Google fonts and get back CSS with fonts embedded
#!/usr/bin/ruby
# encoding: utf-8
# Grab google web fonts and embed them as base64 data URIs
# <http://brettterpstra.com/2015/03/14/embedding-google-web-fonts/>
require 'base64'
if ARGV.length > 0
input = ARGV
elsif STDIN.stat.size > 0
input = STDIN.read.strip.split(/\n+/)
@markvds
markvds / filterable_attributes.php
Created February 25, 2015 09:17
Magento shell script (place it in /shell) to output all filterable attributes. You can then copy/paste it into robots.txt to effectively stop bots from indexing your layered navigation. See also https://www.byte.nl/blog/zoekmachine-bots-en-serverbelasting/
<?php
require_once 'abstract.php';
class Mage_Shell_Filterable_Attributes extends Mage_Shell_Abstract
{
/**
* Run script
*
*/
public function run()
@heesienooi
heesienooi / pagination.php
Created September 23, 2014 05:18
Joomla pagination override - Reduce number of displayed pages
<?php
/**
* By default joomla display 10 pages in pagination. This file allows
* us to customize the number of displayed pages.
*
* Simply add this file to $template/html/pagination.php and
* change $displayedPages variable.
*/
defined('_JEXEC') or die('Restricted access');
@kubaceg
kubaceg / databaseBackup.sh
Last active May 1, 2017 11:32
n98Magerun magento database backup script, creates daily, weekly and monthly dumps
#!/bin/bash
#CONFIG
backupDir='/mnt/backup'
magentoDir='/var/www/magento/htdocs'
magerunPath='/usr/bin/n98-magerun.phar'
#NUMBER OF DAYS TO KEEP BACKUPS
dailyKeepDays=7
weeklyKeepDays=30
@peterjaap
peterjaap / magento-testing-scenarios.md
Last active October 17, 2022 10:16
Magento testing scenarios

Magento testing scenarios

For use after an upgrade to verify the correct working of Magento

SHIP IT

Frontend

General

  • Activate all logs on the server (PHP, MySQL, Magento, mail, etc)
  • Check meta tags in HTML
@tracend
tracend / common.loading.css
Last active February 21, 2024 11:59
CSS3 Loading Overlay
body.loading:after {
/* with no content, nothing is rendered */
content: "";
position: fixed;
/* element stretched to cover during rotation an aspect ratio up to 1/10 */
top: -500%;
left: -500%;
right: -500%;
bottom: -500%;
z-index: 9999;
@joshkehn
joshkehn / gtm_macros.js
Created January 16, 2014 19:09
Google Tag Manager Macros
/*
* Custom JS macros for creating tags in GTM that populate event information from
* element attributes.
*
* Author: Joshua Kehn <josh@byjakt.com>
* Copyright: (c) 2014 by Joshua Kehn
* License: ISC <http://www.isc.org/downloads/software-support-policy/isc-license/>
*/
function () {
@kagemusha
kagemusha / gist:5866759
Created June 26, 2013 11:37
Using Debugger with Grunt
version: grunt-cli v0.1.8
1. Install node-inspector globally (-g)
npm install -g node-inspector
2. Add debugger statements to your code
3. Run your grunt task in debug mode
@Maksold
Maksold / local.xml
Last active May 28, 2021 20:02
#magento #xml - local.xml boilerplate
<?xml version="1.0"?>
<layout>
<default>
<!--Root/Default Layouts-->
<reference name="root">
<!--Appending Block-->
<block type="page/html_breadcrumbs" name="breadcrumbs" as="breadcrumbs"/>
</reference>
<!--CSS and JS Files-->