Skip to content

Instantly share code, notes, and snippets.

@OZZlE
OZZlE / gist:67db00264ebfd94ea1f35e3998aa1c16
Created April 17, 2018 08:42
M2.1.x Ajax add to cart bugfix patch
--- ./view/frontend/web/js/catalog-add-to-cart.js 2018-04-16 17:21:32.000000000 +0200
+++ ./view/frontend/web/js/catalog-add-to-cart.js 2018-04-16 17:21:32.000000000 +0200
@@ -33,11 +33,14 @@
_bindSubmit: function() {
var self = this;
+ this.element.mage('validation');
this.element.on('submit', function(e) {
e.preventDefault();
- self.submitForm($(this));
@OZZlE
OZZlE / mysql-faster-imports.sh
Last active October 16, 2024 02:27
Linux Bash Script to toggle faster mysql db imports
#!/usr/bin/env bash
# USAGE: mysqlOptimizeForImports <- before importing
# mysqlDefaultSettings <- to go back to normal
# Based on https://dba.stackexchange.com/questions/83125/mysql-any-way-to-import-a-huge-32-gb-sql-dump-faster/83385#83385
mysqlStateFile="$HOME/mysql.optimized.for.exports"
mysqlConfigLocation="/etc/mysql/my.cnf" # <-- change to the correct for your system, should be for global mysql settings
@OZZlE
OZZlE / sass-less.php
Last active January 15, 2021 18:20
PHP equivalent of "modern" sass/less
<?php
// index.php
/* We assume that a designer will ask us one day to increase/decrease all body texts
this website was made in 2010 and we're changing platform now but "sure" this is
going to happen soon :D "In the next project" :-d
Also Search & replace '1em' is very trixy, cannot be done reaaallly! IMPOSSIBLE!
*/
$GLOBALS['fontSizeDefault'] = '1em';
class MixinC { // ... }
class MixinB extends MixinC { // ... }