Skip to content

Instantly share code, notes, and snippets.

View Sylvestre67's full-sized avatar

Sylvestre Sylvestre67

View GitHub Profile
@Sylvestre67
Sylvestre67 / easing.js
Created August 8, 2017 21:25 — forked from gre/easing.js
Simple Easing Functions in Javascript - see https://github.com/gre/bezier-easing
/*
* Easing Functions - inspired from http://gizma.com/easing/
* only considering the t value for the range [0, 1] => [0, 1]
*/
EasingFunctions = {
// no easing, no acceleration
linear: function (t) { return t },
// accelerating from zero velocity
easeInQuad: function (t) { return t*t },
// decelerating to zero velocity
@Sylvestre67
Sylvestre67 / pivoting_rows.js
Last active October 9, 2016 22:55
pivoting_rows
/******
d3.csv is d3 function quite usefull when it comes to retrieve data from a csv file.
It parses the csv and return a list object, each object corresponding to one rows in the original file.
See: https://github.com/d3/d3-3.x-api-reference/blob/master/CSV.md#csv
******/
d3.csv('rows.csv',function(rows){
/******
For the sake of this example, here's the object return by d3.csv:
rows = [{person_id:"122", question_id:"A", answer:"ABC"},
{person_id:"122", question_id:"B", answer:"DEF"},
@Sylvestre67
Sylvestre67 / cadence_data.json
Last active October 8, 2016 20:33
Contribution consistency
[{"date": "2014-09-19", "value": 1}, {"date": "2014-09-18", "value": 5}, {"date": "2014-09-17", "value": 5}, {"date": "2014-09-16", "value": 5}, {"date": "2014-09-12", "value": 4}, {"date": "2014-09-11", "value": 5}, {"date": "2014-09-10", "value": 6}, {"date": "2014-09-09", "value": 2}, {"date": "2014-09-05", "value": 5}, {"date": "2014-09-04", "value": 4}, {"date": "2014-09-03", "value": 5}, {"date": "2014-08-22", "value": 2}, {"date": "2014-08-21", "value": 5}, {"date": "2014-08-20", "value": 4}, {"date": "2014-08-19", "value": 6}, {"date": "2014-08-15", "value": 6}, {"date": "2014-08-14", "value": 5}, {"date": "2014-08-13", "value": 5}, {"date": "2014-08-12", "value": 5}, {"date": "2014-08-08", "value": 4}, {"date": "2014-08-07", "value": 5}, {"date": "2014-08-06", "value": 6}, {"date": "2014-08-05", "value": 6}, {"date": "2014-07-25", "value": 4}, {"date": "2014-07-24", "value": 6}, {"date": "2014-07-23", "value": 5}, {"date": "2014-07-22", "value": 4}, {"date": "2014-07-21", "value": 1}, {"date": "2014-
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.