Skip to content

Instantly share code, notes, and snippets.

@goliver79
goliver79 / utils.vb
Last active August 29, 2015 14:14
[VB .NET] Display Current Version
Private Sub showCurrentVersion(lbl As Label)
Dim ver As String = ""
Try
' the application is installed using ClickOnce
ver = My.Application.Deployment.CurrentVersion.ToString
Catch ex As Exception
' the application is not installed
ver = My.Application.Info.Version.ToString
End Try
lbl.Text = ver
@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 :",
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)",
@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 / 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' );
<?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 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;
}
@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 / 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 / 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 / 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