Skip to content

Instantly share code, notes, and snippets.

@goliver79
goliver79 / autoConvert.sh
Last active September 19, 2021 01:25
[LINUX] Convert MP4 to MP3
#!/bin/bash
for f in *.mp4
do
echo "Converting $f"
name=`echo "$f" | sed -e "s/.mp4$//g"`
ffmpeg -i "$f" -vn -acodec libmp3lame -ac 2 -ab 160k -ar 48000 "$name.mp3"
done
@goliver79
goliver79 / install_apk.bat
Last active August 29, 2015 13:56
[ANDROID] Install apk with adb
@ECHO OFF
REM Usage:
REM install_apk MyApp.apk
adb install %1
@goliver79
goliver79 / functions.php
Created February 27, 2014 14:36
[PHP] Convert date in MySQL format
<?php
$date = '22/02/2014';
$date = date( str_replace( "/", "-", $date ) );
$date = date("Y-m-d", strtotime( $date ) );
echo $date; //2014-02-22
@goliver79
goliver79 / ebay.js
Last active August 29, 2015 13:57
[JAVASCRIPT] Code for bookmarlet. Change current ebay page EBAY.ES <--> EBAY.COM
var loc = self.parent.location;
var url = loc.href;
var ebaycom = ".ebay.com/";
var ebayes = ".ebay.es/";
var origin, destination;
origin = "";
if (url.indexOf(ebaycom) >= 0) {
origin = ebaycom;
destination = ebayes;
} else if (url.indexOf(ebayes) >= 0) {
@goliver79
goliver79 / OpenUrl.vb
Last active November 15, 2023 21:19
[EXCEL] VBA Open URL with default browser
'EXCEL Macro
'open url with default browser
Sub callWebPage(url)
ActiveWorkbook.FollowHyperlink _
Address:=url, _
NewWindow:=True, _
AddHistory:=True
End Sub
'usage
@goliver79
goliver79 / functions.php
Created April 19, 2014 17:38
[WOOCOMMERCE] Hide empty categories in Woocommerce Widget Product Categories
<?php
/*
* @goliver79
* woocommerce hide empty categories in woocommerce widget "product categories"
*/
function woo_hide_product_categories_widget( $list_args ){
$list_args[ 'hide_empty' ] = 1;
return $list_args;
}
<?php
/**
* Plugin Name: Static Templates
*
* If most of your site content is in .php template files, and you're tired of
* creating new pages, assigning them page templates, creating page templates
* then doing it all over again on production, this plugin is for you.
*
* Examples:
*
@goliver79
goliver79 / functions.php
Created April 21, 2014 06:21
[WOOCOMMERCE] Hide category items count in shop thumbnails
<?php
/*
* woocommerce hide category items count in shop thumbnails
*/
function woo_hide_subcategory_count_html( $html ){
return '';
}
add_filter( 'woocommerce_subcategory_count_html', 'woo_hide_subcategory_count_html' );
@goliver79
goliver79 / functions.php
Created April 21, 2014 07:11
[WOOCOMMERCE] Get only products with price
<?php
/*
* @goliver79
* get only products with price
* ordered by date DESC (newer first)
*/
$posts = new WP_Query ( array (
'post_type' => 'product',
'order' => 'DESC',
'orderby' => 'date',
@goliver79
goliver79 / js-dataTables.js
Created May 31, 2014 07:29
[JAVASCRIPT] DataTables Spanish initialization
jQuery(document).ready( function () {
$ = jQuery;
var table = $('#plans2').DataTable({
language: {
processing: "Procesando...",
search: "Buscar&nbsp;:",
lengthMenu: "Ver _MENU_ elementos",
info: "Viendo _START_ a _END_ de <b>_TOTAL_ elementos</b>",
infoEmpty: "Viendo 0 a 0 de 0 elementos",
infoFiltered: "(filtrados de _MAX_ elementos en total)",