Skip to content

Instantly share code, notes, and snippets.

@vitvad
vitvad / bb-profiler.js
Created February 27, 2015 09:38
Profile bb collection
var M = Backbone.Model.extend({});
var C = Backbone.Collection.extend({model: M});
var NUM = 100000;
var data = new Array(NUM);
data.forEach(function(item, i, list){
list[i] = {
a: i,
b: "test"+i,
c: "test"+(NUM - i)
@vitvad
vitvad / gist:e84b2929fef38927a4bb
Created October 7, 2014 11:16
generate random color pair for paceholde.it
function getPair(num) {
var randColor = function(){
var rnd = Math.random();
var color = Math.floor(rnd * 16777215).toString(16);
var oposite = Math.floor(16777215 - rnd * 16777215).toString(16);
while (oposite.length < 6) {
oposite = '0' + oposite;
}
return color +'/'+ oposite;
}