Skip to content

Instantly share code, notes, and snippets.

View jbelke's full-sized avatar

Joshua Belke jbelke

  • Magnetism Labs
  • NY
View GitHub Profile
Date: Fri, 5 Jul 2013 22:41:03 -0500
Subject: [PATCH] Magento_CE_1.7.0.2_v1-CSRF_Patch
---
.../core/Mage/Catalog/Block/Product/Abstract.php | 85 ++++-
app/code/core/Mage/Catalog/Block/Product/View.php | 10 +-
.../core/Mage/Catalog/Helper/Product/Compare.php | 28 +-
app/code/core/Mage/Checkout/Helper/Cart.php | 26 +-
.../Mage/Checkout/controllers/CartController.php | 69 ++--
.../Checkout/controllers/OnepageController.php | 70 +++-
Date: Fri, 5 Jul 2013 22:41:03 -0500
Subject: [PATCH] Magento_CE_1.7.0.2_v1-CSRF_Patch
---
.../core/Mage/Catalog/Block/Product/Abstract.php | 85 ++++-
app/code/core/Mage/Catalog/Block/Product/View.php | 10 +-
.../core/Mage/Catalog/Helper/Product/Compare.php | 28 +-
app/code/core/Mage/Checkout/Helper/Cart.php | 26 +-
.../Mage/Checkout/controllers/CartController.php | 69 ++--
.../Checkout/controllers/OnepageController.php | 70 +++-
Index: lib/Varien/Cache/Backend/Database.php
===================================================================
--- lib/Varien/Cache/Backend/Database.php (revision 63515)
+++ lib/Varien/Cache/Backend/Database.php (working copy)
@@ -224,6 +224,7 @@
if ($this->_options['store_data']) {
$adapter = $this->_getAdapter();
$result = $adapter->delete($this->_getDataTable(), array('id=?'=>$id));
+ $tagResult = $adapter->delete($this->_getTagsTable(), array('cache_id=?' => $id));
return $result;
@jbelke
jbelke / fix-homebrew-npm.md
Created October 8, 2015 15:51 — forked from DanHerbert/fix-homebrew-npm.md
Instructions on how to fix npm if you've installed Node through Homebrew on Mac OS X or Linuxbrew

Fixing npm On Mac OS X for Homebrew Users

If you just want to fix the issue quickly, scroll down to the "solution" section below.

Explanation of the issue

If you're a Homebrew user and you installed node via Homebrew, there is a major philosophical issue with the way Homebrew and NPM work together. If you install node with Homebrew and then try to do npm update npm -g, you may see an error like this:

$ npm update npm -g
// Includes functions for exporting active sheet or all sheets as JSON object (also Python object syntax compatible).
// Tweak the makePrettyJSON_ function to customize what kind of JSON to export.
var FORMAT_ONELINE = 'One-line';
var FORMAT_MULTILINE = 'Multi-line';
var FORMAT_PRETTY = 'Pretty';
var LANGUAGE_JS = 'JavaScript';
var LANGUAGE_PYTHON = 'Python';
@jbelke
jbelke / 6788.diff
Created November 3, 2015 23:15 — forked from gwillem/6788.diff
6788 for 1.9.2.1
diff --git .htaccess .htaccess
index 60e1795..aca7f55 100644
--- .htaccess
+++ .htaccess
@@ -207,3 +207,28 @@
## http://developer.yahoo.com/performance/rules.html#etags
#FileETag none
+
+###########################################
@jbelke
jbelke / UploadHandlerS3.php
Created November 10, 2015 08:13 — forked from tim-peterson/UploadHandlerS3.php
jQuery-File-Upload S3 PHP upload directly using AWS PHP SDK V2 (w/ optional Dropbox Chooser-selected files) https://github.com/blueimp/jQuery-File-Upload
<?php
use Aws\Common\Aws;
use Aws\S3\Exception\S3Exception;
// make sure the SDK is installed
// I've used Composer to autoload it: http://docs.aws.amazon.com/aws-sdk-php/guide/latest/installation.html
/*
* jQuery File Upload Plugin PHP Class 7.1.0
* https://github.com/blueimp/jQuery-File-Upload
@jbelke
jbelke / https.py
Created December 31, 2015 07:55 — forked from stephenlb/https.py
HTTPS Server - All-in-One Secure HTTPS Server
#!/usr/bin/python
# server
# python https.py
#
# browser
# https://0.0.0.0:4443
import BaseHTTPServer
import SimpleHTTPServer
@jbelke
jbelke / Magento-order-sum-breakout-report.sql
Created February 10, 2016 16:53 — forked from tegansnyder/Magento-order-sum-breakout-report.sql
Magento - Sum of All Orders by Month and Year Breakdown includes Discount Sums
SELECT sub_query.month_ordered,
sub_query.year_ordered,
SUM(sub_query.base_subtotal) AS sum_base_subtotal,
SUM(sub_query.discount_amount) AS sum_discount_amt,
SUM(sub_query.order_qty) AS sum_total_item_count,
COUNT(sub_query.entity_id) AS total_orders
FROM
(SELECT so.entity_id,
MONTH(so.created_at) AS month_ordered,
YEAR(so.created_at) AS year_ordered,