Skip to content

Instantly share code, notes, and snippets.

View jacquesbh's full-sized avatar
🏠
Working from home

Jacques Bodin-Hullin jacquesbh

🏠
Working from home
View GitHub Profile
@jacquesbh
jacquesbh / core_text.xml
Last active December 10, 2015 02:09
Ajouter un script externe au header sur Magento (http://jacques.sh/ajouter-un-script-externe-au-header-sur-magento.html)
<block type="core/text" name="head.jquery">
<action method="setText">
<text><![CDATA[<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>]]></text>
</action>
</block>
<?php
Zend_Debug::dump(Mage::app()->getLayout()->getUpdate()->getHandles());
We can make this file beautiful and searchable if this error is corrected: Any value after quoted field isn't allowed in line 1.
"stores";"sku";"filename";"attributes";"exclude"
"admin";"HTC Touch Diamond";"htc_touch_diamond.png";"image";"no"
"admin,default,french";"intelc2d";"intelc2d.png";"";"yes"
"german";"intelc2d";"intelc2d.png";"small_image,thumbnail";"no"
_site
<?php
/* @var $installer Mage_Catalog_Model_Resource_Eav_Mysql4_Setup */
$installer = $this;
$installer->startSetup();
// Add the attribute `baz` with some fields
$installer->addAttribute(Mage_Catalog_Model_Product::ENTITY, 'baz', array(
'label' => 'The Baz', // The label ;)
@jacquesbh
jacquesbh / hints.php
Created February 1, 2013 14:26
Change hints in Magento quickly ;)
<?php
defined('__DIR__') || define('__DIR__', dirname(__FILE__));
// Inclure Mage
require_once __DIR__ . '/../app/Mage.php';
// Init Mage
Mage::app('admin')->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
@jacquesbh
jacquesbh / Helper.php
Last active December 14, 2015 05:09
[Blog] Bien afficher un attribut personnalisé http://jacques.sh/2013/02/afficher-un-attribut.html
<?php
class Jbh_ProductAttribute_Helper_Output extends Mage_Core_Helper_Abstract
{
/**
* Change the output of our attribute
* @param Mage_Catalog_Helper_Output $outputHelper The helper
* @param string $attributeHtml The HTML
* @param array $params The parameters
@jacquesbh
jacquesbh / add_keys.sh
Created March 16, 2013 12:51
Install MariaDB on debian squeeze
sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xcbcb082a1bb943db
@jacquesbh
jacquesbh / guest_mount.sh
Created August 2, 2013 17:12
vagrant nfs errors
vagrant@vagrant-debian-wheezy:~$ sudo mount -v -o vers=3 192.168.42.1:'/Users/jacques/Sites/laurecrea/htdocs/' /var/www/magento/
mount: no type was given - I'll assume nfs because of the colon
mount.nfs: timeout set for Fri Aug 2 13:11:26 2013
mount.nfs: trying text-based options 'vers=3,addr=192.168.42.1'
mount.nfs: prog 100003, trying vers=3, prot=6
mount.nfs: trying 192.168.42.1 prog 100003 vers 3 prot TCP port 2049
mount.nfs: prog 100005, trying vers=3, prot=17
mount.nfs: trying 192.168.42.1 prog 100005 vers 3 prot UDP port 44373
mount.nfs: mount(2): Permission denied
mount.nfs: access denied by server while mounting 192.168.42.1:/Users/jacques/Sites/laurecrea/htdocs/
@jacquesbh
jacquesbh / firewall
Last active February 18, 2021 17:14
/etc/init.d/firewall Iptables firewall
#!/bin/sh
### BEGIN INIT INFO
# Provides: firewall
# Required-Start:
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Firewall
# Description: Configure all iptables rules.