Skip to content

Instantly share code, notes, and snippets.

View obiPlabon's full-sized avatar
🎯
1 goal

Md Obidullah obiPlabon

🎯
1 goal
View GitHub Profile
@obiPlabon
obiPlabon / mailchimp-url.md
Last active September 25, 2017 09:44
Simple way to figure out MailChimp subscribe form URL for AjaxChimp plugin (https://github.com/scdoshi/jquery-ajaxchimp)

Figuring Out MailChimp Subscribe Form URL

First of all check this article on MailChimp knowledge base Host Your Own Signup Form. If you're at point 1, then take a look at the following picture. We need those 3 highlighted items to form a URL.

Form code

Copy those items and form a URL like the following:

http://mailchimp.us8.list-manage.com/subscribe/post??u=a123cd45678ef90g7h1j7k9lm&id=ab2c468d10
<?php
/**
* Plugin Name: EDD Heartbeat API test plugin
* Description: Demonstrates how to use the Heartbeat API to update the payments count on the dashboard
*/
// Load the heartbeat JS
function edd_heartbeat_enqueue( $hook_suffix ) {
// Make sure the JS part of the Heartbeat API is loaded.
wp_enqueue_script( 'heartbeat' );
<?php
add_filter( 'product_type_options', 'op_set_product_type_options_default' );
/**
* Set virtual and downloadable checkbox to checked
* @param array $options Checkbox options
* @return array Updated options
*/
function op_set_product_type_options_default( $options ) {
$options['virtual']['default'] = 'yes';
<?php
// Way Two
/**
* Set comment textarea to the bottom of comment form
* only works with WordPress version >= 4.4
* @param array $fields Comment form inputs
*/
function op_change_comment_textarea_position( $fields ) {
$comment = array('comment' => $fields['comment'] );
unset( $fields['comment'] );
@obiPlabon
obiPlabon / wp-async-script-loader.php
Created May 15, 2017 11:20
Modify script tag in WordPress to load scripts in async mood or defer mood
<?php
/**
* Add async boolean attribute to script tag
* @param string $tag Default script tag
* @return string Modified script tag
*/
function omm_add_async_loading( $tag ) {
return str_replace( '<script', '<script async', $tag );
}
add_filter( 'script_loader_tag', 'omm_add_async_loading' );
/**
* Answer 7
*/
#include <stdio.h>
void main()
{
int i, j;
int num[3][4] = {
{10,12,14,16},
/**
* Figure out unique numbers from an array
*
*/
#include <stdio.h>
int main()
{
int arr[10], arr_size;
@obiPlabon
obiPlabon / functions.php
Created February 6, 2017 15:20 — forked from EmranAhmed/functions.php
Hook Info. Get Action hook info. What functions are hooked to an action / filter in WordPress? How can I see all the actions attached to an "add_action" hook?
<?php
if ( ! function_exists( 'hippo_plugin_hook_info' ) ):
function hippo_plugin_hook_info( $hook_name ) {
global $wp_filter;
$docs = array();
$template = "\t - %s Priority - %s.\n\tin file %s #%s\n\n";
echo '<pre>';
/* global jQuery, wp */
jQuery( function( $ ) {
var initializeAllClocks, initializeClock;
/**
* Find clocks.
*
* @param [container] Scoping element for finding clock elements.
* @returns {void}
@obiPlabon
obiPlabon / non-semantic.html
Created January 22, 2017 05:41
Simple difference between Semanctic, Partial Semanctic and Non Semantic markup
<div class="article">
<div class="heading">Article Heading</div>
<div class="article-content">
<div class="paragraph">
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
</div>
<div class="paragraph">
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse