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 / 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 / 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(
@subharanjanm
subharanjanm / Setup.md
Created November 11, 2015 11:36 — forked from suvozy/Setup.md
Setup AWS EC2 and RDS (php5.5, apache2.4, mysql5.5, phpmyadmin)
add_filter( 'tw_cite_html', 'my_testimonials_widget_cite_html', 10, 3 );
function my_testimonials_widget_cite_html( $cite, $testimonial, $atts ) {
if ( ! empty( $testimonial['is-nurse'] ) ) {
$cite .= ', <b>' . $testimonial['is-nurse'] . '</b>';
}
return $cite;
}
add_filter( 'tw_query_args', array( &$this, 'query_args' ), 10, 2 );
public function query_args( $args, $atts ) {
global $wpdb;
$args['post_type'] = $atts['post_type'];
$no_cache = $atts['no_cache'];
if ( $no_cache ) {
$args['no_cache'] = 1;
<?php # -*- coding: utf-8 -*-
/*
Plugin Name: All Actions List
Description: Lists all actions run during one request.
Version: 1.0
Required: 3.1
Author: Thomas Scholz
Author URI: http://toscho.de
License: GPL
*/
add_action( 'bp_setup_nav', 'add_videos_subnav_tab', 100 );
function add_videos_subnav_tab() {
global $bp;
bp_core_new_subnav_item( array(
'name' => 'Videos',
'slug' => 'videos',
'parent_url' => trailingslashit( bp_loggedin_user_domain() . 'friends' ),