Skip to content

Instantly share code, notes, and snippets.

View gramki's full-sized avatar

Ramki gramki

  • Zeta
  • Bangalore, India
View GitHub Profile
@gramki
gramki / gist:9721693
Last active August 29, 2015 13:57
Pseudo code for single threaded HTTPServer using async..await symantics
public class HTTPController {
private var server = new HTTPServer();
public async void Start() {
try {
while(true) {
server.listen(8080);
var request = await server.nextRequest();
if(request.getURL().matches("^/tweeets")) {
SendTweets(request);
} else {
@gramki
gramki / README.md
Created July 21, 2012 00:38 — forked from mbostock/.block
Epicyclic Gearing

From Wikipedia: Epicyclic gearing or planetary gearing is a gear system consisting of one or more outer gears, or planet gears, revolving about a central, or sun gear. … Epicyclic gearing systems also incorporate the use of an outer ring gear or annulus, which meshes with the planet gears.

Built with D3.js.

@gramki
gramki / a.js
Created May 22, 2012 19:46
Timers are fired even if the descriptors are ready for read
var fs = require('fs');
var readCount = 0;
var read_stream = fs.createReadStream('/dev/zero', {encoding: 'ascii'});
read_stream.on("data", function(data) {
console.log("Read " + (readCount++) + " times");
});
setInterval(function(){