Skip to content

Instantly share code, notes, and snippets.

View sahanh's full-sized avatar

Sahan H. sahanh

  • Sri Lanka
View GitHub Profile
@sahanh
sahanh / index.php
Created April 27, 2019 07:49
Formatting phone number url for calendly
<?php
/**
* sahan@devquickie.com
*/
$inputs = (array) $_GET;
$clPath = isset($_GET["calendly"]) ? $_GET["calendly"] : null;
$phoneField = isset($_GET["phone"]) ? $_GET["phone"] : null;
$final = [];
<script>
if (typeof window.Cookies == "undefined") {
!function(e){var n=!1;if("function"==typeof define&&define.amd&&(define(e),n=!0),"object"==typeof exports&&(module.exports=e(),n=!0),!n){var o=window.Cookies,t=window.Cookies=e();t.noConflict=function(){return window.Cookies=o,t}}}(function(){function e(){for(var e=0,n={};e<arguments.length;e++){var o=arguments[e];for(var t in o)n[t]=o[t]}return n}function n(o){function t(n,r,i){var c;if("undefined"!=typeof document){if(arguments.length>1){if("number"==typeof(i=e({path:"/"},t.defaults,i)).expires){var a=new Date;a.setMilliseconds(a.getMilliseconds()+864e5*i.expires),i.expires=a}i.expires=i.expires?i.expires.toUTCString():"";try{c=JSON.stringify(r),/^[\{\[]/.test(c)&&(r=c)}catch(e){}r=o.write?o.write(r,n):encodeURIComponent(String(r)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),n=(n=(n=encodeURIComponent(String(n))).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent)).replace(/[\(\)]/g,escape);var f=
<script>
if (typeof window.Cookies == "undefined") {
!function(e){var n=!1;if("function"==typeof define&&define.amd&&(define(e),n=!0),"object"==typeof exports&&(module.exports=e(),n=!0),!n){var o=window.Cookies,t=window.Cookies=e();t.noConflict=function(){return window.Cookies=o,t}}}(function(){function e(){for(var e=0,n={};e<arguments.length;e++){var o=arguments[e];for(var t in o)n[t]=o[t]}return n}function n(o){function t(n,r,i){var c;if("undefined"!=typeof document){if(arguments.length>1){if("number"==typeof(i=e({path:"/"},t.defaults,i)).expires){var a=new Date;a.setMilliseconds(a.getMilliseconds()+864e5*i.expires),i.expires=a}i.expires=i.expires?i.expires.toUTCString():"";try{c=JSON.stringify(r),/^[\{\[]/.test(c)&&(r=c)}catch(e){}r=o.write?o.write(r,n):encodeURIComponent(String(r)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),n=(n=(n=encodeURIComponent(String(n))).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent)).replace(/[\(\)]/g,escape);var f=
<script>
if (typeof Cookies == "undefined") {
!function(e){var n=!1;if("function"==typeof define&&define.amd&&(define(e),n=!0),"object"==typeof exports&&(module.exports=e(),n=!0),!n){var o=window.Cookies,t=window.Cookies=e();t.noConflict=function(){return window.Cookies=o,t}}}(function(){function e(){for(var e=0,n={};e<arguments.length;e++){var o=arguments[e];for(var t in o)n[t]=o[t]}return n}function n(o){function t(n,r,i){var c;if("undefined"!=typeof document){if(arguments.length>1){if("number"==typeof(i=e({path:"/"},t.defaults,i)).expires){var a=new Date;a.setMilliseconds(a.getMilliseconds()+864e5*i.expires),i.expires=a}i.expires=i.expires?i.expires.toUTCString():"";try{c=JSON.stringify(r),/^[\{\[]/.test(c)&&(r=c)}catch(e){}r=o.write?o.write(r,n):encodeURIComponent(String(r)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),n=(n=(n=encodeURIComponent(String(n))).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent)).replace(/[\(\)]/g,escape);var f="";for(
<script>
(function(){'use strict';function y(a,b){for(var c in a)if(A(a,c)&&!1===b.call(a,a[c],c,a))break}function Qa(a){function b(a,b,c){t(d,a,function(a,e,f){a=za(a,e,f);vb(d,a.methods,b,c,a.v);return d})}var c="Object"===a,d=Ra(a,!0);b("defineStatic",1);b("defineInstance",2);b("defineInstanceAndStatic",3);b("defineStaticWithArguments",1,!0);b("defineInstanceWithArguments",2,!0);t(d,"defineStaticPolyfill",function(b,c,k){b=za(b,c,k);na(Y[a],b.methods,!0,b.v);return d});t(d,"defineInstancePolyfill",function(b,c,k){b=
za(b,c,k);na(Y[a].prototype,b.methods,!0,b.v);y(b.methods,function(a,b){oa(d,b,a)});return d});t(d,"alias",function(a,b){var c=d,e="string"===typeof b?d[b]:b;c[a]=e;e.instance&&oa(c,a,e.instance,!0);return d});t(d,"extend",function(b){function e(a,c){var d=b[a];if(d)for(var e=0,f;f=d[e];e++)if(f===c)return!0;return!1}function k(a,c){return b[a]&&!e(a,c)}function l(a,c,d){if(!c[a]||!d)return!1;for(a=0;a<d.length;a++)if(!1===b[d[a]])return!0}var g=Y[a],p=g.prototype,v={},E={};b=b||{};var u=b.meth
{
"data": [
{
"id": "456054561",
"type": "contacts",
"attributes": {
"page-id": 14709853,
"first-name": "Dee",
"last-name": "LS",
"name": "Dee LS",
[
{
"id": 3434,
"name": "WSR Webinar Oct 25",
"created_at": "2017-10-20T05:17:15.000Z",
"updated_at": "2017-11-19T09:06:18.000Z",
"group_tag": "",
"share_code": "sdaa09sdasd",
"key": "dsadsds",
"domain_id": 313137,
@sahanh
sahanh / ClickFunnels Field Merge
Last active February 23, 2018 10:58
ClickFunnels Field Merge
<script> (function($) { $.QueryString = (function(paramsArray) { let params = {}; for (let i = 0; i < paramsArray.length; ++i) { let param = paramsArray[i] .split('=', 2); if (param.length !== 2) continue; params[param[0]] = decodeURIComponent(param[1].replace(/\+/g, " ")); } return params; })(window.location.search.substr(1).split('&')) })(jQuery); (function(){ function htmlEntities(str) { return String(str).replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;'); } jQuery(document).ready(function($){ $.each($.QueryString, function(key, value) { var html = $('#'+key).html(); $('#'+key).html(html.replace('#??', htmlEntities(value))); }); }); })(); </script>
<script>
jQuery(document).ready(function(n){var c=[{s:"input[name=name]",ac:"name"},{s:"input[name=email]",ac:"email"},{s:"input[name=phone]",ac:"tel"},{s:"input[name=address]",ac:"shipping street-address"},{s:"input[name=city]",ac:"shipping locality"},{s:"input[name=state]",ac:"shipping region"},{s:"input[name=zip]",ac:"shipping postal-code"},{s:"input[name=country]",ac:"shipping country"},{s:".cc-number",ac:"cc-number"},{s:".cc-cvc",ac:"cc-csc"},{s:".cc-expirey-month",ac:"cc-exp-month"},{s:".cc-expirey-year",ac:"cc-exp-year"}];n(".containerInner").replaceWith(function(){return n("<form />",{"class":"containerInner"}).append(n(this).contents())}),n.each(c,function(c,e){n(e.s).attr("autocomplete",e.ac)})});
</script>