Skip to content

Instantly share code, notes, and snippets.

View rajasajidmanzoor's full-sized avatar

Sajid Manzoor (PMP) rajasajidmanzoor

View GitHub Profile
@rajasajidmanzoor
rajasajidmanzoor / Stripe Errors
Last active August 29, 2015 14:19
Stripe Issues
//Working Code
try {
$customer = \Stripe\Customer::create(array(
"description"=>"Customer",
"source" => $token,
"email" => $email,
"plan" => "armorax"
)
);
<?php
require_once('vendor/autoload.php');
define('STRIPE_KEY_PUBLISHABLE', 'pk_test_XXX');
define('STRIPE_KEY_SECRET', 'sk_test_XXX');
\Stripe\Stripe::setApiKey(STRIPE_KEY_SECRET);
@rajasajidmanzoor
rajasajidmanzoor / WP Ajax Example
Created February 18, 2016 08:39
Wordpress Ajax code to perform any Function using Ajax Easily
<?php
/********************************************************************************/
/*** Wordpress Ajax code to perform any Function using Ajax Easily***/
/********************************************************************************/
add_action( 'wp_footer', 'my_action_javascript' );
function my_action_javascript() { ?>
<script type="text/javascript" >
/* Make this document ready function to work on click where you want */
@rajasajidmanzoor
rajasajidmanzoor / gist:4309d6c9364cd3232189c3a4b537271b
Created December 6, 2016 14:58 — forked from boucher/gist:1750368
Stripe sample checkout form
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title>Stripe Sample Form</title>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script type="text/javascript" src="https://ajax.aspnetcdn.com/ajax/jquery.validate/1.8.1/jquery.validate.min.js"></script>
<script type="text/javascript" src="https://js.stripe.com/v1/"></script>
<script type="text/javascript">
@rajasajidmanzoor
rajasajidmanzoor / Stripe Sample Form
Created April 12, 2017 12:46
Stripe payment form sample
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title>Stripe Sample Form</title>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script type="text/javascript" src="https://ajax.aspnetcdn.com/ajax/jquery.validate/1.8.1/jquery.validate.min.js"></script>
<script type="text/javascript" src="https://js.stripe.com/v1/"></script>
<script type="text/javascript">
@rajasajidmanzoor
rajasajidmanzoor / file.js
Created September 30, 2019 13:02
Check Broken Links in a Page JS/JQuery
// Copy & paste below code in browser console.
function urlExists(url, callback) {
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function() {
if (xhr.readyState === 4) {
callback(xhr.status < 400);
}
};
xhr.open('HEAD', url);
xhr.send();
/*
* A quick snippedt to find plugin and plugin versions in Wordpress
* To User this, open Wordpress Plugins page.
* Go to inspect element and click on console.
* Copy and paste below code and press enter.
* Now you will have a list of all plugins at the end of the page.
*/
jQuery('.wp-list-table.plugins tbody tr:not(".plugin-update-tr")').each(function(){
var name = jQuery('td.plugin-title strong', this).html();