Skip to content

Instantly share code, notes, and snippets.

View nikhilatjumpcut's full-sized avatar
👻
straight to the ramp

Nikhil Arora nikhilatjumpcut

👻
straight to the ramp
View GitHub Profile
@nikhilatjumpcut
nikhilatjumpcut / replaceEnrollmentEnds.js
Last active August 8, 2019 06:33
replaceEnrollmentEnds.js
function getExpiryDate(timewaitValue) {
if (!timewaitValue || !spacetime) {
return 'soon';
}
return spacetime(timewaitValue)
.subtract(1, 'day')
.format('{month-short} {date-ordinal}');
}
@nikhilatjumpcut
nikhilatjumpcut / vaCTADelayScript.js
Last active August 5, 2019 11:30
vaCTADelayScript.js
(function vaCTADelayScript() {
var funnelAccess = window.__TSUNAMI__.funnelAccess;
var currentStep = funnelAccess.find(function(access) {
if (access.isCurrentStep) {
return true;
}
return false;
});
@nikhilatjumpcut
nikhilatjumpcut / setFBCommentOptions.js
Created August 5, 2019 05:21
setFBCommentOptions.js
# mutation createHtmlTag{
# createHtmlTag(data: {
# title: "FB_OPTIONS"
# isGlobal: false
# position: PREPEND_TO
# selector: "head"
# html: "<script>$(document).ready(function setFBCommentOptions() {\n $fbCommentSection = document.querySelector('.fb-comments');\n\n $fbCommentSection.setAttribute('data-order-by', 'reverse_time');\n $fbCommentSection.setAttribute('data-width', '100%');\n\n // Forcing fb comments iframe to have 100% width because facebook just won't fix\n // their own bug https: //developers.facebook.com/support/bugs/256568534516879/#_=_\n $fbCommentsWidthStyleTag = '<style>.fb-comments iframe {width: 100% !important;}</style>';\n $('head').append($fbCommentsWidthStyleTag);\n});</script>"
# }) {
# htmlTagId
# }
@nikhilatjumpcut
nikhilatjumpcut / replaceCTAAction.js
Last active August 7, 2019 03:25
replaceCTAAction.js
(function replaceCTAAction() {
var FUNNEL_URL = 'https://jumpcut.com/t';
var funnelAccess = window.__TSUNAMI__.funnelAccess;
var funnelSlug = window.__TSUNAMI__.funnelSlug;
var currentStepIndex = funnelAccess.findIndex(function(access) {
if (access.isCurrentStep) {
return true;
}
# mutation updateHTMLTag {
# updateHtmlTag(where:{
# htmlTagId:"7ad81c67-9c73-4c92-b1ab-0ad7c0b8915d"
# },
# data:{
# position: APPEND_TO
# selector: "head"
# html: "<script>var gtmScript=document.querySelector(\"script#gtm\");if(!gtmScript){for(var searchParams=Array.from(new URLSearchParams(window.location.search).entries()),searchParamsObject={},pair=searchParams.pop();pair;pair=searchParams.pop())searchParamsObject[pair[0]]=pair[1];dataLayer=[{visitorId:window.__TSUNAMI__&&window.__TSUNAMI__.visitorId?window.__TSUNAMI__.visitorId:null,leadSource:searchParamsObject.opted_from?searchParamsObject.opted_from:null,variationPath:window.__TSUNAMI__&&window.__TSUNAMI__.sourceUrl?window.__TSUNAMI__.sourceUrl:null}],function(r,a,e,t,o){r[t]=r[t]||[],r[t].push({\"gtm.start\":(new Date).getTime(),event:\"gtm.js\"});var s=a.getElementsByTagName(e)[0],i=a.createElement(e);i.async=!0,i.src=\"https://www.googletagmanager.com/gtm.js?id=GTM-T4XS7N4\",s.parentNode.insertBefore(i,s)}(window,document,\"scrip