Skip to content

Instantly share code, notes, and snippets.

View rintoug's full-sized avatar

Rinto George rintoug

View GitHub Profile
<config>
<modules>
<Namespace_Modulename>
<version>0.1.0</version>
</Namespace_Modulename>
</modules>
</config>
@rintoug
rintoug / gist:fbdb6a08ca3998d00ccabacf4965cd06
Last active July 20, 2016 06:17
Insert a post programatically in wordpress
require_once "ABSOLUTE_PATH/script/wp-load.php";
$product = Mage::getModel('catalog/product')->load($productId);
$cats = $product->getCategoryIds();
foreach ($cats as $category_id) {
$_cat = Mage::getModel('catalog/category')->load($category_id) ;
echo $_cat->getName();
}
<?xml version="1.0"?>
<config>
<modules>
<Writeyoucode_Customer>
<active>true</active>
<codePool>local</codePool>
</Writeyoucode_Customer>
</modules>
</config>
<?xml version="1.0"?>
<config>
<modules>
<Writeyourcode_Customer>
<version>1.0</version>
</Writeyourcode_Customer>
</modules>
<frontend>
<routers>
<?php
/**
* Account controller
*
*/
require_once 'Mage/Customer/controllers/AccountController.php';
class Writeyourcode_Customer_AcccountController extends Mage_Customer_AccountController
{
/**
* Product view action
<?xml version="1.0"?>
<config>
<modules>
<Namespace_Contacts>
<version>0.0.1</version>
</Namespace_Contacts>
</modules>
<frontend>
<routers>
<contacts>
<?xml version="1.0"?>
<config>
<modules>
<Namespace_Contacts>
<active>true</active>
<codePool>local</codePool>
</Namespace_Contacts>
</modules>
</config>
@rintoug
rintoug / form.php
Last active February 20, 2017 10:06
Server Side Form Validation using Regular Expressions
<?php
//Declaring the variables
$error_name = '';
$error_email= '';
$error_gender ='';
//Validation part
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
$name = $_POST['name'];
@rintoug
rintoug / code1.sh
Created March 9, 2017 05:47
How To Install and Configure Varnish with Apache on Ubuntu 16.04
sudo apt-get update
sudo apt-get install varnish