Skip to content

Instantly share code, notes, and snippets.

@s3u
s3u / gist:2973367
Created June 22, 2012 15:13
Another test for timeout
var http = require('http');
var options = {
host: 'localhost',
port: 3000,
method: 'HEAD',
headers: {
'connection': 'keep-alive'
},
path: '/'
@s3u
s3u / index.html
Created June 15, 2012 05:36
Bottleneck Domains
<html>
<head>
<script type="text/javascript"
src='http://www.google.com/jsapi?autoload={"modules":[{"name":"visualization","version":"1","packages":["corechart"]}]}'>
</script>
<script type="text/javascript" src="http://stevenlevithan.com/demo/parseuri/js/assets/parseuri.js"></script>
<script type="text/javascript">
window.ondragover = function () {
return false;
<div id="events">
</div>
<script type="text/javascript">
uri = 'ws://ql.io';
var wsCtor = window['MozWebSocket'] ? MozWebSocket : WebSocket;
var socket = new wsCtor(uri, 'ql.io-console');
socket.onopen = function () {
var div = document.getElementById('events');
@s3u
s3u / gist:2898590
Created June 8, 2012 23:10
ql.io-compiler in the browser.
<script type="text/javascript" src="http://ql.io/scripts/compiler.js"></script>
<script type="text/javascript">
var plan = require('ql.io-compiler').compile('your ql.io script here');
</script>
@s3u
s3u / gist:2898580
Created June 8, 2012 23:08
Node.js snippet to generate the plan
var plan = require('ql.io-compiler').compile('your ql.io script here');
@s3u
s3u / index.html
Created June 8, 2012 20:55
Dot file generator for ql.io scripts.
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<script type="text/javascript" src="http://ql.io/scripts/jquery-min.js"></script>
<script type="text/javascript" src="http://ql.io/scripts/jquery-ui.min.js"></script>
<script type="text/javascript" src="http://ql.io/scripts/compiler.js"></script>
<script type="text/javascript" src="http://codemirror.net/lib/codemirror.js"></script>
<script type="text/javascript" src="http://ql.io/scripts/qlio-editor.js"></script>
@s3u
s3u / index.html
Created June 8, 2012 15:57
Visualize the execution plan for ql.io scripts
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js"></script>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.layout.js"></script>
<script type="text/javascript" src="http://localhost:3000/scripts/jquery-min.js"></script>
<script type="text/javascript" src="http://localhost:3000/scripts/jquery-ui.min.js"></script>
<script type="text/javascript" src="http://ql.io/scripts/compiler.js"></script>
<script type="text/javascript" src="http://codemirror.net/lib/codemirror.js"></script>
var util = require('util'),
_ = require('underscore');
exports.filter = function() {
this.row = _.uniq(this.row);
return this.next(null, this.row);
}
/*
* Copyright 2012 eBay Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
/*
* Copyright 2012 eBay Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software