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
// prop - destination key | |
// value - source key | |
const entityProps = { | |
name: 'title', | |
body: 'description', | |
day: 'date', | |
room: 'location', | |
}; | |
// transform a destination value |
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://on.wonderware.com/hs-fs/hub/2199074/hub_generated/template_assets/1501196906904/Custom/system/assets/wonderware-utilities.js"></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
(function() { | |
//Bigcommerce doesn't provide variables for individual product info, | |
//so this is a hacky way to read it from the GA ecommerce script | |
var products = []; | |
var scripts = document.getElementsByTagName('script'); | |
for (var i = 0; i < scripts.length; i++) { | |
if (scripts[i].innerHTML.match(/pageTracker\._addItem/)) { | |
var stuff = scripts[i].innerHTML.match(/_addItem\(([^\)]+)/g); | |
for (var c = 0; c < stuff.length; c++) { |
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
{# (1) get another page's context #} | |
{% set other_landing_page = get_landing_page_by_id(123456); %} | |
{# (2) interpolate hubl variable values in module attribute values (particularly label attr) #} | |
{% set my_options = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] %} |
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
Verifying that "clnmcgrw.id" is my Blockstack ID. https://onename.com/clnmcgrw |
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-selector').submit( function(event) { | |
event.preventDefault(); | |
//copy the mailchimp formm action URL, and change "post" parameter to "post-json" | |
var submitUrl = $(this).data('submit-url'); | |
$.getJSON( submitUrl+"&c=?", $(this).serialize(), function(data) { | |
}); | |
}); |
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
<?php | |
// address to map | |
$map_address = ""; | |
$url = "http://maps.googleapis.com/maps/api/geocode/json?sensor=false&address=".urlencode($map_address); | |
$lat_long = get_object_vars(json_decode(file_get_contents($url))); | |
// pick out what we need (lat,lng) | |
$lat_long = $lat_long['results'][0]->geometry->location->lat . "," . $lat_long['results'][0]->geometry->location->lng; |