Skip to content

Instantly share code, notes, and snippets.

@willjohnson
willjohnson / README.md
Last active November 27, 2019 10:04 — forked from mtowers/README.md
Google Analytics Website Visitor Count Widget for Dashing with OAuth2 Authentication (multiple profiles)
@padicode
padicode / gist:6115479
Last active December 20, 2015 10:30
PadiAct Subscribe JavaScript Hook
<script type="text/javascript">
window.nrlskOnEvent = function(padiact)
{
if (padiact.type=='subscribe')
{
// here should go the code that you want PadiAct to trigger when somebody subscribes
// the email address of the subscriber is available and url encoded: e.g. user%40gmail.com
// example:
console.log (padiact.email+' subscribed through PadiAct');
// available vars:
@mtowers
mtowers / README.md
Last active February 24, 2022 17:19
Google Analytics Website Visitor Count Widget for Dashing with OAuth2 Authentication
@padicode
padicode / gist:5734456
Last active December 18, 2015 05:39
PadiAct Redirect on Subscribe
<script type="text/javascript">
window.nrlskOnEvent = function(padiact)
{
if (padiact.type=='subscribe')
{
window.location = "http://yourwebsite.com/newpage.html";
//change http://yourwebsite.com/newpage.html to the page you want to redirect when people subscribe
}
}
</script>
@chrislkeller
chrislkeller / import_json_appsscript.js
Last active December 27, 2024 01:01
Adds what amounts to an =ImportJSON() function to a Google spreadsheet... To use go to Tools --> Script Editor and add the script and save.
/**
* Retrieves all the rows in the active spreadsheet that contain data and logs the
* values for each row.
* For more information on using the Spreadsheet API, see
* https://developers.google.com/apps-script/service_spreadsheet
*/
function readRows() {
var sheet = SpreadsheetApp.getActiveSheet();
var rows = sheet.getDataRange();
var numRows = rows.getNumRows();
@sighmin
sighmin / README.md
Last active July 11, 2017 15:03
Traffic widget and job for dashing dashboard framework.

Description

Simple Dashing widget and job to display driving times of a route. Uses TomTom for free traffic information.

We at platform45 use it to display our driving times home so we know when to leave work to get home to our loved ones in time.

##Dependencies

Uses json, uri and net/http net/https libraries.

Description

Simple Dashing widget that tracks time since a certain event. Time Since Last waits for request to be made to your instance of Dashing and will then reset the time since the last occurrence of whatever event you would like to track. An example could be the time since the last exception for one of your applications, or the time since the last accident on the workfloor (better keep that widget green)!

The widget was made by @hannesfostie for use @openminds. If you end up using this widget, please send me a tweet! I'd love to hear about it.

Dependencies

This widget requires HTML5's localStorage in order to keep track of the last time the event occurred in order for it to work across restarts and refreshes.

@padicode
padicode / gist:5364916
Last active December 16, 2015 02:49 — forked from anonymous/gist:5318836
<script>
if ({{pageName}} == 'article')
{
//set the dimension id that is set inside Google Analytics for each dimension
ga('set', 'dimension1', {{postCategory}});
ga('set', 'dimension3', {{postTitle}});
ga('set', 'dimension4', {{postType}});
}
if ({{pageName}} == 'archive')
{
@padicode
padicode / gist:5318608
Last active April 6, 2020 16:04
Reader vs Scanner behavior
<script>
/*
The original script for the current Google Analytics tracking code is provided by Justin Cutroni: http://cutroni.com/blog/2012/02/21/advanced-content-tracking-with-google-analytics-part-1/
I modified the script to make it work with the new analytics.js - Universal Analytics that Google Analytics is due to launch in 2013.
I also added minor changes to the logic. Any suggestions for optimization are welcomed.
*/
jQuery(function($) {
// Debug flag
var debugMode = false;
@padicode
padicode / gist:5318565
Created April 5, 2013 11:21
Google Analytics Universal Tracking Init in Google Tag Manager
<script>
(function(q,u,i,c,k){window['GoogleAnalyticsObject']=q;
window[q]=window[q]||function(){(window[q].q=window[q].q||[]).push(arguments)},
window[q].l=1*new Date();c=i.createElement(u),k=i.getElementsByTagName(u)[0];
c.async=true;c.src='//www.google-analytics.com/analytics.js';
k.parentNode.insertBefore(c,k)})('ga','script',document);
ga('create', 'UA-XXXXXXXX-XX', 'yourwebsite.com'); //make sure to customize your tracking ID and your domainname
dataLayer.push({"event":"trackingLoaded"}); //don't forget to add this line