Skip to content

Instantly share code, notes, and snippets.

@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@malarkey
malarkey / Contract Killer 3.md
Last active May 17, 2024 15:28
The latest version of my ‘killer contract’ for web designers and developers

When times get tough and people get nasty, you’ll need more than a killer smile. You’ll need a killer contract.

Used by 1000s of designers and developers Clarify what’s expected on both sides Helps build great relationships between you and your clients Plain and simple, no legal jargon Customisable to suit your business Used on countless web projects since 2008

…………………………

@padicode
padicode / gist:4731996
Last active December 12, 2015 06:49
dataLayer example for Google Tag Manager
dataLayer = [{
'page': 'search',
'searchedKeyword': 'rc car',
'visitorType': 'high-value',
'nrDisplayedResults': '70',
'appliedFilters': [ 'price' : '<10' , 'color' : 'red' ], //applied filters
'nrAvailableFilters': '4', // number of available filters
'priceRanges': [ '0-10$' : '23' , '11$-49$' : '2' , '50$-99$' : '45' ], //pricing range of products
'searchCategory': 'boyToys',
'productReviews': [ '0 reviews' : '68' , 'positive reviews' : '0' , 'negative reviews' : '2' ]
@padicode
padicode / gist:5066547
Last active December 14, 2015 09:38
JavaScript hooks for PadiAct actions
<script type="text/javascript">
window.nrlskOnEvent = function(padiact)
{
if (padiact.type=='open')
{
// the code that needs to run when the PadiAct pop-up is displayed goes here
// example:
console.log ('PadiAct Showed Up');
// available vars:
// padiact.id (padiact campaign ID)
@padicode
padicode / gist:5245976
Created March 26, 2013 14:54
Custom PadiAct Action Template
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title></title>
<style>
#padiact_overlay_div
{ }
@magnetikonline
magnetikonline / README.md
Last active March 14, 2024 22:48
IE 7/8/9/10/11 Virtual machines from Microsoft - Linux w/VirtualBox installation notes.
@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
@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: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')
{

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.