Skip to content

Instantly share code, notes, and snippets.

View carcam's full-sized avatar

Carlos (carcam) carcam

View GitHub Profile
<?php
$moment = "tarde";
$moment = preg_filter('@[a-z]@', '\ ${0}', $moment);
echo $moment;
@carcam
carcam / ps_googleanalytics.tpl
Last active December 1, 2020 14:42
Override del módulo oficial de Analytics de PrestaShop 1.7 para usarlo sin cookies (Cookieless Analytics)
{**
* 2014-2020 Hepta Technologies SL
*
* INSTRUCCIONES:
*
* ESTE OVERRIDE SÓLO FUNCIONA PARA LA VERSIÓN 1.7 DE PRESTASHOP Y USANDO EL MÓDULO OFICIAL DE GOOGLE ANALYTICS
*
* Una vez configurado el módulo, sube este fichero a:
*
* /themes/[CARPETA DE TU TEMA]/modules/ps_googleanalytics/views/templates/hook/ps_googleanalytics.tpl
@carcam
carcam / default_form.php
Last active August 16, 2017 12:14
Override to add privacy policy checkbox to com_contact
<?php
/**
* @author Carlos Cámara
* @url https://www.hepta.es
*
* @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
@carcam
carcam / getApplePodcastReviews.php
Last active August 5, 2017 08:35
Get itunes reviews for podcasts
<?php
//Set here the Apple ID of your podcast
$iTunesId = 1241730868;
$countries =["benl","befr","bg","cz","dk","de","ee","es","fr","gr","hr","ie","it","lv","li","lt","lu","mk","hu","mt","md","me","nl","no","at","pl","pt","ro","ru","sk","si","chde","chfr","fi","se","tr","uk","lae","lae","la","lae","lae","lae","la","br","lae","lae","cl","co","la","lae","la","la","la","lae","la","lae","la","lae","mx","lae","la","la","la","la","lae","lae","lae","lae","lae","lae","lae","la","la","la","lae","ca","lae","la",];
$countries = array_unique($countries);
foreach ($countries as $country)
@carcam
carcam / htaccess-optimizado.txt
Last active June 21, 2017 11:54
htaccess optimizado
### ===========================================================================
### Security Enhanced & Highly Optimized .htaccess File for Joomla!
### automatically generated by Admin Tools 3.6.8 on 2016-01-15 22:02:05 GMT
### Auto-detected Apache version: 2.5 (best guess)
### ===========================================================================
###
### The contents of this file are based on the same author's work "Master
### .htaccess", published on http://snipt.net/nikosdion/the-master-htaccess
###
### Admin Tools is Free Software, distributed under the terms of the GNU
#!sh
if [ $# -lt 3 ]
then
echo "USAGE: [FOLDER in htdocs] [COMPONENT NAME: com_whatever] [REPOSITORY FOLDER]"
exit
fi
SITE="$1"
COMPONENT="$2"
REPOSITORY="${3}"
@carcam
carcam / imgopt.sh
Created December 11, 2015 09:46
Image optimization bash script
##
# @author Carlos Cámara <cmcamara@gmail.com> based on the script by freakie guy <freakie2007@gmail.com>
# @package Batch Optimize Image for web performance similar to Compressor.io
# @requirement jpegoptim, optipng
##
#
# Folder path
#
@carcam
carcam / gist:8cc32389a181d2c40ef7
Created May 20, 2015 09:10
Get Joomgouts MP3
youtube-dl --playlist-start 53 --dateafter `date -v-monday +%Y%m%d` -x --audio-format mp3 http://www.youtube.com/playlist?list=PLIcuwIrm4rKeCBZYvueddKTA4yFcHsQqZ
count=`ls -1 *.mp3 2>/dev/null | wc -l`
if [ $count != 0 ]
then
mensaje="¡Hay un nuevo programa de Joomgouts listo!"
else
mensaje="Esta semana no hay programa de Joomgouts :("
fi
#Display Apple notification: http://apple.stackexchange.com/questions/57412/how-can-i-trigger-a-notification-center-notification-from-an-applescript-or-shel
@carcam
carcam / gist:51e076db9c1b6f9843c1
Last active August 29, 2015 14:20
Load images correctly in multilingual for Joomla
# Load images correctly in multilingual for Joomla
# This fixes when images are requested as http://www.site.com/en/images/myimage.png
# Although the best solution is to add the slash / to your images path: src="/images/myimage.png" in your content
RewriteRule ^[a-z]{2}/images/(.*) /images/$1
@carcam
carcam / gist:4d50e287873730125df1
Created May 1, 2015 23:02
Bootstrap 3 same column height
//http://stackoverflow.com/questions/23287206/same-height-column-bootstrap-3-row-responsive
$( document ).ready(function() {
var heights = $(".well").map(function() {
return $(this).height();
}).get(),
maxHeight = Math.max.apply(null, heights);
$(".well").height(maxHeight);
});