This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Faker class to generate dummy posts in WordPress | |
* | |
* @author Amit Gupta <http://amitgupta.in/> | |
* | |
* @since 2019-11-28 | |
*/ | |
namespace iG\Inc\Utilities; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* PHP cli script to re-encode data in a MySQL database from latin1 to utf8. | |
* The script expects table columns to already be on utf8 charset and 'utf8_unicode_ci' collation. | |
* It just re-encodes data from latin1 to utf8 so that the data is legible instead of appearing as gibberish. | |
* | |
* @author Amit Gupta <http://amitgupta.in/> | |
* @copyright 2019 Amit Gupta <http://amitgupta.in/> | |
* @licence GPL v3 | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: iG: Sample Plugin | |
Plugin URI: http://igeek.info/ | |
Description: This is a sample plugin for code evaluation only | |
Version: 1.0 | |
Author: Amit Gupta | |
License: GPL v2 | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//initial code to set error reporting, xdebug customization etc. | |
if ( defined('WP_CLI') && WP_CLI ) { | |
if( empty( WP_CLI::get_runner()->config['url'] ) ) { | |
error_log( "You need to set url." ); | |
exit; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* This function accepts an array and joins all values in a string separated by | |
* a comma except the last value which is preceeded by 'and' instead of a comma | |
*/ | |
function to_sentence( $array = array() ) { | |
if( empty( $array ) || ! is_array( $array ) ) { | |
return $array; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name SVN Diff Colorizer for GMail (based almost wholly on Beanstalk Diff Colorizer for Gmail - http://userstyles.org/styles/14853) | |
// @namespace http://userstyles.org | |
// @description Adds colorization to SVN diffs received via Could be made to work with your webmail of choice, and probably some other SVN hosts, with minimal fuss. | |
// @author Matt Gillooly | |
// @modifiedBy 2012-10-21 Amit Gupta | |
// @include http://mail.google.com/* | |
// @include https://mail.google.com/* | |
// @include http://*.mail.google.com/* | |
// @include https://*.mail.google.com/* |