Skip to content

Instantly share code, notes, and snippets.

Debabrata Karfa debabratakarfa

Block or report user

Report or block debabratakarfa

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
debabratakarfa / checkStr.js
Last active Nov 28, 2019
Check two string (May be they are not in order but contain similar string char)
View checkStr.js
// if we pass rats and star will be match
// if we pass star and wars then it will be not match
function checkStr(A, B) {
if(A && B) {
var x = A.split('').sort(),
y = B.split('').sort(),
count = 0;
if(x.length != y.length) {
debabratakarfa / classLPS.php
Last active Nov 22, 2019
Longest Palindromic Substring
View classLPS.php
class Solution {
* @param String $s
* @return String
function longestPalindrome($data) {
debabratakarfa / amp.php
Last active Aug 12, 2019
Add Navigation Menu to an AMP WordPress Theme
View amp.php
* Register the amp-sidebar component script with WP AMP.
function add_amp_sidebar_component_script( $data ) {
$data['amp_component_scripts']['amp-sidebar'] = '';
return $data;
add_filter( 'amp_post_template_data', 'add_amp_sidebar_component_script' );
View Add Extra cost
add_filter('wf_ups_rate', 'wf_modify_ups_rate', 10, 2);
function wf_modify_ups_rate($xml, $packages){
//Config this array with box dimensions and rate to be added.
$extra_coast = array(
'7,9,8' => 10,
'10,6,8' => 15,
foreach ($extra_coast as $extra_coast_dim => $amount_to_add) {
debabratakarfa / vagrant
Last active May 23, 2019
Install Virtual-box and Vagrant
View vagrant
sudo bash -c 'echo deb any main > /etc/apt/sources.list.d/wolfgang42-vagrant.list'
sudo apt-key adv --keyserver hkp:// --recv-key AD319E0F7CFFA38B4D9F6E55CE3F3DE92099F7A4
sudo apt-get update
sudo apt-get install vagrant
vagrant --version
debabratakarfa / plugin-main-file.php
Last active Apr 28, 2019
WooCommerce Custom Rest API Endpoint v3 [creating for https://domain.tld/wc-api/v3/my-custom-endpoint]
View plugin-main-file.php
add_action( 'woocommerce_api_loaded', 'my_plugin_load_api' );
add_filter( 'woocommerce_api_classes', 'my_plugin_add_api' );
function my_plugin_load_api() {
include_once 'your-api-endpoint-class.php';
function my_plugin_add_api( $apis ) {
return $apis;
debabratakarfa / admin.js
Created Apr 26, 2019
admin_enqueue_scripts file not working
View admin.js
// import external dependencies
import 'jquery';
// Import everything from autoload
import './autoload/**/*'
// import local dependencies
import Router from './util/Router';
import adminCommon from './routes/adminCommon';
View button with OR
import React from 'react'
import Button from '@bit/semantic-org.semantic-ui-react.button'
const style = <link rel='stylesheet' href=''/>
const ButtonExampleGroupOrSize = () => (
<Button.Group size='large'>
<Button.Or />
View post-expiration-date.php
class DropdownOptionSetting {
private $hugu_ped_setting_options;
public function __construct() {
add_action( 'admin_menu', array( $this, 'hugu_ped_setting_add_plugin_page' ) );
add_action( 'admin_init', array( $this, 'hugu_ped_setting_page_init' ) );
debabratakarfa /
Created Dec 4, 2018 — forked from sebacius/
Install a working Kazoo Installation
# Change the following Parametrs for your setup
#Common Params
export IP=""
export HOST="somehost"
export DOMAIN=""
export MASTER_ACCOUNT="CompanyName"
You can’t perform that action at this time.