Skip to content

Instantly share code, notes, and snippets.

@subharanjanm
subharanjanm / autopgsqlbackup
Created September 20, 2021 01:30 — forked from matthewlehner/autopgsqlbackup
Auto PostgreSQL backup script.
#!/bin/bash
#
# PostgreSQL Backup Script Ver 1.0
# http://autopgsqlbackup.frozenpc.net
# Copyright (c) 2005 Aaron Axelsen <axelseaa@amadmax.com>
#
# This script is based of the AutoMySQLBackup Script Ver 2.2
# It can be found at http://sourceforge.net/projects/automysqlbackup/
#
# The PostgreSQL changes are based on a patch agaisnt AutoMySQLBackup 1.9
@subharanjanm
subharanjanm / php-block.js
Created July 31, 2018 07:08 — forked from pento/php-block.js
Converting a shortcode to a block
// License: GPLv2+
var el = wp.element.createElement,
registerBlockType = wp.blocks.registerBlockType,
ServerSideRender = wp.components.ServerSideRender,
TextControl = wp.components.TextControl,
InspectorControls = wp.editor.InspectorControls;
/*
* Here's where we register the block in JavaScript.
@subharanjanm
subharanjanm / gist:b5bfb81213470de88de13261101cf4dd
Created July 26, 2018 08:49 — forked from ultimatemember/gist:8cdaf61e7bd9de35512c
Extending Ultimate Member Profile Menu using Hooks
/* First we need to extend main profile tabs */
add_filter('um_profile_tabs', 'add_custom_profile_tab', 1000 );
function add_custom_profile_tab( $tabs ) {
$tabs['mycustomtab'] = array(
'name' => 'My custom tab',
'icon' => 'um-faicon-comments',
);
@subharanjanm
subharanjanm / tw_testimonials_js.php
Created January 7, 2018 13:50
Changing the star image path to something you'd like to use - Testimonials Widget Premium
<?php
/**
* Changing the star image path to something you'd like to use.
*/
function axl_replace_raty_icons( $scripts, $testimonials, $atts, $widget_number ) {
if ( ! empty( $scripts ) ) {
$find = "path: '//localhost/twp/wp-content/plugins/testimonials-widget-premium/assets/images/'";
$replace = "path: '//localhost/twp/wp-content/uploads/raty-icons/'";
@subharanjanm
subharanjanm / testimonials-tag-cloud.php
Created December 6, 2017 03:33
Testimonials Widget Tag Cloud Link Customization
<?php
global $tw_template_args;
if ( ! function_exists( 'axl_modify_tag_cloud_link' ) ) {
function axl_modify_tag_cloud_link( $tags_data ) {
foreach ( $tags_data as $key => $tag ) {
if ( ( ! empty( $tag['url'] ) ) && $tag['url'] != '#' ) {
$tag['url'] = $tag['url'] . '?post_type=testimonials-widget';
}
}
@subharanjanm
subharanjanm / clamav-mac.md
Created August 30, 2016 14:16 — forked from dkobia/clamav-mac.md
Get ClamAV running on Mac OS X (using Homebrew)

Get ClamAV running on Mac OS X (using Homebrew)

The easiest way to get the ClamAV package is using Homebrew

$ brew install clamav

Before trying to start the clamd process, you'll need a copy of the ClamAV databases.

Create a freshclam.conf file and configure as so

@subharanjanm
subharanjanm / testimonials-widget-premium__templates__testimonial-image.php
Created July 29, 2016 11:22
Link to large thumbnail image in Testimonials Widget
<?php
global $tw_template_args;
$testimonial = $tw_template_args['testimonial'];
$link_before = Axl_Testimonials_Widget_Premium::get_template_part( 'link', 'before' );
$link_after = Axl_Testimonials_Widget_Premium::get_template_part( 'link', 'after' );
if( ! empty( $testimonial['testimonial_image'] ) ) {
$large_thumb_url = '';
if ( has_post_thumbnail( $testimonial['post_id'] ) ) {
@subharanjanm
subharanjanm / axl-slides-sitemap.php
Last active June 1, 2016 07:48
Adds a new sitemap entry for Axelerant Presentation Slides into the sitemap index created by Yoast SEO plugin. `wpseo_sitemap_index` , `wpseo_enable_xml_sitemap_transient_caching`
<?php
/**
* Plugin Name: AXL Slides Sitemap
* Plugin URI: https://gist.github.com/subharanjanm/885a0e7a63ad8d4f142c545221ea7e0c
* Description: Adds a new sitemap entry for Axelerant Presentation Slides into the sitemap index created by Yoast SEO plugin.
* Version: 1.0
* Author: Subharanjan
* Author URI: https://gist.github.com/subharanjanm/885a0e7a63ad8d4f142c545221ea7e0c
* License: GPLv2 or later
*/
@subharanjanm
subharanjanm / deactivate-plugins-wpe-staging.php
Last active March 19, 2024 19:09
Deactivate certain plugins in the development/staging environment of WP Engine
<?php
/*
Plugin Name: Deactivate Certain Plugins - WPEngine Staging
Plugin URI: https://gist.github.com/subharanjanm/4272d25a446fb2ca12a549a4a5662633
Description: Deactivate certain plugins in the development/staging environment of WP Engine.
Version: 1.0
Author: Subharanjan
Author URI: https://gist.github.com/subharanjanm/4272d25a446fb2ca12a549a4a5662633
License: GPLv2
*/
@subharanjanm
subharanjanm / wp-query-ref.php
Created May 13, 2016 05:47 — forked from luetkemj/wp-query-ref.php
WP: Query $args
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.com
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters
* Source: https://core.trac.wordpress.org/browser/tags/3.9/src/wp-includes/query.php
*/
$args = array(