Skip to content

Instantly share code, notes, and snippets.

View jonathanselander's full-sized avatar
🦁
:)

Jonathan Selander jonathanselander

🦁
:)
View GitHub Profile
@jonathanselander
jonathanselander / triggers.sql
Created October 13, 2016 15:50
triggers for magento EE that has price and fulltext removed from stock updates
-- MySQL dump 10.13 Distrib 5.5.47, for debian-linux-gnu (x86_64)
--
-- created with:
-- mysqldump -u -p -n -d -t --skip-opt --no-create-info --triggers magentoee | sed -e 's/DEFINER=[^*]*\*/\*/' > triggers14.2.3.sql
--
-- Host: localhost Database: magentoee
-- ------------------------------------------------------
-- Server version 5.5.47-0ubuntu0.12.04.1
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
ALTER TABLE `enterprise_url_rewrite_redirect`
ADD INDEX `redirect_id` (`redirect_id`) ;
ALTER TABLE `enterprise_url_rewrite`
ADD INDEX `request_path` (`request_path`) ;
@jonathanselander
jonathanselander / gist:10488997
Created April 11, 2014 18:11
Clean the Magento core_session table
DELETE FROM core_session WHERE session_expires < unix_timestamp()
"""
This fabric file makes setting up and deploying a django application much
easier, but it does make a few assumptions. Namely that you're using Git,
Apache and mod_wsgi and your using Debian or Ubuntu. Also you should have
Django installed on your local machine and SSH installed on both the local
machine and any servers you want to deploy to.
_note that I've used the name project_name throughout this example. Replace
this with whatever your project is called._
@jonathanselander
jonathanselander / gist:5830963
Created June 21, 2013 12:53
ädelostsåsrecept, välkommen
3 dl vispgrädde
140 gr kvibille ädelost
1-2 tsk vitvinsvinäger (ingen skitvinäger, ta en dyraste)
peppar
limezest
1 tsk limesaft
lite smör efter smak
häll i grädde, koka upp och sänk värmen direkt till sjudning. i med ost, vispa osten smält (den är salt), i med peppar, smaka av, i med vinäger, smaka av, i med limezest och limesaft, ha i smör om det är lördag. om man behöver salta extra så tycker man om att dricka vatten hela kvällen
<?php
/**
* Drop this into the shell directory in the Magento root and run without any arguments.
*/
require_once 'abstract.php';
/**
* Clean up the 1.6.1 sample data to work with the 1.8 CE url key constraints.
@jonathanselander
jonathanselander / gist:5206498
Last active December 15, 2015 05:09
If anybody ever wants to find the correct prices for the different simple product combinations a configurable product can have in the frontend, ie for exports, this is one way to go
<?php
// The configurable product must be the one in question that we want to
// find the price for
$product = Mage::getModel('catalog/product')
->load(771);
// First, fetch the attribute combination representing the simple product
$attributes = $product->getTypeInstance(true)
->getConfigurableAttributes($product);
var callbackform = new VarienForm('callback-form', true);
jQuery('#callback-form button').click(function () {
if (!callbackform.validate()) {
return;
}
var phonenumber = jQuery('#phonenumber').val();
var callbackdiv = jQuery('#callback');
var loadingImage = "<?php echo $this->getSkinUrl('images/loading.gif'); ?>";
callbackdiv.html('<img src="'+loadingImage+'" /> Sending...');
@jonathanselander
jonathanselander / Mage_Email_Templates.csv
Created December 5, 2012 14:00
Mage_Email_Templates.csv
Lifting the server siege... done. Transactions: 172 hits
Availability: 100.00 %
Elapsed time: 29.15 secs
Data transferred: 1.63 MB
Response time: 3.10 secs
Transaction rate: 5.90 trans/sec
Throughput: 0.06 MB/sec
Concurrency: 18.29
Successful transactions: 172
Failed transactions: 0