Skip to content

Instantly share code, notes, and snippets.

View x2764tech's full-sized avatar

David Kemp x2764tech

View GitHub Profile
@x2764tech
x2764tech / delay.js
Last active October 9, 2019 15:12
delay function for using in promise
/***
* usage:
* p.then(delay(milliseconds)).then(r => ....)
*
* why? mostly testing
*
*/
export default const (millisecondDelay) => (result) => new Promise(resolve => setTimeout(() => resolve(result), millisecondDelay));
@x2764tech
x2764tech / gulpfile.js
Last active August 29, 2015 13:57
gulpfile.js for static site with live reload
var gulp = require('gulp');
var livereload = require('gulp-livereload');
var watch = require('gulp-watch');
var http = require('http');
var ecstatic = require('ecstatic');
gulp.task('default', function() {
http.createServer(
ecstatic({ root: __dirname })
).listen(8000);
@x2764tech
x2764tech / index.html
Last active December 22, 2015 07:39 — forked from mbostock/.block
<!DOCTYPE html>
<meta charset="utf-8">
<body>
<script src="http://d3js.org/d3.v3.min.js"></script>
<script src="http://d3js.org/topojson.v1.min.js"></script>
<script>
var width = 960,
height = 500;
@x2764tech
x2764tech / index.html
Last active December 22, 2015 06:49
an example of r2d3 and d3 projections
<html>
<head>
</head>
<body>
<h1></h1>
<!--[if lte IE 8]><script src="https://raw.github.com/mhemesath/r2d3/master/r2d3.js" charset="utf-8"></script><![endif]-->
<script src="http://d3js.org/d3.v3.min.js"></script>
<script src="http://d3js.org/queue.v1.min.js"></script>
<script src="http://d3js.org/topojson.v1.min.js"></script>
<script>
package queue
import (
"fmt"
"container/list"
"errors"
)
type Queue struct {
list *list.List