Skip to content

Instantly share code, notes, and snippets.

View PrafullaKumarSahu's full-sized avatar

Prafulla Kuamr Sahu PrafullaKumarSahu

View GitHub Profile
@PrafullaKumarSahu
PrafullaKumarSahu / list-of-curl-options.txt
Created September 11, 2020 11:11 — forked from eneko/list-of-curl-options.txt
List of `curl` options
$ curl --help
Usage: curl [options...] <url>
--abstract-unix-socket <path> Connect via abstract Unix domain socket
--alt-svc <file name> Enable alt-svc with this cache file
--anyauth Pick any authentication method
-a, --append Append to target file when uploading
--basic Use HTTP Basic Authentication
--cacert <file> CA certificate to verify peer against
--capath <dir> CA directory to verify peer against
-E, --cert <certificate[:password]> Client certificate file and password
@PrafullaKumarSahu
PrafullaKumarSahu / bp-profile-tab-and-subnav.php
Created July 12, 2017 08:31 — forked from shanebp/bp-profile-tab-and-subnav.php
BuddyPress add profile tab and subnav
function add_animal_tabs() {
global $bp;
bp_core_new_nav_item( array(
'name' => 'Animals',
'slug' => 'animals',
'parent_url' => $bp->displayed_user->domain,
'parent_slug' => $bp->profile->slug,
'screen_function' => 'animals_screen',
'position' => 200,
<?php
/** Bootstrap WordPress */
include('./wp-load.php');
/**
* Generate some random data
*/
$data = array();
$iterations = 10;
@PrafullaKumarSahu
PrafullaKumarSahu / gist:2964107b65ec8b8cadf7
Last active September 4, 2015 05:57 — forked from mikejolley/gist:f072ed42f3ec33385e38
Using reCAPTCHA with WP Job Manager
<?php
// Define your keys here
define( 'RECAPTCHA_SITE_KEY', 'XXX' );
define( 'RECAPTCHA_SECRET_KEY', 'XXX' );
// Enqueue Google reCAPTCHA scripts
add_action( 'wp_enqueue_scripts', 'recaptcha_scripts' );
function recaptcha_scripts() {
wp_enqueue_script( 'recaptcha', 'https://www.google.com/recaptcha/api.js' );
@PrafullaKumarSahu
PrafullaKumarSahu / gist:c16fceecf4e117e6e1cb
Last active September 3, 2015 06:18 — forked from ultimatemember/gist:f7eab149cb33df735b08
Extend Ultimate Member Account page with custom tabs/content
/* add new tab called "mytab" */
add_filter('um_account_page_default_tabs_hook', 'my_custom_tab_in_um', 100 );
function my_custom_tab_in_um( $tabs ) {
$tabs[800]['mytab']['icon'] = 'um-faicon-pencil';
$tabs[800]['mytab']['title'] = 'My Custom Tab';
$tabs[800]['mytab']['custom'] = true;
return $tabs;
}
@PrafullaKumarSahu
PrafullaKumarSahu / gist:c8dd96fdebb2bb7a181a
Last active September 2, 2015 15:17 — forked from ultimatemember/gist:48bf0a269af5d182ad9b
UM/EDD Open Metrics: Show various sale stats
// Avg downloads per customer
function sc_edd_avg_downloads_per_customer( $atts ) {
$amount = 0;
$query = new WP_Query( array( 'post_type' => 'download' ) );
foreach( $query->posts as $post ) {
$amount = $amount + edd_get_download_sales_stats( $post->ID );
}
$amount = $amount / edd_count_total_customers();
return number_format( $amount, 2 );
}
@PrafullaKumarSahu
PrafullaKumarSahu / gist:2496b2e5b57f99a22b06
Last active August 28, 2015 08:45 — forked from MindyPostoff/gist:a10148daa110119b262f
Change "Proceed to PayPal" Text on Checkout Button in WooCommerce
/* Change the "Proceed to PayPal" button text in the WooCommerce checkout screen
add_filter( 'woocommerce_order_button_text', create_function( '', 'return "Make Payment";' ) );
OR,
* Add this to your theme's functions.php file
*/
add_filter( 'gettext', 'custom_paypal_button_text', 20, 3 );
function custom_paypal_button_text( $translated_text, $text, $domain ) {
@PrafullaKumarSahu
PrafullaKumarSahu / interviewitems.MD
Last active August 29, 2015 14:27 — forked from KWMalik/interviewitems.MD
My answers to over 100 Google interview questions

##Google Interview Questions: Product Marketing Manager

  • Why do you want to join Google? -- Because I want to create tools for others to learn, for free. I didn't have a lot of money when growing up so I didn't get access to the same books, computers and resources that others had which caused money, I want to help ensure that others can learn on the same playing field regardless of their families wealth status or location.
  • What do you know about Google’s product and technology? -- A lot actually, I am a beta tester for numerous products, I use most of the Google tools such as: Search, Gmaill, Drive, Reader, Calendar, G+, YouTube, Web Master Tools, Keyword tools, Analytics etc.
  • If you are Product Manager for Google’s Adwords, how do you plan to market this?
  • What would you say during an AdWords or AdSense product seminar?
  • Who are Google’s competitors, and how does Google compete with them? -- Google competes on numerous fields: --- Search: Baidu, Bing, Duck Duck Go
<?php
/**
* Skip cart and redirect to direct checkout
*
* @package WooCommerce
* @version 1.0.0
* @author Alessandro Benoit
*/
// Skip the cart and redirect to check out url when clicking on Add to cart