This file contains hidden or 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
FROM node | |
EXPOSE 8080 | |
COPY app.js . | |
CMD node app.js |
This file contains hidden or 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 URL = 'https://www.adlibris.com' + | |
'/se/bok/factfulness-tio-knep-som-hjalper-dig-forsta-varlden-9789127149946' + | |
'?filter=hardcover' + | |
'&gclid=760a19f0-5057-417a-8e6a-b44a01b12a46' + | |
'&some=thing' | |
const [first, last] = URL.split("?") | |
const URLwithoutGCLID = first | |
URLwithoutGCLID |
This file contains hidden or 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
<html> | |
<head> | |
<style> | |
html, body { | |
padding: 0; | |
margin: 0; | |
} | |
body { | |
background: #D8D8D8; | |
width: 100%; |
This file contains hidden or 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
// Classic first/last name switcharoo regex replace example | |
let firstThenLast = "Zara Larsson" | |
let getFirstAndLast = /(\w+) (\w+)/ | |
firstThenLast.match(getFirstAndLast) //? | |
let lastCommaFirst = firstThenLast.replace(getFirstAndLast, "$2, $1") //? | |
// Capturing parentheses | |
let message = "MPJ hosts DevTips" | |
let host = message.match(/(dah?vid|mpj) hosts devtips/i)[1] //? |
This file contains hidden or 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
<!-- Roy App Keyword Provider snippet --> | |
<script> | |
(function (window) { | |
window['RoyAppKeywordProviderConfig'] = { | |
accountId: {{Keyword Provider Account ID}}, | |
mode: 'dataLayer', | |
dataLayer: { | |
name: 'dataLayer', | |
event: 'Provided keyword' | |
} |
This file contains hidden or 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 () { | |
return function(model) { | |
if ({{Provided Keyword}}) { | |
model.set('campaignKeyword', {{Provided Keyword}}); | |
model.set('campaignContent', {{Provided Position}}); | |
model.set('campaignSource', 'google'); | |
model.set('campaignMedium', 'organic'); | |
model.set('campaignName', 'Roy App Keyword Provider'); | |
} | |
} |
This file contains hidden or 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
<!-- Google Analytics Snippet --> | |
<script> | |
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ | |
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), | |
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) | |
})(window,document,'script','//www.google-analytics.com/analytics.js','ga'); | |
ga('create', 'UA-1234-5', 'auto'); | |
// Add this before the send pageview call |
This file contains hidden or 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
chartHandlers = {}; | |
Template.metric.rendered = function () { | |
var self = this; | |
self.myDeps = Deps.autorun(function () { | |
// Get data from db | |
var calculatedData = Aggregates.find().fetch(); | |
// find the container to put the graph in | |
var element = self.$('.chart').first(); |