Skip to content

Instantly share code, notes, and snippets.

View RabeaWahab's full-sized avatar
🎯

Rabea Abdelwahab RabeaWahab

🎯
View GitHub Profile
<?php
class Packagename_Modulename_Block_Block extends Mage_Cms_Block_Block
{
public function getCacheKeyInfo() {
return array('block_id' => $this->getBlockId());
}
}
?>
<?php
@RabeaWahab
RabeaWahab / Observer.php
Last active August 29, 2015 14:12
Observer
<?php
class Packagename_Modulename_Model_Observer
{
public function enableCmsBlockCaching($observer)
{
$block = $observer->getBlock();
if ($block instanceof Mage_Cms_Block_Widget_Block
|| $block instanceof Mage_Cms_Block_Block
) {
$cacheKeyData = array(
<table>
<thead>
<tr><th>File Path</th>
<th>Event</th>
</tr></thead>
<tbody>
<tr>
<td>app/code/core/Mage/Customer/Model/Address/Abstract.php</td>
<td> 'customer_address_format'</td>
</tr>
$this->startSetup();
/**
* Use those two commands to delete the attribute for testing
*/
//$this->removeAttribute('catalog_category', 'custom_attribute_1');
//$this->removeAttribute('catalog_category', 'custom_attribute_2');
// creating the attributes
module.exports = {
'EXAMPLE.com HomePage': function (test) {
// Just a random number
var now = Math.floor(Date.now() / 1000);
test
// Open EXAMPLE.com
.open('http://www.EXAMPLE.com')
{
"tests": [
{
"id": "test2",
"name": "EXAMPLE.com HomePage",
"browser": "PhantomJS",
"status": true,
"passedAssertions": 5,
"failedAssertions": 0,
"actions": [
package main
import (
"fmt"
"math/rand"
"time"
"runtime"
)
func init() {
public function retrieveCoupon($observer)
{
$payment = $observer->getEvent()->getPayment();
$order = $payment->getOrder();
if ($code = $order->getCouponCode()) {
$coupon = Mage::getModel('salesrule/coupon')->load($code, 'code');
$coupon->setTimesUsed($coupon->getTimesUsed()-1);
$coupon->save();
/*
* The weathermap application.
*/
var express = require('express');
var request = require('request');
// Rabea: checkout out Dotenv module, it is a better way of handling creds
var config = require('./config');
var app = express();

Keybase proof

I hereby claim:

  • I am rabeawahab on github.
  • I am rabeawahab (https://keybase.io/rabeawahab) on keybase.
  • I have a public key ASALsUBGwZ57UO0lnsPmTnu7HpD4OmoYbTtOkyjaoOHLZQo

To claim this, I am signing this object: