Skip to content

Instantly share code, notes, and snippets.

@ajaydsouza
ajaydsouza / top-10-grid.css
Last active August 29, 2015 14:18
Top 10: 2x Grid
.tptn_title {
float: left;
clear: left!important;
}
.tptn_thumb {
align: center!important;
}
.tptn_posts,
.tptn_posts_daily {
margin-bottom: 20px;
@ajaydsouza
ajaydsouza / tptn_viewed_count.php
Created April 18, 2015 17:55
Top 10 - Don't track nextpage
<?php
/**
* Filter_tptn_viewed_count function.
*
* @param string $output Top 10 tracker script
* @return string Filtered tracker script
*/
function filter_tptn_viewed_count( $output ) {
global $wp_query;
@ajaydsouza
ajaydsouza / NumberFormat.vba
Created May 9, 2015 16:50
Custom Number Format from Range
Sub NumberFormat()
' Range should be formatted as "TEXT";"TEXT"
Range("B2:B19").NumberFormat = Range("C2:C19").Value
End Sub
@ajaydsouza
ajaydsouza / clean-files.sh
Created June 30, 2015 13:23
Delete DS_Store & Thumbs.db
sudo find . -name '*.DS_Store' -type f -delete
sudo find . -name 'Thumbs.db' -type f -delete
@ajaydsouza
ajaydsouza / same-language.php
Last active September 26, 2015 00:34
CRP / Top 10 - WPML functions
<?php
/**
* This function forces all related / top ten posts are from the same language.
*
* @param bool $return_original_if_missing
*/
function filter_return_ori( $return_original_if_missing ) {
return true;
}
@ajaydsouza
ajaydsouza / bsearch-examples.php
Created December 26, 2015 21:06
Examples of using various filters in Better Search WordPress plugin
<?php
/**
* Filter to override the censor character in Better Search.
*
* @param string Default censor string
*
* @return string Censored string
*/
function filter_bsearch_censor_char( $censorChar ) {
return "*";
@ajaydsouza
ajaydsouza / rsync.sh
Last active March 29, 2016 09:34
rsync basic syntax
rsync -va --progress SourceFolder DestinationFolder
@ajaydsouza
ajaydsouza / filter_tptn_view_counter_script_url.php
Last active September 4, 2016 11:45
Alternate Tracking script - Filter script URL in Top 10 v2.x
<?php
/**
* Use external display of counter.
*
* @since 2.3.0
*
* @param string $home_url
* @return string
*/
@ajaydsouza
ajaydsouza / crp-same-post-type.php
Created March 28, 2016 16:25
CRP - Limit to same post type
<?php
/**
* Filter the post types to limit it to the same post type.
*
* @param array $post_types Array of post types included in WHERE clause
* @return array Updated array of post types
*/
function crp_same_post_type( $post_types ) {
global $post;
@ajaydsouza
ajaydsouza / Install automysqlbackup.md
Last active December 12, 2016 21:46 — forked from janikvonrotz/Install automysqlbackup.md
Ubuntu: Install automysqlbackup#MySQL#Markdown

Introduction

AutoMySQLBackup with a basic configuration will create Daily, Weekly and Monthly backups of one or more of your MySQL databases from one or more of your MySQL servers.

Requirements

  • Ubuntu server
  • MySQL

Installation