Skip to content

Instantly share code, notes, and snippets.

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);
}
<!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;
@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.

@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.
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
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
date,price
Jan 2000,1394.46
Feb 2000,1366.42
Mar 2000,1498.58
Apr 2000,1452.43
May 2000,1420.6
Jun 2000,1454.6
Jul 2000,1430.83
Aug 2000,1517.68
Sep 2000,1436.51
@idibidiart
idibidiart / README.md
Last active August 29, 2015 14:14 — forked from mgold/README.md

This is a fork of Mike Bostock's Multi-Series Line Chart, which adds circles along the line for each data point. The circles help anchor us to the real datapoints (rather than extrapolations) when comparing across lines.

But this is really an exercise in nested selections, leveraging selections as groups. The data consists of multiple lines, which each have multiple data points. We call .data twice: first with the data for all cities, binding the array for each city as a single datum. This is good enough for D3's line generators but not for placing circles. So we selectAll circles from the merged enter-update selection, and then bind the data for each line using a function, which is passed each datum from the prior join. This step produces a new data join, and you need to do it even if the function you pass is the identity. Since there are no circles, we skip straight to the enter selection and append them. Then we assign them x and y positions based on the accessor

@idibidiart
idibidiart / index.ios.js
Last active September 1, 2015 00:39 — forked from ide/index.ios.js
Redux batching example with React Native
/**
* Batched updates test with Redux. You will need React 0.6.0 and a .babelrc:
{
"whitelist": [
"es6.parameters.default",
"es7.decorators"
]
}
*/
'use strict';
@idibidiart
idibidiart / React Native: Animated - Code
Created September 22, 2015 14:17 — forked from sahrens/React Native: Animated - Code
Example code from ReactEurope 2015 talk - React Native: Animated
/**
* The examples provided by Facebook are for non-commercial testing and
* evaluation purposes only.
*
* Facebook reserves all rights not expressly granted.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL
* FACEBOOK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN