Skip to content

Instantly share code, notes, and snippets.

View hiddenpearls's full-sized avatar
🏁
About to reach my GOAL

Adnan hiddenpearls

🏁
About to reach my GOAL
View GitHub Profile
@hiddenpearls
hiddenpearls / gist:b4a18a39631a464877b4
Last active September 19, 2015 21:48
Adding a Checkbox in Hubspot forms in a hackable way
hbspt.forms.create({
portalId: '1234567',
formId: 'formid-here',
css: 'select{font-size:21px;line-height:36px;background: #0397d6;font-family:"ProximaNova-Regular";height: 36px;color: #fff;position: relative;box-shadow: 0 3px 5px rgba(0,0,0,.20);-moz-box-shadow: 0 3px 5px rgba(0,0,0,.20);-webkit-box-shadow: 0 3px 5px rgba(0,0,0,.20);border-radius: 5px;-moz-border-radius: 5px;-webkit-border-radius:5px;margin-bottom:11px;border:0;width: 100%;}select:focus{outline:none} label{display:none;}.fldSet4 input[type="text"], .fldSet4 input[type="email"]{font-size: 16px;} .input select{font-size: 16px;}',
onFormReady: function($form) {
$form.on('change', '#form_policy', function(){
if(jQuery(this).is(':checked')){
@hiddenpearls
hiddenpearls / select-countries-wp.php
Created December 23, 2015 13:29
Select Dropdown Countries Template for WordPress developers
/**
* Select Dropdown Countries Template for WordPress developers
* Author: Muhammad Adnan (http://adnan.pk/)
* Company: WPBrigade (http://wpbrigade.com/)
*/
<select name="country" id="country" class="form-control">
<option value="AF" <?php selected( $_POST['country'], 'AF' ); ?>>Afghanistan</option>
<option value="AX" <?php selected( $_POST['country'], 'AX' ); ?>>Åland Islands</option>
@hiddenpearls
hiddenpearls / snippet.js
Created October 4, 2016 19:01 — forked from necolas/snippet.js
Optimised async loading of cross-domain scripts
/*
* Updated to use the function-based method described in http://www.phpied.com/social-button-bffs/
* Better handling of scripts without supplied ids.
*
* N.B. Be sure to include Google Analytics's _gaq and Facebook's fbAsyncInit prior to this function.
*/
(function(doc, script) {
var js,
fjs = doc.getElementsByTagName(script)[0],
.DS_Store
@hiddenpearls
hiddenpearls / purchase-phone.js
Created April 27, 2017 17:45
Simple JS program for buying a phone, Apply tax, format and add to cart.
const TAX_RATE = 0.10; // 10%
const PHONE_PRICE = 500; // $500
const ACCESSORY_PRICE = 12; //$12
const SPENDING_THRESHOLD = 900; // This should be 60% of the total bank balance.
var bank_account_balance = 0;
var quantity = 0;
var total = 0;
bank_account_balance = prompt("What is your Bank Account Balance");
@hiddenpearls
hiddenpearls / gist:aa911c6d6a78ca35081bfc27ea1d4c74
Last active May 4, 2017 05:43
ShortCode for World map of visitors in WordPress using Analytify Plugin
[analytify-worldmap start_date="2015-10-22" end_date="2015-10-28" analytics_for="full"]
//You can change the dates according to your needs. If you don't specify the end date It will take the current end date.
[analytify-worldmap start_date="2015-10-22" analytics_for="full"]
@hiddenpearls
hiddenpearls / git archive
Last active June 1, 2017 09:56
Make a zip file to upload to theme repo
git archive --format zip --output /full/path/to/theme-name.zip master
<?php
/*
Plugin Name: EDD Webhooks
Description: Captures new sale notifications from 3rd party service and adds to Easy Digital Downloads
Version: 1.0
Author: Brian Hogg
Author URI: https://brianhogg.com
Text Domain: edd-webhooks
License: GPL2
*/
@hiddenpearls
hiddenpearls / check-edd-license
Created June 19, 2018 14:23
Check EDD License status
/**
* Check and get the license data.
*
* @param string $license The license key.
*
* @return false|array
*/
public static function check_license( $license ) {
$license = trim( $license );
@hiddenpearls
hiddenpearls / pe-customize-controls.css
Created February 13, 2017 21:16 — forked from OriginalEXE/pe-customize-controls.css
Extending WordPress Customizer Panels and Sections to allow nesting
.in-sub-panel #customize-theme-controls .customize-pane-child.current-panel-parent,
#customize-theme-controls .customize-pane-child.current-section-parent {
-webkit-transform: translateX(-100%);
-ms-transform: translateX(-100%);
transform: translateX(-100%);
}