Skip to content

Instantly share code, notes, and snippets.

View fjaguero's full-sized avatar
🏠
Working from home

Fernando Agüero fjaguero

🏠
Working from home
View GitHub Profile
@fjaguero
fjaguero / blinks.css
Created August 13, 2013 16:32
CSS3 Blink
@import "compass"
$icons: sprite-map("icons/*.png")
i
background: $icons
display: inline-block
@each $i in sprite_names($icons)
.icn-#{$i}
@fjaguero
fjaguero / preferences.sublime-settings
Created July 15, 2013 08:12
Sublime Text 2 Config
{
"auto_complete": true,
"bold_folder_labels": true,
"close_windows_when_empty": false,
"color_scheme": "Packages/Color Scheme - Default/Monokai.tmTheme",
"draw_white_space": "all",
"ensure_newline_at_eof_on_save": true,
"font_face": "Ubuntu Mono",
"font_size": 14.0,
"highlight_line": true,
@fjaguero
fjaguero / wp-no-category-base.php
Created April 9, 2013 16:30
Wordpress: No Category Base
<?php /*
WP No Category Base
*/
// Refresh rules on activation/deactivation/category changes
register_activation_hook(__FILE__, 'no_category_base_refresh_rules');
add_action('created_category', 'no_category_base_refresh_rules');
add_action('edited_category', 'no_category_base_refresh_rules');
add_action('delete_category', 'no_category_base_refresh_rules');
function no_category_base_refresh_rules() {
@fjaguero
fjaguero / wp-shortcode.php
Created March 11, 2013 12:41
Wordpress: Example Shortcode
/* @Workether ------------------------------------------------------------
English price
--------------------------------------------------------------------------*/
function price_shortcode( $atts, $content = null ) {
extract( shortcode_atts( array(
'class' => 'price',
), $atts ) );
@fjaguero
fjaguero / wp-list-current-category.php
Created February 28, 2013 11:01
Wordpress: wp_list_categories -> Generate the current-cat class when viewing single posts.
/* @Workether ------------------------------------------------------------
Generate the current-cat class when viewing single posts.
--------------------------------------------------------------------------*/
class singlePostCurrentCat {
function wp_list_categories ($text) {
global $post;
$categories = wp_get_post_categories($post->ID);
foreach ($categories as $category_id) {
$category = get_category($category_id);
$text = preg_replace(
@fjaguero
fjaguero / complete-css-queries.css
Created February 27, 2013 09:36
CSS: Complete Media Queries
/*
===================================== DESKTOP, LARGE SCREENS ====
*/
@media only screen and (min-width: 1200px) {
}
/*
@fjaguero
fjaguero / sql-prestashop-products.sql
Created February 26, 2013 10:21
Prestashop: SQL All Products
SELECT p.id_product, p.active, pl.name, GROUP_CONCAT(DISTINCT(cl.name) SEPARATOR ",") as categories, p.price, p.id_tax_rules_group, p.wholesale_price, p.reference, p.supplier_reference, p.id_supplier, p.id_manufacturer, p.upc, p.ecotax, p.weight, p.quantity, pl.description_short, pl.description, pl.meta_title, pl.meta_keywords, pl.meta_description, pl.link_rewrite, pl.available_now, pl.available_later, p.available_for_order, p.date_add, p.show_price, p.online_only, p.condition, p.id_shop_default
FROM ps_product p
LEFT JOIN ps_product_lang pl ON (p.id_product = pl.id_product)
LEFT JOIN ps_category_product cp ON (p.id_product = cp.id_product)
LEFT JOIN ps_category_lang cl ON (cp.id_category = cl.id_category)
LEFT JOIN ps_category c ON (cp.id_category = c.id_category)
LEFT JOIN ps_product_tag pt ON (p.id_product = pt.id_product)
WHERE pl.id_lang = 1
AND cl.id_lang = 1
AND p.id_shop_default = 1
@fjaguero
fjaguero / sql-replace-like.sql
Created February 18, 2013 12:31
SQL: Replace a string inside a string with LIKE.
UPDATE ps_product_lang
SET ps_product_lang.description
= REPLACE(ps_product_lang.description,'http://server/demo/img/','http://server/img/')
WHERE ps_product_lang.description like '%http://server/demo/img/%';
@fjaguero
fjaguero / prestashop-aritmetic-var.tpl
Last active December 13, 2015 17:39
Smarty: Simple Prestashop aritmetic operation with variables
{if $feature.id_feature == 16 }
{assign var="shopPrice" value="`$feature.value`"}
{/if}
{if isset($shopPrice)}
<div class="tienda-discount">
{if $feature.id_feature == 16 }
{assign var="shopPrice" value="`$feature.value`"}