Skip to content

Instantly share code, notes, and snippets.

View molotovbliss's full-sized avatar
⚗️
Code, Eat, Sleep++;

Jared molotovbliss

⚗️
Code, Eat, Sleep++;
  • DFW, Texas
View GitHub Profile
@colinmollenhour
colinmollenhour / buildhtaccess.sh
Created June 30, 2010 22:42
.htaccess combiner
#!/bin/bash
# Author: Colin Mollenhour
#
# Usage: Run from the webroot, .htaccess-combined will be created.
dest='.htaccess-combined'
pwd=`pwd`
echo -n "" > $dest
while read -r file; do
loc=`dirname $file`
@ticean
ticean / Category.sql
Created December 10, 2010 04:45
A series of queries for selecting Magento entity EAV attributes, and their values. Lots of union here...
SET @entityid = '3';
SELECT ea.attribute_id, ea.attribute_code, eav.value AS 'value', 'varchar' AS 'type'
FROM catalog_category_entity e
JOIN catalog_category_entity_varchar eav
ON e.entity_id = eav.entity_id
JOIN eav_attribute ea
ON eav.attribute_id = ea.attribute_id
WHERE e.entity_id = @entityid
UNION
Windows Registry Editor Version 5.00
;
; Running this file will give you an extra context menu item in Windows Explorer
; "Delete SVN folders"
;
; For the selected folder, it will remove all subfolders named ".svn" and their content
; Tip from http://www.iamatechie.com/remove-all-svn-folders-in-windows-xp-vista/
;
; Enrichened with comments by Jesper Rønn-Jensen ( http://justaddwater.dk/ )
;
@alistairstead
alistairstead / gist:1053331
Created June 29, 2011 07:36
Find bad things in Magento customisations
find . -name "*.phtml" -print | xargs grep --color=auto -iRnH "Mage::getModel("
find . -name "*.phtml" -print | xargs grep --color=auto -iRnH "Mage::getResourceModel("
find . -name "*.phtml" -print | xargs grep --color=auto -iRnH "Mage::getSingleton("
find . -name "*.phtml" -print | xargs grep --color=auto -iRnH "SELECT.*FROM.*;[\"\']"
find . -name "*.php" -print | xargs grep --color=auto -iRnH "htmlEscape("
find ./app/code/local -name "*.php" -print | xargs grep --color=auto -iRnH "htmlEscape("
find ./app/code/local -name "*/Block/*.phtml" -print | xargs grep --color=auto -iRnH "SELECT.*FROM.*;[\"\']"
find ./app/code/local -name "*.php" -print | xargs grep --color=auto -iRnH "\$_[GET|REQUEST|SERVER|POST]"
find ./app/code/local -name "*.php" -print | xargs grep --color=auto -iRnH "public _construct"
find . -name "*.php" -print | xargs grep --color=auto -iRnH "public _construct"
@leek
leek / _Magento1_DeleteTestData.md
Last active December 29, 2023 09:51
Magento 1 - Delete All Test Data

These set of scripts are for Magento 1. For Magento 2, see this Gist.

@p01
p01 / LICENSE.txt
Created October 13, 2011 19:29 — forked from 140bytes/LICENSE.txt
Music SoftSynth
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Mathieu 'p01' Henri http://www.p01.org/releases/
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@Vinai
Vinai / setup.php
Created November 8, 2011 20:35
Example EAV setup script using createEntityTables(), installEntities() and addAttribute()
<?php
/* @var $installer Mage_Eav_Model_Entity_Setup */
$installer = Mage::getModel('eav/entity_setup', 'default_setup');
$installer->startSetup();
// Example createEntityTables() call
$installer->createEntityTables('example_supplier');
<?php
namespace Pokus;
class Exception extends \Exception
{
}
function tttt($string)
{
try {
@drewgillson
drewgillson / customers.sql
Created January 6, 2012 07:08
Customer report from Magento
-- assuming Magento 1.6.1 data model
SELECT DISTINCT customer_email,
COUNT(*) AS purchases,
(SELECT LEFT(created_at,11) FROM `sales_flat_order` WHERE customer_email = a.customer_email ORDER BY created_at DESC LIMIT 0,1) AS last_purchase,
(SELECT COUNT(*) FROM sales_flat_order_item WHERE product_type = 'simple' AND sku LIKE '%IB%' AND order_id IN (SELECT entity_id FROM `sales_flat_order` WHERE customer_email = a.customer_email)) AS icebreaker,
(SELECT COUNT(*) FROM sales_flat_order_item WHERE product_type = 'simple' AND sku LIKE '%TNF%' AND order_id IN (SELECT entity_id FROM `sales_flat_order` WHERE customer_email = a.customer_email)) AS the_north_face,
(SELECT COUNT(*) FROM sales_flat_order_item WHERE product_type = 'simple' AND sku LIKE '%MHW%' AND order_id IN (SELECT entity_id FROM `sales_flat_order` WHERE customer_email = a.customer_email)) AS mountain_hardwear,
(SELECT COUNT(*) FROM sales_flat_order_item WHERE product_type = 'simple' AND sku LIKE '%MAR%' AND order_id IN (SELECT entity_id FROM `sales
$attributeSetName = 'Editorial Product';
// active_from
$entityTypeId = Mage::getModel('eav/entity')
->setType('catalog_product')
->getTypeId();
$setId = $installer->getAttributeSet($entityTypeId, $attributeSetName, 'attribute_set_id');
// Add attribute set if it does not exists
if($setId === null) {