Skip to content

Instantly share code, notes, and snippets.

View erikfried's full-sized avatar

Erik Fried erikfried

View GitHub Profile
@erikfried
erikfried / alert.js
Created November 28, 2011 21:39
alert
alert("This is just an alert to prove I´ve been executed");
@erikfried
erikfried / gist:1067011
Created July 6, 2011 11:05 — forked from remy/gist:350433
Storage polyfill
if (typeof window.localStorage == 'undefined' || typeof window.sessionStorage == 'undefined') (function () {
var Storage = function (type) {
function createCookie(name, value, days) {
var date, expires;
if (days) {
date = new Date();
date.setTime(date.getTime()+(days*24*60*60*1000));
expires = "; expires="+date.toGMTString();
@erikfried
erikfried / MyModule.js
Created July 1, 2011 09:51
Testing YUI3 modules with Jasmine
YUI.add("my-module", function (Y) {
Y.namespace("mynamespace");
Y.mynamespace.MyModule = function () {
return {hello : "hello"};
};
}, '0.0.1' /*version*/, {
requires : ["base"]
});
@erikfried
erikfried / BoomerangVelvetMetrics.html
Created March 2, 2011 13:38
A very simple test, using velvetmetrics as reporting backend to boomerang
<!DOCTYPE html>
<html>
<head>
<title>Velvet test with BOOMR</title>
</head>
<body>
<h1>Testing roundtrip time</h1>
<p>Using <a href="http://developer.yahoo.com/blogs/ydn/posts/2010/06/performance_testing_with_boomerang/">Boomerang</a> and <a href="http://www.velvetmetrics.com/">velvetmetrics</a></p>
<p id="results"></p>
<img src="http://www.velvetmetrics.com/chart?&path=random.path.3yb8s&groupBy=10min&f=avg&datapoints=true&title=true&axes=true&legends=true&customtitle=Avg%20roundtrip%20time%20/10%20mins&w=600&h=250&output=image&rand=2612" alt="loadtime history"/>
@erikfried
erikfried / pulse2_premium_page_tracking.json
Last active August 29, 2015 14:23
Example of pulse2 tracking for a plus article page
[
{
"@context": [
"http://www.w3.org/ns/activitystreams",
{
"spt": "http://schibsted.com",
"spt:sdkType": "JS",
"spt:sdkVersion": "0.3.0"
}
],
@erikfried
erikfried / pulse2_section_page_0.2.json
Last active August 29, 2015 14:23
Example of pulse2 tagging of section page
[
{
"@context": [
"http://www.w3.org/ns/activitystreams",
{
"spt": "http://schibsted.com",
"spt:sdkType": "JS",
"spt:sdkVersion": "0.3.0"
}
],