Skip to content

Instantly share code, notes, and snippets.

View mahboob-awan's full-sized avatar

Mahboob Ur Rasheed mahboob-awan

  • Netset AB
  • World Wide Web
View GitHub Profile
//JavaScript
function add(a,b){ return a+b; }
//Scala
def add(a: Int, b: Int): Int = a + b
//=========== Tracking Code: Current Page/Custom page
//OLD
_gaq.push(["_trackPageview","/page-tracking-old"]);
//NEW
ga('send', 'pageview', '/page-tracking-new');
//=========== Tracking Code: Event Tracking
//OLD
_gaq.push(['_trackEvent', 'Videos', 'Play', 'OLD OLD Gooogle']);
//NEW
ga('send', 'event', 'Videos', 'Play', 'NEW NEW Gaaagle');
// =========== Tracking Code: Site Speed User Timing
//OLD
_gaq.push(['_trackTiming', 'jQuery', 'Load OLD Library', 20, 'Google CDN', 100]);
_gaq.push(['_trackTiming', 'jQuery', 'Load OLD Library', 50, 'jQuery CDN', 100]);
//NEW
ga('send', 'timing', 'jQuery', 'Load NEW Library', 20, 'Google CDN', 100);
ga('send', 'timing', 'jQuery', 'Load NEW Library', 90, 'jQuery CDN', 100);
//=========== E-commerce Tracking
//OLD
_gaq.push(['_addTrans',
'1234', // transaction ID - required
'Apple', // affiliation or store name
'465', // total - required
'1.29', // tax
'5' // shipping
]);
@mahboob-awan
mahboob-awan / dabblet.html
Last active February 7, 2018 16:11
Untitled
<button id="aButton">Trigger on Click</button><hr><input type="checkbox" name="" id="aCheckbox">Trigger on Change<hr><a href="https://services.github.com/on-demand/downloads/github-git-cheat-sheet.pdf" download>Download pdf</a> <pre>Steps to reproduce the bug in IE11:1 - Download PDF2 - Change checkbox state3 - CustomEvent does not trigger!</pre>
@mahboob-awan
mahboob-awan / dabblet.css
Last active May 12, 2020 10:28
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
background: #f06;
background: linear-gradient(45deg, #f06, yellow);
min-height: 100%;
/**
* Scrolling shadows by @kizmarh and @leaverou
* Only works in browsers supporting background-attachment: local; & CSS gradients
* Degrades gracefully
*/
html {
background: white;
font: 120% sans-serif;
}
<!DOCTYPE html>
<html>
<head>
<title>Page speed test</title>
</head>
<body>
<img src="https://via.placeholder.com/150" width="150" height="300" />
<br/>
<img src="https://via.placeholder.com/200" width="200" height="300" />
<br/>