Skip to content

Instantly share code, notes, and snippets.

{
"selector": "source.handlebars",
"cmd": ["handlebars", "$file", "-f", "$file_path/$file_base_name.js"],
"windows": {
"cmd": ["handlebars.cmd", "$file", "-f", "$file_path/$file_base_name.js"]
}
}
{
"cmd": ["jekyll", "build", "&&", "nircmd", "trayballoon", "Sublime Text", "Jekyll build completed", "C:\\Program Files\\Sublime Text 3\\sublime_text.exe", "3000"],
"shell": true
}
@JeroenVdb
JeroenVdb / layer1.js
Last active August 29, 2015 13:56
Activate DFP layer1
window.console && console.log('start layer1 JS');
layerElement = document.getElementById('layer1--overlay');
layerElement.className = layerElement.className.replace('visuallyhidden', '');
closeElements = layerElement.getElementsByClassName('close');
for (var i = 0; i < closeElements.length; i++) {
if (closeElements[i].addEventListener) {
closeElements[i].addEventListener('click', function() {
var htmlTag = document.getElementsByTagName('html')[0];
var hptoContainer = document.querySelectorAll('.hpto--container')[0];
var hptoClickbox = document.querySelectorAll('.hpto--clickbox')[0];
htmlTag.className = 'hpto ' + htmlTag.className;
hptoContainer.style.backgroundImage="url('http://lorempixel.com/output/nature-q-c-1920-1200-8.jpg')";
hptoContainer.style.backgroundColor="#FFFF00";
hptoClickbox.href = 'http://www.jeroenvdb.be'
<!-- ankeiler-horz-offer.html -->
<article class="ankeiler ankeiler--horz ankeiler--aanbieding">
<a href="#">
<figure>
<img src="http://placehold.it/142x138&amp;text=offer" alt="">
<figcaption>Prijsvraag</figcaption>
</figure>
<div class="ankeiler__wrapper" itemprop="itemReviewed">
<header class="ankeiler__header">
<h2>win een weekendje Parijs voor twee</h2>
[
{
"hires": "http://placehold.it/1208x814&text=eerstegroot",
"lores": "http://placehold.it/1208x814&text=eersteklein",
"width": "1280",
"height": "814",
"caption": "Je hebt hier een rozebottel-theezakje in gestoken. <span class=\"credit\">Foto: ANP</span>"
},
{
"hires": "http://placehold.it/1208x814",
{"authors":[{"name":"Anne Salomons","url":"/vk/nl/20002/author/7094/Anne--Salomons.dhtml"},{"name":"Anne van Driel","url":"/vk/nl/20002/author/5724/Anne--van-Driel.dhtml"},{"name":"Anne Boermans","url":"/vk/nl/20002/author/11221/Anne-Boermans.dhtml"},{"name":"Anne Dorst","url":"/vk/nl/20002/author/4531/Anne-Dorst.dhtml"},{"name":"Anne Hustache","url":"/vk/nl/20002/author/863/Anne-Hustache.dhtml"}]}
@JeroenVdb
JeroenVdb / SassMeister-input.scss
Created June 30, 2014 11:13
Generated by SassMeister.com.
// ----
// libsass (v2.0.0)
// ----
// Vertical Rhythm
$base-font-size : 16px !default;
$base-line-height : 1.5625; // ~ 25px @ 16px
$base-spacing-unit : $base-font-size;
$half-spacing-unit : $base-font-size/2;

1. Network

  1. Avoid 301, 302 redirects
  2. Reduce DNS lookups
  3. Reduce the number of HTTP requests
  4. No 404 errors
  • Always have a favicon.ico
  1. DNS Prefetching (?)

2. Caching

Notes

You can measure:

  • Usertimings (Real User Monitoring): gives you a set of timings from different users, browsers, connections,... about pageload, ?
    • Tools: Google Analytics, Gomez APM
  • Synthetic/Analitic testing: how many resources, how many DNS lookups,...
    • Tools: YSLOW, PageSpeed

Toughts

  • What can we measure with existing tools: GA and Gomez