Skip to content

Instantly share code, notes, and snippets.

View kish2011's full-sized avatar
🏠
Working from home

Kishore Chandra Sahoo kish2011

🏠
Working from home
View GitHub Profile
@kish2011
kish2011 / compareimage.php
Created November 20, 2017 16:11 — forked from petecoop/compareimage.php
Using PHP's GD library compares the similarity between 2 images with the same dimensions. This is based on the colour's in spread out positions and returns a rating out of 100.
<?php
function compareImages($imagePathA, $imagePathB, $accuracy){
//load base image
$bim = imagecreatefromjpeg($imagePathA);
//create comparison points
$bimX = imagesx($bim);
$bimY = imagesy($bim);
$pointsX = $accuracy*5;
$pointsY = $accuracy*5;
$sizeX = round($bimX/$pointsX);
@kish2011
kish2011 / ngrok-installation.md
Created June 16, 2017 09:45 — forked from jwebcat/ngrok-installation.md
Installing ngrok on Mac

#Installing ngrok on OSX

  1. Download ngrok
  2. Unzip it to your Applications directory
  3. Create a symlink (instructions below)

Creating a symlink to ngrok

Run the following two commands in Terminal to create the symlink.

# cd into your local bin directory
@kish2011
kish2011 / remove_preview_step_wpjm.php
Created June 6, 2017 08:37 — forked from danfisher85/remove_preview_step_wpjm.php
Remove preview step for job and resume (WP Job Manager)
/**
* Remove the preview step for Job
* @param array $steps
* @return array
*/
if ( !function_exists( 'handyman_custom_submit_job_steps' ) ) {
function handyman_custom_submit_job_steps( $steps ) {
unset( $steps['preview'] );
return $steps;
}
/**
* Allow to remove method for an hook when, it's a class method used and class don't have variable, but you know the class name :)
* @see https://github.com/herewithme/wp-filters-extras
*/
function remove_filters_for_anonymous_class( $hook_name = '', $class_name ='', $method_name = '', $priority = 0 ) {
global $wp_filter;
// Take only filters on right hook name and priority
if ( !isset($wp_filter[$hook_name][$priority]) || !is_array($wp_filter[$hook_name][$priority]) )
return false;
@kish2011
kish2011 / Contract Killer 3.md
Created March 28, 2017 17:00
The latest version of my ‘killer contract’ for web designers and developers

Contract Killer

The popular open-source contract for web professionals by Stuff & Nonsense

  • Originally published: 23rd December 2008
  • Revised date: March 15th 2016
  • Original post

@kish2011
kish2011 / function.php
Last active February 3, 2020 16:49
Add [past_applications] ShortCode to BuddyPress Job Manager
function setup_past_application_nav() {
global $bp;
if ( ! class_exists( 'WP_Job_Manager' ) )
return;
if ( ! class_exists( 'BP_Job_Manager' ) )
return;
if ( ! class_exists( 'WP_Job_Manager_Applications' ) )
return;
@kish2011
kish2011 / function.php
Created March 23, 2017 12:05
Give user option to select NA/ Leave the rating for a particular category.
/**
* Allow to remove method for an hook when, it's a class method used and class don't have variable, but you know the class name :)
*/
function remove_filters_for_anonymous_class( $hook_name = '', $class_name ='', $method_name = '', $priority = 0 ) {
global $wp_filter;
// Take only filters on right hook name and priority
if ( !isset($wp_filter[$hook_name][$priority]) || !is_array($wp_filter[$hook_name][$priority]) )
return false;
// Loop on filters registered
foreach( (array) $wp_filter[$hook_name][$priority] as $unique_id => $filter_array ) {
@kish2011
kish2011 / functions.php
Created March 23, 2017 09:26 — forked from tripflex/functions.php
WordPress Remove Filter (remove_filter converted to remove_class_filter) to remove Filter/Action without Class Object access. Works with WordPress 1.2+ (4.7+ support added 9-19-2016)
<?php
/**
* Remove Class Filter Without Access to Class Object
*
* In order to use the core WordPress remove_filter() on a filter added with the callback
* to a class, you either have to have access to that class object, or it has to be a call
* to a static method. This method allows you to remove filters with a callback to a class
* you don't have access to.
*
* Works with WordPress 1.2+ (4.7+ support added 9-19-2016)
<?php
/**
* WP_Job_Manager_Form_Register class.
*/
class WP_Job_Manager_Form_Register extends WP_Job_Manager_Form {
public static $form_name = 'register';
protected static $job_id;
protected static $preview_job;
protected static $steps;
@kish2011
kish2011 / job-listings-start.php
Created March 6, 2017 11:47
job-listings-start.php
<h2 id="titlebar">Showing <span class="count_jobs"></span> Jobs</h2>
<ul class="job_listings">