Skip to content

Instantly share code, notes, and snippets.

View luzeduardo's full-sized avatar

Eduardo Luz luzeduardo

  • Porto
  • 02:39 (UTC +01:00)
View GitHub Profile
@luzeduardo
luzeduardo / initDev.sh
Created April 4, 2012 13:57
Setting new Machine Servers, PHP and Libs. (Ubuntu 11.04/64-bit)
#!/bin/sh
echo 'Setting up Servers ...'
sudo apt-get install mysql-server mysql-client
sudo apt-get install apache2
sudo apt-get install memcached
sudo apt-get install libapache2-mod-php5
echo 'Setting up PHP ...'
@luzeduardo
luzeduardo / gist:2940115
Created June 16, 2012 05:48
xdebug.ini with vagrant remote debug
zend_extension=<%= %x[find /usr/lib/php5 -name 'xdebug.so' 2> /dev/null] %>
xdebug.default_enable=1
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_host=33.33.33.1
xdebug.remote_port=9000
xdebug.remote_autostart=0
@luzeduardo
luzeduardo / .gitignore
Created September 14, 2012 03:05
Magento gitignore
.modgit/
app/code/community/Find/
app/code/community/Phoenix/
app/code/core/
app/design/adminhtml/default/default/
app/design/adminhtml/default/find/
app/design/frontend/base/
app/design/frontend/default/blank/
app/design/frontend/default/default/
app/design/frontend/default/iphone/
@luzeduardo
luzeduardo / MagentoAutoSelectFunction
Last active December 11, 2015 02:58
Magento - Auto choose product attribute in produtct Page
<script type="text/javascript">
var spConfig = new Product.Config(<?php echo $this->getJsonConfig() ?>);
spConfig.setInitialState = function(dropdown_id){
var dropdown = $(dropdown_id);//select dropdown
dropdown[0].remove();//remove empty option from dropdown so it is not selectable after initial selection
for( index = 0; index < dropdown.length; index++ ){//change selections in dropdowns
if(dropdown[index].value != ""){
dropdown.selectedIndex = index;
@luzeduardo
luzeduardo / ajaxloadinglistener.js
Last active December 11, 2015 02:58
Magento 1.6/1.7 ajax load listener for jquery and Prototype post actions. Add into app/design/frontend/default/YOURTHEME/layout/page.xml inside <block type="page/html_head" name="head" as="head"> as <action method="addItem"><type>skin_js</type><script>js/ajaxloadinglistener.js</script></action>
//Ajax listener
jQuery(document).ready(function () {
jQuery(document).ajaxStart(function () { showProgress() }).ajaxStop(function () { hideProgress() });
});
function showProgress() {
jQuery('body').append('<div id="progress"><img src="/skin/frontend/default/YOURTHEME/img/loading.gif" alt="" width="32" height="32" /></div>');
jQuery('#progress').center();
}
function hideProgress() {
jQuery('#progress').remove();
@luzeduardo
luzeduardo / .htaccess
Created January 26, 2013 23:46
Magento htaccess smooth boost performance
## default index file
DirectoryIndex index.php
<IfModule mod_php5.c>
############################################
## adjust memory limit
# php_value memory_limit 64M
@luzeduardo
luzeduardo / apc.ini
Created January 26, 2013 23:58
Apc config for boost performance in magento - first step
apc.shm_size=512M
apc.num_files_hint=10000
apc.user_entries_hint=10000
apc.max_file_size=5M
;devel
apc.stat=0
;prod
;apc.stat=1
apc.optimization=0
@luzeduardo
luzeduardo / varnish3_magento.vcl
Last active February 19, 2016 16:46
Varnish 3.0 for magento default site configuration
#
# Module Varnish VCL Configuration file
#
# @author Hugues Alary <hugues.alary@gmail.com>
# @copyright 2012
# @license GNU General Public License, version 3 (GPL-3.0)
#
# Beginning of the config
@luzeduardo
luzeduardo / ExampleSeleniumLoop
Last active July 14, 2016 20:21
Selenium loop example with Selenium IDE + https://github.com/darrenderidder/sideflow
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head profile="http://selenium-ide.openqa.org/profiles/test-case">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="selenium.base" href="http://localhost" />
<title>ExampleSeleniumLoop</title>
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
@luzeduardo
luzeduardo / Varnish_Magento_vcl
Created March 21, 2013 19:32
Varnsh Magento vcl version 3
# This is a basic VCL configuration file for varnish by Ideaspool.
#
# Default backend definition. Set this to point to your content
# server.
#
backend default {
.host = "192.168.0.116";
.port = "80";
}
acl trusted {