Skip to content

Instantly share code, notes, and snippets.

View claudiu-marginean's full-sized avatar

Claudiu Marginean claudiu-marginean

View GitHub Profile
@davidalexander
davidalexander / gist:1086455
Last active July 12, 2024 07:05
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

@davidalexander
davidalexander / gist:1086773
Created July 16, 2011 20:47
.htaccess Environments
# http://thenerdary.net/articles/entry/htaccess-environments
RewriteEngine On
RewriteBase /
### SET UP ENVIORNMENTS ###
# Default to master
RewriteRule .* - [E=ENVIRONMENT:master]
<block type="cms/block" name="block_name">
<action method="setBlockId"><id>block_code</id></action>
</block>
{{block type="cms/block" block_id="block_code"}}
{{block type="catalog/product_list" category_id="79" template="catalog/product/list_random.phtml"}}
@j-manu
j-manu / uri.js
Created April 21, 2012 04:07 — forked from jlong/uri.js
URI Parsing with Javascript
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.host; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
@pgraham
pgraham / gist:4127832
Created November 21, 2012 21:22
function to create a mock iterator over an array using PHPMock
/**
* Create a mock iterator over the given array.
*
* @param array $a
* @param string $class The class to use for the mock, should be/implement/extend Iterator
* @param boolean $complete Whether or not to build a complete iteration. This is
* used when an exception/break is expected in the middle of the iteration.
* @param integer $numElms The number of elements that should be iterated in the case of an
* incomplete iteration.
*/
@claudiu-marginean
claudiu-marginean / Magento-Snippets-Claudiu.md
Last active July 6, 2021 08:54
Magento Snippets - Claudiu

Magento Snippets

Code snippets from different sections of Magento that are very useful.

JS Translation in phtml files

<script>
//<![CDATA[
Translator.add(
    <?php echo Mage::helper('core')->jsonEncode(array(
@greenwellness
greenwellness / wagner.cson
Created May 22, 2014 00:27
A contrived setup of many different Magento composer packages
{
name: 'greenwellness/wellnessbon'
description: 'Definitie voor Green Wellness Wellnessbon.'
license: 'proprietary'
'minimum-stability': 'dev'
config:
anonymous
anonymous / httpd-vhosts.conf
Created November 3, 2014 08:42
Created with Gistr for Brackets.iohttps://github.com/LucasKA/Gistr
<VirtualHost *:80>
DocumentRoot "D:/www/_BuyerQuest"
ServerName local.buyerquest.net
ServerAlias local.buyerquest.net
#SetEnv MAGE_IS_DEVELOPER_MODE "true"
<Directory "D:/www/_BuyerQuest">
Options Indexes FollowSymLinks
AllowOverride All
@claudiu-marginean
claudiu-marginean / httpd-vhosts.conf
Last active August 29, 2015 14:08 — forked from anonymous/httpd-vhosts.conf
VirtualHost in XAMPP with https (with certif from localhost)
<VirtualHost *:80>
DocumentRoot "D:/www/project-name"
ServerName local.project-name.net
ServerAlias local.project-name.net
#SetEnv MAGE_IS_DEVELOPER_MODE "true"
<Directory "D:/www/project-name">
Options Indexes FollowSymLinks
AllowOverride All
@maxivak
maxivak / 00. tutorial.md
Last active September 11, 2024 19:58
Importing/Indexing database (MySQL or SQL Server) in Solr using Data Import Handler