For best viewing experience, please play “Doin’ It Right (feat. Panda Bear)” off the latest Daft Punk album while watching this animation.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Drop in replace functions for setTimeout() & setInterval() that | |
make use of requestAnimationFrame() for performance where available | |
http://www.joelambert.co.uk | |
Copyright 2011, Joe Lambert. | |
Free to use under the MIT license. | |
http://www.opensource.org/licenses/mit-license.php |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(){function r(e){var n=this,r=!1;if(!t)return;$(this).one(t,function(){r=!0});var i=function(){r||$(n).trigger(t)};setTimeout(i,e+13)}jQuery.getVendorStyle=function(e){var t=["Moz","Webkit","O","ms"],n=document.createElement("div").style,r=e.charAt(0).toUpperCase()+e.slice(1),i,s=t.length;while(s--)t[s]+r in n&&(i=t[s]);return!i&&e in n?(i=e,perf):i?i+r:""};var e={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",msTransition:"MSTransitionEnd",transition:"transitionend"},t=e[$.getVendorStyle("transition")],n={duration:400,easing:"cubic-bezier(0.250, 0.460, 0.450, 0.940)"};$.fn.transition=function(e,i){if(typeof Modernizr!="undefined"&&!Modernizr.csstransitions)return;i=$.extend({},n,i);var s=$.getVendorStyle("transition");if(!s)return;e[s]="all "+i.duration+"ms "+i.easing,$(this).one(t,i.complete||$.noop),r.bind(this)(i.duration),$(this).css(e)}})(),$(function(){function e(){var e=window.innerHeight,t=document.compatMode;if(t||!$.support. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<head> | |
<meta charset="utf-8"> | |
<script src = "http://d3js.org/d3.v3.min.js" ></script > | |
<script src = "http://code.jquery.com/jquery-1.10.2.js" ></script > | |
<style> | |
.flip_container { | |
position: relative; | |
margin: 0 auto; | |
width: 600px; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const PHANTOM_FUNCTION_PREFIX = '/* PHANTOM_FUNCTION */'; | |
var page = require('webpage').create(); | |
page.onConsoleMessage = function(msg) { | |
if (msg.indexOf(PHANTOM_FUNCTION_PREFIX) === 0) { | |
eval('(' + msg + ')()'); | |
} else { | |
console.log(msg); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# For each day, find the appropriate Poisson Parameter and use it to calculate the likelihood of the actual view count | |
# Likelihood = P(D|H) | |
Calc.Likelihood <- function(changes, poissons, stats, periods) { | |
likelihood <- 0 | |
for (day in 1:nrow(stats)) { | |
proceed <- FALSE | |
period <- 1 | |
while (!proceed) { | |
if (day < changes[period]) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// polyfill window.getMatchedCSSRules() in FireFox 6+ | |
if ( typeof window.getMatchedCSSRules !== 'function' ) { | |
var ELEMENT_RE = /[\w-]+/g, | |
ID_RE = /#[\w-]+/g, | |
CLASS_RE = /\.[\w-]+/g, | |
ATTR_RE = /\[[^\]]+\]/g, | |
// :not() pseudo-class does not add to specificity, but its content does as if it was outside it | |
PSEUDO_CLASSES_RE = /\:(?!not)[\w-]+(\(.*\))?/g, | |
PSEUDO_ELEMENTS_RE = /\:\:?(after|before|first-letter|first-line|selection)/g; | |
// convert an array-like object to array |
This is a D3.js Heatmap example showing how the highest sun position of the day (which directly correlates with average temperature) changes over the year depending on the latitude of the place. The actual temperature chart would be shifted to the right a bit beacuse of thermal lag.
The data for the chart is calculated using SunCalc.

Sample output from Andrew Brown’s excellent Minecraft Overviewer.