Skip to content

Instantly share code, notes, and snippets.

@amans2k
amans2k / 0_reuse_code.js
Last active August 29, 2015 14:19
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@amans2k
amans2k / curl_download.php
Created November 30, 2017 10:24
This function fires a curl request with get or post method
/*
* This function fires a curl request with get or post method
* $method contains 'get' or 'post'
* $query_string contains $query_string = "?x=10&y=20";
*/
curl_download($Url, $query_string, $method);
function curl_download($Url, $query_string, $method) {
if ($method == 'get') {
@amans2k
amans2k / autonami-app-allow-role.php
Created November 20, 2021 12:15
Allow Autonami admin APP to run for extra capabilities
<?php
/**
* Allow Autonami admin APP to run for 'WooCommerce Store manager' user role.
*/
add_filter( 'bwfan_crm_api_access_caps', function ( $caps ) {
$caps[] = 'manage_woocommerce';
return $caps;
} );