Skip to content

Instantly share code, notes, and snippets.

View tdgroot's full-sized avatar
🔌

Timon de Groot tdgroot

🔌
View GitHub Profile
@tdgroot
tdgroot / PRODSECBUG-2198-2.2-CE-2019-03-25-08-43-16-module-catalog.patch
Last active July 31, 2019 10:38
Magento 2.2 patch for PRODSECBUG-2198 in composer.patches.json format for magento/module-catalog. See for magento/framework https://gist.github.com/peterjaap/433a07a08962ea8955e64b39c84cc4e3
diff --git a/Model/Product/ProductFrontendAction/Synchronizer.php b/Model/Product/ProductFrontendAction/Synchronizer.php
index 7a1926c..331c667 100644
--- a/Model/Product/ProductFrontendAction/Synchronizer.php
+++ b/Model/Product/ProductFrontendAction/Synchronizer.php
@@ -138,7 +138,9 @@ class Synchronizer
$productIds = [];
foreach ($actions as $action) {
- $productIds[] = $action['product_id'];
+ if (isset($action['product_id']) && is_int($action['product_id'])) {
@tdgroot
tdgroot / gist:fa1b83773fd96a00fa6f531f873c30a0
Last active February 28, 2020 09:56
Update Magento 1 copyrights to 2020
grep -rl --exclude="vendor/*" "Copyright (c) 2006-2019 Magento, Inc. (http://www.magento.com)" | xargs sed -i 's#Copyright (c) 2006-2019 Magento, Inc. (http://www.magento.com)#Copyright (c) 2006-2020 Magento, Inc. (http://www.magento.com)#g'
diff --git a/lib/Varien/Db/Adapter/Pdo/Mysql.php b/lib/Varien/Db/Adapter/Pdo/Mysql.php
index e6f48cf1c3..511b9e21c1 100644
--- a/lib/Varien/Db/Adapter/Pdo/Mysql.php
+++ b/lib/Varien/Db/Adapter/Pdo/Mysql.php
@@ -20,7 +20,7 @@
*
* @category Varien
* @package Varien_Db
- * @copyright Copyright (c) 2006-2018 Magento, Inc. (http://www.magento.com)
+ * @copyright Copyright (c) 2006-2019 Magento, Inc. (http://www.magento.com)
<?php
namespace Marissen\Theme\Service;
use Magento\Catalog\Model\Product;
use Magento\Framework\Pricing\PriceCurrencyInterface;
class CatalogProductFinalPrice
{
/**
@tdgroot
tdgroot / magerunmaps-generator.py
Last active August 16, 2017 08:37
Generate your http.magerunmaps config file on hypernode based on your storefront configuration
#!/usr/bin/env python
# MIT License
#
# Copyright (c) 2017 Timon de Groot
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@tdgroot
tdgroot / XboxMapping.java
Created November 19, 2016 09:40
XBox mapping for LibGDX
package nl.tdegroot.games.melee.util;
/*******************************************************************************
* Copyright 2011 See AUTHORS file.
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
public class DisposableEngine extends Engine {
public void dispose() {
ImmutableArray<Entity> entities = getEntities();
for (Entity e : entities) {
ImmutableArray<Component> components = e.getComponents();
for (Component component : components) {
if (!(component instanceof Disposable)) continue;
Disposable disposable = (Disposable) component;
disposable.dispose();
package nl.tdegroot.games.pixxel.gfx;
import nl.tdegroot.games.pixxel.util.Log;
import nl.tdegroot.games.pixxel.util.ResourceLoader;
import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.io.IOException;
public class Sprite {
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace Linqerino {
public partial class Posts1 : Page {
@tdgroot
tdgroot / tiledmap.js
Created November 25, 2013 12:35
A TiledMap Reader and Renderer
/**
* Created by Timon on 20-11-13.
*/
var TiledMap = function (path) {
var request = new XMLHttpRequest();
request.open("GET", path, false);
request.send(null);
var map = JSON.parse(request.responseText);
this.load(map);