Skip to content

Instantly share code, notes, and snippets.

View JavascriptMick's full-sized avatar

JavascriptMick JavascriptMick

View GitHub Profile
@JavascriptMick
JavascriptMick / universal-analytics-wrapper.js
Created September 7, 2013 01:23
universal-analytics wrapper to assist with putting user info on session. Note that this method assumes you are going to scrape the cid out of the _ga cookie i.e. let analytics.js derive the cid and do the cookie persistance for you. If you want to use your own cid determined server side, then this is not for you.
/*
Useage
**require**
uaw = require('.[path]/universal-analytics-wrapper'),
** express setup **
app.use(uaw.cookieConfigurer('UAXXXXX'));
** get visitor **
@JavascriptMick
JavascriptMick / mongodb-dao.js
Last active February 18, 2021 15:28
Simple Node.js Utility module to enable easy creation of models using node-mongodb-native
/*
Simple Node.js Utility module to enable easy creation of models using node-mongodb-native
Useage:-
var dao = require('./mongodb-dao');
exports.NewClient = function(clientId, plan){
return {
clientId: clientId,
plan: plan,