Skip to content

Instantly share code, notes, and snippets.

@dhakelila
dhakelila / helpers
Created June 14, 2015 18:56
Functions to help you improve your performance.
/*
* Basic functions to
* improve performance
*/
// Throttle. Handles invocation frecuency
function throttle(fn, time) {
var last = 0;
return function() {
var now = new Date();
/* ==========================================================================
Print styles.
Inlined to avoid required HTTP connection: h5bp.com/r
========================================================================== */
@media print {
* {
background: transparent !important;
color: #000 !important; /* Black prints faster: h5bp.com/s */
box-shadow: none !important;