This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Learn more about destination functions API at | |
// https://segment.com/docs/connections/destinations/destination-functions | |
/** | |
* Handle track event | |
* @param {SegmentTrackEvent} event | |
* @param {FunctionSettings} settings | |
*/ | |
async function onTrack(event, settings) { | |
// Learn more at https://segment.com/docs/connections/spec/track/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<form name="bento-identify-form" id="bento-identify-form" data-thank-you-message="Thank you!" data-redirect-url=""> | |
<input type="text" name="email"> | |
<input type="submit" class="btn btn-success"> | |
</form> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const turbolinksPersistScroll = () => { | |
const persistScrollDataAttribute = 'turbolinks-persist-scroll' | |
let scrollPosition = null | |
let enabled = false | |
document.addEventListener('turbolinks:before-visit', (event) => { | |
if (enabled) | |
scrollPosition = window.scrollY | |
else |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Get your token here https://api.slack.com/custom-integrations/legacy-tokens --> | |
<script src="https://unpkg.com/axios/dist/axios.min.js"></script> | |
<input id="email" type="text" placeholder="Email for invite"> | |
<button onclick="sendInvite()">Apply</button> | |
<script> | |
function sendInvite() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
function getAllUrlParams(url) { | |
// get query string from url (optional) or window | |
var queryString = url ? url.split('?')[1] : window.location.search.slice(1); | |
// we'll store the parameters here | |
var obj = {}; | |
// if query string exists |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Facebook Pixel Code --> | |
<script> | |
!function(f,b,e,v,n,t,s){if(f.fbq)return;n=f.fbq=function(){n.callMethod? | |
n.callMethod.apply(n,arguments):n.queue.push(arguments)};if(!f._fbq)f._fbq=n; | |
n.push=n;n.loaded=!0;n.version='2.0';n.queue=[];t=b.createElement(e);t.async=!0; | |
t.src=v;s=b.getElementsByTagName(e)[0];s.parentNode.insertBefore(t,s)}(window, | |
document,'script','https://connect.facebook.net/en_US/fbevents.js'); | |
fbq('init', '1387232614654235'); // Insert your pixel ID here. | |
fbq('track', 'PageView'); | |
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<blockquote dir=ltr itemtype="http://schema.org/Product" itemscope> | |
<p>98.83% of customers who left a <span itemprop="name">replacement key</span> review recommend example.com</p> | |
<p itemtype="http://schema.org/AggregateRating" itemscope itemprop="aggregateRating">Average rating <span itemprop="ratingValue">4.9</span> out of <span itemprop="bestRating">5</span> for replacement keys, from <span itemprop="ratingCount">1163</span> reviews left by fastkeys.co.uk customers (as at October, 2015)</p> | |
</blockquote> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<link rel="prerender" href="http://example.com"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="https://cdnjs.cloudflare.com/ajax/libs/blueimp-md5/1.0.1/js/md5.min.js"></script> | |
<script> | |
function validateEmail(email) { | |
var re = /^[a-z0-9!#$%&'*+\/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+\/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i; | |
return re.test(email); | |
} | |
$('#user_email').on('change keyup keydown', function() { | |
var email = $(this).val(), | |
valid = validateEmail(email); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script async custom-element="amp-analytics" | |
src="https://cdn.ampproject.org/v0/amp-analytics-0.1.js"> | |
</script> |
NewerOlder