Skip to content

Instantly share code, notes, and snippets.

View pinedamg's full-sized avatar
🧠
Work smarter, Not harder

Pineda Mauricio Gastón pinedamg

🧠
Work smarter, Not harder
View GitHub Profile
@pinedamg
pinedamg / 1.markdown
Created July 23, 2012 18:10
My Magento Snippets

My Magento Snippets

Checkout virtual - downloadable product

<?php

require_once '../app/Mage.php';
 
Varien_Profiler::enable();
@pinedamg
pinedamg / gist:3201090
Created July 29, 2012 18:46 — forked from astorm/gist:992233
Fix console.log in Chrome and Magento
<!-- Add to the package layout (via local.xml or however you prefer) -->
<!-- Also, best to remove before deployment, as some users report -->
<!-- it makes IE 7 crash -->
<default>
<reference name="content">
<block type="core/text" name="fix.console" as="fix.console">
<action method="setText">
<text><![CDATA[<script type="text/javascript">
iframe = document.createElement('iframe');
iframe.style.display = 'none';
@pinedamg
pinedamg / gist:3201113
Created July 29, 2012 18:56 — forked from jamapag/gist:1452130
Magento Snippets

Magento Snippets

Download extension manually using pear/mage

Pear for 1.4, mage for 1.5. File downloaded into /downloader/.cache/community/

./pear download magento-community/Shipping_Agent
./mage download community Shipping_Agent

Clear cache/reindex

@pinedamg
pinedamg / export-attributes.markdown
Created August 2, 2012 14:15
Magento Attributes

Magento SSH

Reset permissions

find . -type f -exec chmod 644 {} \;
find . -type d -exec chmod 755 {} \;
chmod -R o+w media var
chmod o+w app/etc
@pinedamg
pinedamg / Linux_Tips_And_Tricks.mkd
Last active October 16, 2019 12:06
Linux Helpful Things

#Linux commands, tips & tricks#

##Arreglar acentos y eñes## find . -name '?' | xargs convmv -r --notest -f cp850 -t UTF-8

SSH | ssh-add

###error could not open a connection to your authentication ### eval ssh-agent; echo $SSH_AUTH_SOCK

Console apps

@pinedamg
pinedamg / gittips.mkd
Created August 25, 2012 02:53
Git Tips

Git Tips & Tricks

Ignore CHMOD

git config core.filemode false

@pinedamg
pinedamg / admin_user.php
Created March 18, 2014 23:23
Add Admin User
<?php
define( 'USERNAME', 'new.user' );
define( 'PASSWORD', 'password' );
define( 'FIRSTNAME', 'Excited' );
define( 'LASTNAME', 'Croc' );
define( 'EMAIL', 'new.user@magento.com' );
include_once( 'app/Mage.php' );
Mage::app( 'admin' );
try {

Magento Snippets

Download extension manually using pear/mage

Pear for 1.4, mage for 1.5. File downloaded into /downloader/.cache/community/

./pear download magento-community/Shipping_Agent
./mage download community Shipping_Agent

Clear cache/reindex

SET FOREIGN_KEY_CHECKS = 0;
TRUNCATE TABLE catalog_product_bundle_option;
TRUNCATE TABLE catalog_product_bundle_option_value;
TRUNCATE TABLE catalog_product_bundle_price_index;
TRUNCATE TABLE catalog_product_bundle_selection;
TRUNCATE TABLE catalog_product_bundle_selection_price;
TRUNCATE TABLE catalog_product_bundle_stock_index;
TRUNCATE TABLE catalog_product_enabled_index;
TRUNCATE TABLE catalog_product_entity;