Skip to content

Instantly share code, notes, and snippets.

View anandkumar's full-sized avatar

Anand Kumar anandkumar

View GitHub Profile
@mandiwise
mandiwise / Update remote repo
Last active October 23, 2024 07:20
Transfer repo from Bitbucket to Github
// Reference: http://www.blackdogfoundry.com/blog/moving-repository-from-bitbucket-to-github/
// See also: http://www.paulund.co.uk/change-url-of-git-repository
$ cd $HOME/Code/repo-directory
$ git remote rename origin bitbucket
$ git remote add origin https://github.com/mandiwise/awesome-new-repo.git
$ git push origin master
$ git remote rm bitbucket
@zackkatz
zackkatz / EDD Admin-Only Test Payments
Last active July 24, 2018 04:51
Allow admins to use test payments in Easy Digital Downloads for a live store.
<?php
/*
Plugin Name: EDD Test Payments
Plugin URI: https://gist.github.com/zackkatz/7418620
Description: Allow admins to use Test Payment even when it's not enabled.
Author: Katz Web Services, Inc.
Version: 1.0
Author URI: http://katz.co
*/
@pyronaur
pyronaur / gist:5387539
Last active October 2, 2019 11:13
sanitize_html_class works just fine for a single class But sometimes le wild `<span class="blue hedgehog">` appears, which is when you need this function, to validate both blue and hedgehog, Because sanitize_html_class doesn't allow spaces (because it's meant for a single class)
<?php
if ( ! function_exists( "sanitize_html_classes" ) && function_exists( "sanitize_html_class" ) ) {
/**
* sanitize_html_class works just fine for a single class
* Some times le wild <span class="blue hedgehog"> appears, which is when you need this function,
* to validate both blue and hedgehog,
* Because sanitize_html_class doesn't allow spaces.
*
* @uses sanitize_html_class
@ntwb
ntwb / ntwb_bbpress_show_lead_topic.php
Last active October 11, 2015 06:17
bbPress - Show Lead Topic
<?php
/*
Plugin Name: bbPress - Show Lead Topic
Plugin URI: https://gist.github.com/ntwb/3815686
Description: bbPress - Show Lead Topic
Version: 0.2
Author: Stephen Edgar - Netweb
Author URI: http://netweb.com.au
*/
@maxxscho
maxxscho / functions.php
Created March 17, 2012 12:48
Wordpress: Shortcode Empty Paragraph fix
function shortcode_empty_paragraph_fix($content)
{
$array = array (
'<p>[' => '[',
']</p>' => ']',
']<br />' => ']'
);
$content = strtr($content, $array);