Skip to content

Instantly share code, notes, and snippets.

@vmasciotta
vmasciotta / topbar-foundation-drupal.php
Last active November 27, 2017 01:02
Foundation Zurb TopBar Navigation for Drupal
//add this in page.tpl.php
<?php if ($main_menu): ?>
<div class="row">
<div class="twelve columns">
<nav id="navigation" class="top-bar">
<ul>
<li class="name"><h1><a href="#">Navigation</a></h1></li>
<li class="toggle-topbar"><a href="#"></a></li>
</ul>
<section class="section">
@vmasciotta
vmasciotta / magento-empty-base.css
Created September 9, 2013 16:19
Magento blank default css rules
/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE_AFL.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
@vmasciotta
vmasciotta / ProductController.php
Last active December 29, 2015 08:09
Mageno Adminhtml Rewrites config
<?php
require_once Mage::getModuleDir('controllers', 'Mage_Adminhtml') . DS . 'Catalog' . DS . 'ProductController.php'; //faccio il require della classe da estendere
class Namespace_Valerio_Catalog_ProductController extends Mage_Adminhtml_Catalog_ProductController{
public function newAction(){
echo "Ho riscritto il core di newAction";
die;
}
}
@vmasciotta
vmasciotta / sandbox.php
Last active August 29, 2015 14:01
Magento Sandbox
<?php
ini_set('display_errors', 1);
require "app/Mage.php";
Mage::init();
Mage::setIsDeveloperMode(true);
umask(0);
@vmasciotta
vmasciotta / httpd.conf
Last active August 29, 2015 14:02
Example Demo VirtualHost Magento
NameVirtualHost *:80
Include /etc/httpd/vhosts.d/*.conf
@vmasciotta
vmasciotta / magento_reset_orders
Created July 8, 2014 08:50
Sql instructions to reset test orders and customers
-- *****************for customers*****************
SET FOREIGN_KEY_CHECKS=0;
-- reset customers
TRUNCATE customer_address_entity;
TRUNCATE customer_address_entity_datetime;
TRUNCATE customer_address_entity_decimal;
TRUNCATE customer_address_entity_int;
TRUNCATE customer_address_entity_text;
TRUNCATE customer_address_entity_varchar;
#!/bin/bash
# Patch apllying tool template
# v0.1.2
# (c) Copyright 2013. Magento Inc.
#
# DO NOT CHANGE ANY LINE IN THIS FILE.
# 1. Check required system tools
_check_installed_tools() {
local missed=""
@vmasciotta
vmasciotta / sandbox.php
Created April 5, 2016 00:27
Magento2 Sandbox
<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
//echo "hello world";
try {
require __DIR__ . '/app/bootstrap.php';
@vmasciotta
vmasciotta / trim
Created April 16, 2016 09:21
Cron daily trim
# place this few lines in /etc/cron.daily/trim
#!/bin/sh
LOG=/var/log/trim.log
echo "*** $(date -R) ***" >> $LOG
fstrim -v / >> $LOG
@vmasciotta
vmasciotta / 0001-fix-bug-admin-manufacturer-search.patch
Created May 6, 2016 15:48
Zeon Manufacturer admin search grid patch
From 6aba001aedc29f3c2b69f81dd46cd2bb38be97ca Mon Sep 17 00:00:00 2001
From: valerio masciotta <sviluppo@valeriomasciotta.it>
Date: Fri, 6 May 2016 15:32:53 +0000
Subject: [PATCH] fix bug admin manufacturer search
---
.../Zeon/Manufacturer/Model/Mysql4/Manufacturer/Collection.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/code/community/Zeon/Manufacturer/Model/Mysql4/Manufacturer/Collection.php b/app/code/community/Zeon/Manufacturer/Model/Mysql4/Manufacturer/Collection.php