Skip to content

Instantly share code, notes, and snippets.

View AurelienLavorel's full-sized avatar

Aurélien Lavorel AurelienLavorel

View GitHub Profile
@ashsmith
ashsmith / onepage.phtml
Last active April 13, 2023 19:33
Track each step of the Magento onepage checkout in Google Analytics with this simple Javascript addition to [package]/[theme]/template/checkout/onepage.phtml just add it to the bottom of that file and follow up by configuring with Google Analytics goals
<script type="text/javascript">
Checkout.prototype.gotoSection = Checkout.prototype.gotoSection.wrap(function(parentMethod, section, reloadProgressBlock) {
// Call parent method.
parentMethod(section, reloadProgressBlock);
var _gaq = _gaq || [];
try {
// push current checkout section to google analytics if available.
@ralphschindler
ralphschindler / README.md
Last active May 1, 2024 19:14
Docker For Mac Host Address Alias To Enable PHP XDebug (10.254.254.254 Trick)

Docker (Mac) De-facto Standard Host Address Alias

This launchd script will ensure that your Docker environment on your Mac will have 10.254.254.254 as an alias on your loopback device (127.0.0.1). The command being run is ifconfig lo0 alias 10.254.254.254.

Once your machine has a well known IP address, your PHP container will then be able to connect to it, specifically XDebug can connect to it at the configured xdebug.remote_host.

Installation Of IP Alias (This survives reboot)

Copy/Paste the following in terminal with sudo (must be root as the target directory is owned by root)...

@xapax
xapax / convert-html-markdown.sh
Last active February 1, 2023 19:06
Converting html to markdown - useful when migrating from wordpress to jekyll
#!/bin/bash
filename=$(basename "$1")
dirname=$(dirname "$1")
extension="${filename##*.}"
filename_without_extension="${filename%.*}"
sed -i -e 's/<p>//g' $1
@digitalpianism
digitalpianism / emailTemplatesGenerator.php
Last active May 25, 2018 10:55
Dirty Magento Shell script to send all transactional emails
<?php
/**
To run and send all emails:
php -f emailTemplateGenerator.php -- -email raphael@me.com
Tun run and send one email:
php -f emailTemplateGenerator.php -- -email raphael@me.com -template 46
*/
require_once 'abstract.php';