Skip to content

Instantly share code, notes, and snippets.

SET FOREIGN_KEY_CHECKS=0;
TRUNCATE `catalogsearch_query`;
ALTER TABLE `catalogsearch_query` AUTO_INCREMENT=1;
TRUNCATE `sales_flat_order`;
TRUNCATE `sales_flat_order_address`;
TRUNCATE `sales_flat_order_grid`;
import android.graphics.Bitmap;
import android.graphics.Bitmap.Config;
import android.graphics.BitmapShader;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.RectF;
import android.graphics.Shader;
// enables hardware accelerated rounded corners
// original idea here : http://www.curious-creature.org/2012/12/11/android-recipe-1-image-with-rounded-corners/
package com.example.picassodemo;
import android.graphics.Bitmap;
import android.graphics.BitmapShader;
import android.graphics.Canvas;
import android.graphics.Paint;
import com.squareup.picasso.Transformation;
/**
location /api {
rewrite ^/api/rest /api.php?type=rest last;
rewrite ^/api/v2_soap /api.php?type=v2_soap last;
rewrite ^/api/soap /api.php?type=soap last;
}
All breakout session presentations:
http://www.imagineecommerce.com/2013breakouts/
Magento: Best practices for hosting
http://www.nexcess.net/magento-best-practices-whitepaper
http://info.magento.com/rs/magentocommerce/images/HostandBoastBestPracticesForMagentoHosting.pdf
Data Isolation and Merchandizing in a Single Magento Instance
http://info.magento.com/rs/magentocommerce/images/DataIsolationandMerchandizinginaSingleMagentoInstance.pdf
<?php
/*
To make the cleaning expired carts automatic, override cleanExpiredQuotes with the following
version which will also take care of the old active carts: app/code/core/Mage/Sales/Model/Observer.php
*/
public function cleanExpiredQuotes($schedule)
{
// extending limit
@olivermontes
olivermontes / magento-customer-view.sql
Created September 30, 2013 11:54
Magento - Vista mysql para ver todos los datos del customer
CREATE VIEW customer_view AS
SELECT e.entity_id,
e.group_id,
e.store_id,
e.website_id,
e.email,
confirmation.value AS confirmation,
created_in.value AS created_in,
default_billing.value AS default_billing,
<?php
$installer = Mage::getResourceModel('catalog/setup', 'catalog_setup');
if (!$installer->getAttributeId(Mage_Catalog_Model_Product::ENTITY, 'attribute_name')) {
$installer->addAttribute(Mage_Catalog_Model_Product::ENTITY, 'attribute_name', array( // TABLE.COLUMN: DESCRIPTION:
'label' => 'Label', // eav_attribute.frontend_label admin input label
'group' => 'General', // (not a column) tab in product edit screen
'sort_order' => 0 // eav_entity_attribute.sort_order sort order in group
'backend' => 'module/class_name', // eav_attribute.backend_model backend class
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript">
var f_page = "wvumountaineers"; // the page name for your fan page, e.g. the 'wvumountaineers' part of http://facebook.com/wvumountaineers
var t_page = "westvirginiau"; // the account name for your main twitter account
function add_commas(number) {
if (number.length > 3) {
var mod = number.length % 3;
@olivermontes
olivermontes / Magento - config xml overview and examples.xml
Created September 4, 2013 12:35
Magento - config xml overview and examples.xml
<config>
<modules>
<!-- Modules declaration and initialization, like in app/etc/modules/namespace_module.xml -->
</modules>
<global>
<!-- Configurations that should be shared between all scope, for example database settings class declaration/rewrites -->
<!-- overwriting magento model/block/helper classes example -->
<models/blocks/helper>
<module_name>
<rewrite>