Skip to content

Instantly share code, notes, and snippets.

View Bondifrench's full-sized avatar

Dominik Dumaine Bondifrench

View GitHub Profile
We can't make this file beautiful and searchable because it's too large.
Date,Input1,Input2,Input3,Input4,Input5,Input6,Input7,Input8,Input9,Input10,Input11,Input12,Input13,Input14,Input15,Input16,Input17,Input18,Input19,Input20,Input21,Input22,Input23
1/06/2009,-2.305974861,-2.531868106,-2.023421501,-0.417466701,-2.246764709,-1.016427344,-2.400450726,1.684941748,1.856142929,0.001040063,-2.113501483,-3.324634698,-0.087162231,-0.269630244,-0.233669279,1.6403,1.1281,3.0545,1.074239609,1.381034594,0.767444623,2.159838385,1.950074548
2/06/2009,-2.305974861,-2.531868106,-2.023421501,-0.417466701,-2.246764709,-1.016427344,-2.400450726,1.532064204,1.73159375,-0.01164871,-1.592373975,-2.310628564,-0.086057747,-0.260706724,-0.231724585,1.6389,1.1276,3.0482,1.073257458,1.374407322,0.772107593,2.180168542,1.94008489
3/06/2009,-2.305974861,-2.531868106,-2.023421501,-0.417466701,-2.246764709,-1.016427344,-2.400450726,1.532064204,1.73159375,-0.01164871,-1.592373975,-2.310628564,-0.083197125,-0.251926779,-0.229791953,1.6375,1.1271,3.042,1.087976736,1.396433199,0.779520273,2.184547536,1.97333054
@Bondifrench
Bondifrench / Rating-star.js
Created August 18, 2016 20:19
Mithril web-component experimentation
//Given following HTML
// <div class="rating" data-rating="3" data-votes="133"></div>
// <div class="rating" data-rating="2" data-votes="123"></div>
// <div class="rating" data-rating="4" data-votes="62"></div>
// <div class="rating" data-rating="5" data-votes="42"></div>
// .green {color:#2ECC40;}
// .white {color: #fff;}
// .Rating-star {
@Bondifrench
Bondifrench / example.js
Created August 2, 2016 21:26 — forked from gilbert/example.js
Mithril.js - Avoiding m.props
// m.prop is a great pattern, but Plain-old JavaScript Objects (POJO) are
// much more pleasant to work with.
// Here's an example of using POJOs with one- and two-way data binding.
// First, the helper methods
m.setValue = function (obj, prop) {
return m.withAttr('value', function(value) { obj[prop] = value })
}
@Bondifrench
Bondifrench / component.js
Created July 24, 2016 01:37 — forked from flintinatux/component.js
Component wrapper for mithril 1.x. Registers lifecycle methods as streams, so that components may be contructed as single-closure factories that return view functions.
const m = require('mithril')
const stated = hook => vnode => vnode.state[hook](vnode)
const oninit = Comp => vnode => {
vnode.state.oncreate = m.prop()
vnode.state.onremove = m.prop()
vnode.state.view = Comp(vnode)
}
@Bondifrench
Bondifrench / extend.js
Last active July 1, 2016 22:19
Object simple extend
function extend (original, update) {
var rec = function(a, b) {
var i;
for (i in b) {
a[i] = b[i];
}
return a;
};
return rec(rec({}, original), update);
}
@Bondifrench
Bondifrench / multi.js
Created March 23, 2016 23:43 — forked from barneycarroll/multi.js
Execute multiple functions where one is expected. Useful for event handling.
function multi(){
var handlers = Array.prototype.filter.call( arguments, function( x ){
return x instanceof Function
} )
return function handle(){
for( var i = 0; i < handlers.length; i++ )
handlers[ i ].apply( this, arguments )
}
}
function auth(component) {
return {
controller: function () {
var ctrl = this;
function success(user) {
Account.user(user)
ctrl.output = new component.controller()
m.redraw(true)
@Bondifrench
Bondifrench / mautocomplete.js
Last active March 7, 2016 09:05
A mithril autocomplete component using Horsey by @JAForbes
var pluck = require("lodash").pluck;
var groupBy = require("lodash").groupBy;
var forceRender = require("lodash").identity;
var m = require("mithril");
var horsey = require("horsey");
var controller = function controller(label, data, property) {
//split the data set into subsets for performance
@Bondifrench
Bondifrench / mselect.js
Created January 30, 2016 20:07
A select element for Mithril from @JAForbes
var select = function select(options, prop, attr) {
if (typeof prop() == "undefined" || prop() == "") {
prop(options[0]);
}
if (options.length == 0) {
prop("");
}
return m("select.form-control", _.extend({
@Bondifrench
Bondifrench / mcheckbox.js
Created January 30, 2016 20:05
A checkbox for Mithril by @JAForbes
var checkbox = function checkbox(label, prop) {
return m("label.checkbox-inline", m("input[type=checkbox]", {
checked: prop(),
onclick: m.withAttr("checked", prop)
}), _.capitalize(label));
};