Skip to content

Instantly share code, notes, and snippets.

@victor-falcon
victor-falcon / gist:3312403
Created August 10, 2012 07:46
SQL to insert Spanish States in Prestashop
INSERT INTO ps_state (id_country, id_zone, name, iso_code, tax_behavior, active)
VALUES (6, 1, "Álava", "ALA", 0, 1);
INSERT INTO ps_state (id_country, id_zone, name, iso_code, tax_behavior, active)
VALUES (6, 1, "Albacete", "ALB", 0, 1);
INSERT INTO ps_state (id_country, id_zone, name, iso_code, tax_behavior, active)
VALUES (6, 1, "Alicante", "ALC", 0, 1);
INSERT INTO ps_state (id_country, id_zone, name, iso_code, tax_behavior, active)
VALUES (6, 1, "Almería", "ALM", 0, 1);
INSERT INTO ps_state (id_country, id_zone, name, iso_code, tax_behavior, active)
VALUES (6, 1, "Asturias", "AST", 0, 1);
@victor-falcon
victor-falcon / gist:2658912
Created May 11, 2012 10:43
Make links more responsive
/*
Moving the link 1px this gives the feeling of being clickable
*/
a:active { position: relative; top: 1px;}
@victor-falcon
victor-falcon / gist:2203693
Created March 26, 2012 07:29
Print only one Div
<script type="text/javascript">
function imprimir() {
var bName = navigator.appName;
var bVer = parseFloat(navigator.appVersion);
var contenido = document.getElementById("fotos").innerHTML;
ventana=window.open("/print.php","ventana","width=280,height=411");
ventana.document.open();
ventana.document.write('<html><head><title>Su traje</title><link rel="stylesheet" type="text/css" media="all" href="http://localhost:8888/trajesguzman/wp-content/themes/trajesguzman/style.css" /></head><body style="background-color: #FFFFFF" id="print"><div class="page-id-533">');
ventana.document.write(contenido);
@victor-falcon
victor-falcon / gist:2157391
Created March 22, 2012 09:46
Evita la selección de texto
/*
Añadiendo estas propiedades a un elemento evitamos que el texto se seleccione. Es perfecto para botones hechos con css.
*/
.no-select {
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
@victor-falcon
victor-falcon / gist:2028450
Created March 13, 2012 12:19
Perfect Verticaly and Horizontaly aligment of Elements
<script type="text/javascript">
(function ($) {
$.fn.vAlign = function() {
return this.each(function(i){
var h = $(this).height();
var oh = $(this).parent().height();
var mt = (oh - h) / 2;
$(this).css("margin-top", mt + "px");
});
};
@victor-falcon
victor-falcon / gist:2021125
Created March 12, 2012 10:47
Saving Contact Form 7 data into a MailChimp List
<?php
/*
Guardando email de Contact Form 7 en MailChimp
Necesita el archivo MCAPI.class.php de la API de MailChimp
En este en concreto usamos un checbox con el nombre subscribe para comprobar si el
usuario quiere subscribirse o no. En caso afirmativo guardamos el nombre y el email
en la lista concreta de nuestro MailChimp.
@victor-falcon
victor-falcon / animate-anchor.js
Last active October 1, 2015 13:28
Animate Anchors
/*
* Animate all anchors links
* Add Jquery
*/
jQuery(document).ready(function($) {
$("a[href*=#]").click(function(event) {
if ($(this).attr('href').indexOf(document.URL) >= 0)
event.preventDefault();
@victor-falcon
victor-falcon / gist:1993590
Created March 7, 2012 14:47
[Joomla] Access to Current User Object
<?php
/*
* More at
* http://docs.joomla.org/Accessing_the_current_user_object
*/
$user =& JFactory::getUser();
if ($user->guest) {
// Guest
echo "You'r a guest";
} else {