Install osxfuse
(3.x.x) from https://github.com/osxfuse/osxfuse/releases.
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew update
(function (R) { | |
Math.cosd = function(d) { return Math.cos(d * R); }; | |
Math.sind = function(d) { return Math.sin(d * R); }; | |
Math.tand = function(d) { return Math.tan(d * R); }; | |
})(Math.PI / 180); |
/* | |
A basic implementation of the Publisher/Subscriber design pattern. | |
Developed by @addyosmani and @integralist | |
Example Usage: | |
// Create subscriber function to be called when topic publishes an event | |
var testSubscriber = function (topics, data) { | |
console.log(topics + ': ' + data); | |
}; |
.nav-tab { | |
... | |
// instead of putting it on | |
border-right: 1px solid #424242; | |
&:last-child { | |
border-right: 0; // and then taking it off | |
} | |
// use CSS not() to only apply to the elements you want | |
&:not(:last-child) { | |
border-right: 1px solid #424242; |
osxfuse
(3.x.x) from https://github.com/osxfuse/osxfuse/releases.ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew update
var detectInjection = function(knownHostsArray) { | |
var requests = window.performance.getEntriesByType("resource"); | |
var unknownHosts = []; | |
var knownHosts = {}; | |
var foundHosts = {}; | |
for (var knownHost in knownHostsArray) { | |
knownHosts[knownHostsArray[knownHost]] = true; | |
} |
function add1(v) { return v + 1; } | |
function isOdd(v) { return v % 2 == 1; } | |
function sum(total,v) { return total + v; } | |
var list = [2,5,8,11,14,17,20]; | |
list | |
.map( add1 ) | |
.filter( isOdd ) | |
.reduce( sum ); |
.element { | |
position: relative; | |
top: 50%; | |
transform: translateY(-50%); | |
} |
The reflow appens as many times as there are frames per seconds. It recalculate all positions that change in order to diplay them. Basically, when you scroll you execute a function where you move things between two reflows. But there are functions that triggers reflows such as jQuery offset, scroll... So there are two things to take care about when you dynamically change objects in javascript to avoid too many reflows:
The idea is to have nginx installed and node installed. I will extend this gist to include how to install those as well, but at the moment, the following assumes you have nginx 0.7.62 and node 0.2.3 installed on a Linux distro (I used Ubuntu).
In a nutshell,
So for example, www.foo.com request comes and your css, js, and images get served thru nginx while everything else (the request for say index.html or "/") gets served through node.