Skip to content

Instantly share code, notes, and snippets.

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
@idibidiart
idibidiart / canvas-fx.min.js
Last active December 29, 2015 10:59
Modified Delaunay
(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.
@idibidiart
idibidiart / README.md
Last active December 21, 2015 15:09 — forked from mbostock/.block

For best viewing experience, please play “Doin’ It Right (feat. Panda Bear)” off the latest Daft Punk album while watching this animation.

<!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;
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);
}
# 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]) {
// 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
@idibidiart
idibidiart / README.md
Last active December 20, 2015 01:09 — forked from mourner/README.md

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.

@idibidiart
idibidiart / 158-brown.png
Last active December 20, 2015 00:49
Crystal Clear PNG Maps
158-brown.png