Skip to content

Instantly share code, notes, and snippets.

View busse's full-sized avatar
😎
percolating ideas

Chris Busse busse

😎
percolating ideas
View GitHub Profile
@JacobLett
JacobLett / gist:45561dec14ee018f02b1c3144125a634
Last active May 19, 2023 16:52
HubSpot form embed with div target ID - without this the form can sometimes appear out of alignment
<div id="footerHSForm"></div>
<!--[if lte IE 8]>
<script charset="utf-8" type="text/javascript" src="//js.hsforms.net/forms/v2-legacy.js"></script>
<![endif]-->
<script charset="utf-8" type="text/javascript" src="//js.hsforms.net/forms/v2.js"></script>
<script type="text/javascript">
hbspt.forms.create({
css: '',
// Add portalId
portalId: '',
@PaquitoSoft
PaquitoSoft / g_analytics_oauth_nodejs.md
Last active February 18, 2020 21:19
Article describing the process of accessing Google Analytics data from a nodejs application using a service account.

Consuming Google Analytics data from a NodeJs application using a service account

I didn't have a great time trying to implement a simple feature involving Google Analytics in one of my projects (nodejs web application).

My humble requirement was to collect some data (events) I was pushing to Google Analytics in order to create a simple report for my users. Since it isn't a critical report, my idea was to get the data once a day and cache it.

So, as simple as it seems, it has been a tough trip for me and I want to share the whole process with the community. I hope anyone trying to achive something similar gets to this article and find it helpful.

These are the main steps I had to take:

var mysql = require('mysql');
var randy = require('randy');
var _ = require('underscore');
// Query base.
var sql = 'INSERT INTO omeka_neatline_records (' +
'exhibit_id,'+
'title,'+
'description,'+
'map_active,'+