Skip to content

Instantly share code, notes, and snippets.

View devgru's full-sized avatar

Dima Semyushkin devgru

View GitHub Profile
@devgru
devgru / index.html
Last active August 29, 2015 13:59
<html>
<body>
<script type='text/javascript' src='http://d3js.org/d3.v3.min.js'></script>
<script>
array = [
{ 'a': 1, 'b': 2 },
{ 'a': 42, 'b': 7 },
{ 'a': 15, 'b': 3 },
{ 'a': 32, 'b': 8 },
{ 'a': 26, 'b': 15 },
We couldn’t find that file to show.
We couldn’t find that file to show.
We couldn’t find that file to show.
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
var testCell = function (current, test) {
var actor = current.piece;
var target = test.piece;
if (current == test && (!current.maze || actor.is('C'))) {
return 'empty';
}
process.nextTick(function () {
var contents = '';
tuple.contents.forEach(function (file) {
var oneFile = fs.readFileSync(sourcePath + file + '.js', 'utf-8');
if (debug)
contents += oneFile
else
contents += jsmin.jsmin(oneFile);
});
fs.writeFile(targetPath + tuple.name + '.js', contents, errbacker.create(log.error));
@devgru
devgru / sqrt.c
Created February 21, 2013 17:31
Best, fast & exact floor(sqrt()) for Arduino etc.
uint8_t my_sqrt(uint16_t input) {
uint16_t res = 0;
uint16_t one = 1u << 14;
while (one > input) one /= 4;
while (one != 0) {
if (input >= res + one) {
res += one;
input -= res;
@devgru
devgru / README.md
Created June 24, 2013 17:22 — forked from mbostock/.block

This examples demonstrates how to use D3's brush component to implement focus + context zooming. Click and drag in the small chart below to pan or zoom.

@devgru
devgru / d3.js
Last active December 19, 2015 17:55
Skill Octopus
!function() {
var d3 = {
version: "3.4.4"
};
if (!Date.now) Date.now = function() {
return +new Date();
};
var d3_arraySlice = [].slice, d3_array = function(list) {
return d3_arraySlice.call(list);
};