Skip to content

Instantly share code, notes, and snippets.

// @media (min-width:320px) { /* smartphones, iPhone, portrait 480x320 phones */ }
// @media (min-width:481px) { /* portrait e-readers (Nook/Kindle), smaller tablets @ 600 or @ 640 wide. */ }
// @media (min-width:641px) { portrait tablets, portrait iPad, landscape e-readers, landscape 800x480 or 854x480 phones }
// @media (min-width:961px) { /* tablet, landscape iPad, lo-res laptops ands desktops */ }
// @media (min-width:1025px) { /* big landscape tablets, laptops, and desktops */ }
// @media (min-width:1281px) { /* hi-res laptops and desktops */ }
@mixin bp-phone {
@media all and (min-width: 140px) and (max-width: 640px) {
---
env:
browser: true
node: true
es6: true
globals:
__DEV__: true
@dazld
dazld / slider.js
Created May 25, 2015 12:09
react slider component
'use strict';
import React from 'react';
function clamp (value, minimum, maximum) {
if (maximum === null) {
maximum = Infinity;
}
if (maximum < minimum) {
let swap = maximum;
var strs = ['zz','ee','DD','dd','PP'];
function sortFirstLetter (a,b){
a = a.toLowerCase().charCodeAt(0);
b = b.toLowerCase().charCodeAt(0);
if (a === b) {return 0;}
else if (a > b) {return 1;}
else {return -1;}
@dazld
dazld / index.js
Created February 13, 2015 14:18
requirebin sketch
// require() some stuff from npm (like you were using browserify)
// and then hit Rebuild to run it on the right
var Promise = require('bluebird');
var doStuff = function(){
return new Promise(function(resolve, reject){
resolve(1);
});
@dazld
dazld / cols.json
Created January 15, 2015 23:12
popular colours
[{"qty":217206,"col":"rgb(255, 255, 255)"},{"qty":47383,"col":"rgb(153, 153, 153)"},{"qty":40994,"col":"rgb(0, 0, 0)"},{"qty":40437,"col":"rgb(221, 221, 221)"},{"qty":38420,"col":"rgb(204, 204, 204)"},{"qty":38276,"col":"rgb(51, 51, 51)"},{"qty":25226,"col":"rgb(238, 238, 238)"},{"qty":19616,"col":"rgb(66, 139, 202)"},{"qty":19388,"col":"rgb(85, 85, 85)"},{"qty":16629,"col":"rgb(34, 34, 34)"},{"qty":15209,"col":"rgb(102, 102, 102)"},{"qty":14584,"col":"rgb(245, 245, 245)"},{"qty":12262,"col":"rgb(119, 119, 119)"},{"qty":9840,"col":"rgb(91, 192, 222)"},{"qty":9287,"col":"rgb(68, 68, 68)"},{"qty":7648,"col":"rgb(0, 136, 204)"},{"qty":7232,"col":"rgb(230, 230, 230)"},{"qty":7217,"col":"rgb(229, 229, 229)"},{"qty":6947,"col":"rgb(242, 222, 222)"},{"qty":6916,"col":"rgb(240, 173, 78)"},{"qty":6890,"col":"rgb(252, 248, 227)"},{"qty":6780,"col":"rgb(217, 83, 79)"},{"qty":6685,"col":"rgb(223, 240, 216)"},{"qty":6621,"col":"rgb(92, 184, 92)"},{"qty":6367,"col":"rgb(170, 170, 170)"},{"qty":5887,"col":"rgb(185, 74, 72)"
@dazld
dazld / result.txt
Created December 12, 2014 15:02
js inline cache benchmark node 0.10.33
mb:scratch danpeddle$ node --version
v0.10.33
mb:scratch danpeddle$ node test.js
no comments x 9,705,374 ops/sec ±1.14% (92 runs sampled)
short comment x 9,876,201 ops/sec ±0.85% (93 runs sampled)
long comments x 9,802,210 ops/sec ±1.14% (86 runs sampled)
Fastest is short comment,long comments
@dazld
dazld / lisbon.md
Last active August 29, 2015 14:10

LX = lisboa = lisbon.

Lux Frágil - that club part owned by john malkovich - this looks a possibly fun friday night

Alfama - Wander around the back streets behind the cathedral, see if anyone is grilling sardines and pig out

Belém & Padrão dos Descobrimentos - has a café inside the monument itself, nearby is the Mosteiro dos Jeronimos, bonkers monastery built when portugal was still swimming in cash from the new world.

Pavilhão Chinês - tuxedoed waiters serve cocktails in the back bar, toys, dolls, model airplanes everywhere, pretty unique place. http://www.tripadvisor.co.uk/Restaurant_Review-g189158-d2732937-Reviews-Pavilhao_Chines_Bar-Lisbon_Estremadura.html

var func = function(){
console.log(func.prop);
}
func.prop = 'A';
var otherFunc = function(){
console.log('other:', otherFunc.prop)
}
@dazld
dazld / gist:c86b2cadfeacfa4a67d2
Created November 1, 2014 19:13 — forked from anonymous/gist:10675250
processing motion blur & chromatic glitching
// by dave @ beesandbombs.tumblr.com >:)
void setup() {
setup_();
result = new int[width*height][3];
result_ = new int[width*height][3];
}
int[][] result, result_;
float time;