This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var request = require('request') | |
exports.search = function( query, callback ) { | |
request("http://domai.nr/api/json/search?q=" + query, function(err, response, body) { | |
callback( JSON.parse(body) ) | |
}) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* The first commented line is your dabblet’s title | |
*/ | |
background: #f06; | |
background: linear-gradient(42deg, #f06, yellow); | |
min-height: 100%; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Modules | |
var express = require('express') | |
, everyauth = require('everyauth') | |
, connect = require('connect'); | |
var app = module.exports = express.createServer(); | |
everyauth.debug = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var context = cubism.context() | |
.step(1e4) | |
.size(1440) | |
.shiftDiff(200); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var context = cubism.context() | |
.step(1e4) | |
.size(1440); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
case 37: // left | |
if (d3.event.shiftKey && focus > shiftDiff) context.focus(focus -= shiftDiff); | |
else { | |
if (focus == null) focus = size - 1; | |
if (focus > 0) context.focus(--focus); | |
} | |
break; | |
case 39: // right | |
if (d3.event.shiftKey && size - focus > shiftDiff) context.focus(focus += shiftDiff); | |
else { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var context = cubism.context() | |
.step(1e4) | |
.size(1440) | |
.shiftDiff(100); // shiftDiff is now 100 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
context.shiftDiff = function(diff) { | |
if (!arguments.length) shiftDiff = 20 // default | |
else shiftDiff = diff; | |
return update(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
case 39: // right | |
if (d3.event.shiftKey && size - focus > 20) context.focus(focus += 20); | |
else { | |
if (focus == null) focus = size - 2; | |
if (focus < size - 1) context.focus(focus++); | |
} | |
break; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
case 37: // left | |
if (d3.event.shiftKey && focus > 20) context.focus(focus -= 20); | |
else { | |
if (focus == null) focus = size - 1; | |
if (focus > 0) context.focus(--focus); | |
} | |
break; |