Skip to content

Instantly share code, notes, and snippets.

View proxium's full-sized avatar
🍒
Picking some sweet cherries

Rateb BEN MOUSSA proxium

🍒
Picking some sweet cherries
View GitHub Profile
@piotrekkaminski
piotrekkaminski / PATCH_SUPEE-389_EE_1.12.0.2_v2.sh
Created September 5, 2014 20:18
SUPEE-389: Every time the catalog URL is rendexed, a new custom rewrite is created
#!/bin/bash
# Patch apllying tool template
# v0.1.2
# (c) Copyright 2013. Magento Inc.
#
# DO NOT CHANGE ANY LINE IN THIS FILE.
# 1. Check required system tools
_check_installed_tools() {
local missed=""
@welbornprod
welbornprod / Embedded Python in BASH
Created August 14, 2014 23:22
A little trick to embed python code in a BASH script.
#!/bin/bash
# Here are some embedded Python examples using Python3.
# They are put into functions for separation and clarity.
# Simple usage, only using python to print the date.
# This is not really a good example, because the `date`
# command works just as well.
function date_time {
@tegansnyder
tegansnyder / MageStocker.sh
Last active June 7, 2017 11:14
MageStocker - Convert your Magento to stock disabling all extensions and your theme. Allows you to switch it back when you are done testing brining your theme and extensions back to life.
#! /bin/bash
if [ "$#" == "0" ]; then
echo
echo "Sorry cant run!"
echo "No arguments provided. Please pass this script agruments in the following format:"
echo "./magestocker.sh magento_root theme_base current_theme_name"
echo "example: "
echo "./magestocker.sh /var/www/magento default mytheme"
echo "another example:"
@mklooss
mklooss / Observer.php
Created January 9, 2014 08:32
Magento: add layout xml via event to add the layout file direct before local.xml
<?php
class Loewenstark_Layout_Model_Observer
{
// set loewenstark_layout.xml before local.xml
public function addLayoutXml($event)
{
$xml = $event->getUpdates()
->addChild('loewenstark_layout');
/* @var $xml SimpleXMLElement */
@sloria
sloria / bobp-python.md
Last active May 31, 2024 07:02
A "Best of the Best Practices" (BOBP) guide to developing in Python.

The Best of the Best Practices (BOBP) Guide for Python

A "Best of the Best Practices" (BOBP) guide to developing in Python.

In General

Values

  • "Build tools for others that you want to be built for you." - Kenneth Reitz
  • "Simplicity is alway better than functionality." - Pieter Hintjens
@klein0r
klein0r / gist:5441524
Last active July 23, 2021 15:20 — forked from davidalexander/gist:1086455
Magento Tips, Tricks and Snippets
@edannenberg
edannenberg / magento_url_rewrite.patch
Last active August 11, 2022 17:27
Fixes the catalog url rewrite indexer in Magento 1.7.x-1.9.x See https://github.com/magento/bugathon_march_2013/issues/265 for details.Update: DexterDee in the ticket above noted that the previous patch had some side effects. This updated patch still feels like duct tape but at least it seems to be free of the mentioned side effects. It also fix…
diff -rupN mage_org/app/code/core/Mage/Catalog/Model/Url.php src_shop/app/code/core/Mage/Catalog/Model/Url.php
--- mage_org/app/code/core/Mage/Catalog/Model/Url.php 2013-11-19 00:48:25.679009391 +0100
+++ src_shop/app/code/core/Mage/Catalog/Model/Url.php 2013-11-19 00:49:24.188005601 +0100
@@ -643,13 +643,24 @@ class Mage_Catalog_Model_Url
$this->_rewrite = $rewrite;
return $requestPath;
}
+
+ // avoid unnecessary creation of new url_keys for duplicate url keys
+ $noSuffixPath = substr($requestPath, 0, -(strlen($suffix)));
@adamloving
adamloving / temporary-email-address-domains
Last active May 31, 2024 15:43
A list of domains for disposable and temporary email addresses. Useful for filtering your email list to increase open rates (sending email to these domains likely will not be opened).
0-mail.com
0815.ru
0clickemail.com
0wnd.net
0wnd.org
10minutemail.com
20minutemail.com
2prong.com
30minutemail.com
3d-painting.com
@sshtmc
sshtmc / ubuntu-configure-sendmail-with-gmail
Created October 25, 2012 12:24
Ubuntu sendmail using smtp.gmail.com
#!/bin/bash
HOST=$(hostname)
function install_postfix() {
echo | sudo debconf-set-selections <<__EOF
postfix postfix/root_address string
postfix postfix/rfc1035_violation boolean false
postfix postfix/mydomain_warning boolean
postfix postfix/mynetworks string 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128

Introduction

  • C-a == Ctrl-a
  • M-a == Alt-a

General

:q        close
:w        write/saves
:wa[!]    write/save all windows [force]
:wq       write/save and close