Skip to content

Instantly share code, notes, and snippets.

View enis-ismail's full-sized avatar

Enis Ismail enis-ismail

  • AIOPSGROUP Ltd.
  • Bulgaria
View GitHub Profile
@enis-ismail
enis-ismail / gist:7786211
Last active September 10, 2020 11:36
Magento: Get attribute option's label by ID and vice versa
<?php
$productModel = Mage::getModel('catalog/product');
$attr = $productModel->getResource()->getAttribute("color");
if ($attr->usesSource()) {
echo $color_id = $attr->getSource()->getOptionId("Red");
echo $color_label = $attr->getSource()->getOptionText("8");
}
@enis-ismail
enis-ismail / gist:9206023
Last active July 18, 2017 07:55
Magento: Get all configurable products' children from a category
<?php
require_once 'app/Mage.php';
Mage::app();
$categoryId = 86;
$products = Mage::getModel('catalog/product')->getCollection()
->addAttributeToSelect('*')
->addAttributeToFilter('type_id', 'configurable')
->joinField('category_id', 'catalog/category_product', 'category_id', 'product_id = entity_id', null, 'left')
<remove name="right"/>
OR
<reference name="right">
<action method="unsetChildren"></action>
</reference>
to remove all blocks on right side bar
<?xml version="1.0" encoding="UTF-8"?>
<layout>
<!-- ############# GLOBAL LAYOUT UPDATES ############# -->
<default>
<!-- Remove unwanted blocks entirely
<remove name="right.poll"/>
<remove name="right.permanent.callout"/>
@enis-ismail
enis-ismail / NetBeans code templates
Created May 20, 2014 08:36
NetBeans code templates
dump
Zend_Debug::dump(${VARIABLE variableFromPreviousAssignment default=""}${selection}${cursor}, null, true);
ifip
if($_SERVER['REMOTE_ADDR'] == 'yo.ur.ip.he.re') {
${selection}${cursor}
}
mail
mail('[email protected]', 'Debug', print_r(${VARIABLE variableFromPreviousAssignment default=""}${selection}${cursor}, true));
@enis-ismail
enis-ismail / prepare-commit-msg
Last active March 10, 2019 09:57
Git hooks: prepare-commit-msg
#!/bin/bash
# Instructions to make hooks executable:
#- for Windows (attrib +x prepare-commit-msg)
#- for Linux (chmod +x prepare-commit-msg)
# -------------------------------------------------------------------------------------- #
# Retrieve Ticket ID from the branch name and insert it as prefix for the commit message #
# -------------------------------------------------------------------------------------- #
branch_name="$(git symbolic-ref --short HEAD)"
@enis-ismail
enis-ismail / pre-commit
Last active March 10, 2019 09:57
Git hooks: pre-commit
#!/bin/bash
# Instructions to make hooks executable:
#- for Windows (attrib +x pre-commit)
#- for Linux (chmod +x pre-commit)
# ---------------------------------------------------------- #
# Prevent committing changes for files from specific folders #
# ---------------------------------------------------------- #
for SRC_PATTERN in "app_storefront_base" "modules"; do
@enis-ismail
enis-ismail / resume.json
Last active April 16, 2020 07:10
resume.json
{
"basics": {
"name": "Thomas Davis",
"label": "Web Developer",
"image": "https://avatars0.githubusercontent.com/u/416209?s=460&u=38f220a2c9c658141804f881c334c594eb1642ac&v=4",
"summary": "I’m a full stack web developer who can build apps from the ground up. I've worked mostly at startups so I am use to wearing many hats. I am a very product focussed developer who priotizes user feedback first and foremost. I'm generally very flexible when investigating new roles. ",
"website": "https://ajaxdavis.com",
"email": "[email protected]",
"location": {
"city": "Melbourne",