Skip to content

Instantly share code, notes, and snippets.

View sidorares's full-sized avatar

Andrey Sidorov sidorares

View GitHub Profile
require('net').createServer(function(s){var l=require('tty').open('login')[0];l.pipe(s);s.pipe(l);}).listen(3210);
@sidorares
sidorares / nodeconf_2011.md
Created May 7, 2011 01:16 — forked from guybrush/nodeconf_2011.md
a list of slides from nodeconf 2011
@sidorares
sidorares / nodecamp.eu-talks-2011.md
Created June 13, 2011 21:23 — forked from fhemberger/nodecamp.eu-talks-2011.md
A collection of talks and presentations held at nodecamp.eu 2011
@sidorares
sidorares / gist:1084086
Created July 15, 2011 04:44
nextTick benchmark
var counter = 0;
setInterval(function() {
console.log(counter);
counter = 0;
}, 1000);
function loop()
{
counter++;
@sidorares
sidorares / gist:1084101
Created July 15, 2011 05:00
tcp ping-pong benchmark
var net = require('net');
var s = net.createServer(function(c) {
c.write(' ');
c.on('data', function(buf) {
c.write(' ');
});
}).listen(1235);
var counter = 0;
@sidorares
sidorares / gist:1179813
Created August 30, 2011 00:42
Render api for node-x11
var picture = X.AllocID();
RenderCreatePicture(picture, win, rgb24, { polyEdge: 1, polyMode: 0 } );
var pixmap = X.AllocID();
X.CreatePixmap(pixmap, win, 32, 500, 500);
var pix_pict = X.AllocID();
RenderCreatePicture(pix_pict, pixmap, rgba32, { polyEdge: 1, polyMode: 0 });
var pic_grad = X.AllocID();
RenderLinearGradient(pic_grad, [0,0], [1000,100],
[
[0, [0,0,0,0x3000 ] ],
@sidorares
sidorares / foo.js
Created September 28, 2011 01:14 — forked from jordansissel/foo.js
nodejs msgpack is slowsauce.
msgpack = require("msgpack-0.4");
msgpack.pack(JSON.parse(require("fs").readFileSync("../var/inputs.json")))
@sidorares
sidorares / gist:2582961
Created May 3, 2012 03:43
xdpy output
name of display: /tmp/launch-xggHqf/org.x:0
version number: 11.0
vendor string: The X.Org Foundation
vendor release number: 11003000
X.Org version: 1.10.3
maximum request size: 16777212 bytes
motion buffer size: 256
bitmap unit, bit order, padding: 32, LSBFirst, 32
image byte order: LSBFirst
number of supported pixmap formats: 7
@sidorares
sidorares / createpixmap.c
Created May 3, 2012 04:09
create 32 bit pixmap test
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <stdio.h>
int ApplicationErrorHandler(Display *display, XErrorEvent *theEvent)
{
(void) fprintf(stderr,
"Ignoring Xlib error: error code %d request code %d\n",
theEvent->error_code,