a list of slides from nodeconf
you may want to take a look at the jsconf-gist too!
| require('net').createServer(function(s){var l=require('tty').open('login')[0];l.pipe(s);s.pipe(l);}).listen(3210); |
a list of slides from nodeconf
you may want to take a look at the jsconf-gist too!
##Using libuv and http-parser to build a webserver
Ryan Dahl, @ryah
http://vimeo.com/24713213
Source, Part I: http://t.co/utoIM93
Source, Part II: http://bit.ly/iBgnIA
##Node.js on windows
Bert Belder
http://2bs.nl/nodecamp.pdf
| var counter = 0; | |
| setInterval(function() { | |
| console.log(counter); | |
| counter = 0; | |
| }, 1000); | |
| function loop() | |
| { | |
| counter++; |
| var net = require('net'); | |
| var s = net.createServer(function(c) { | |
| c.write(' '); | |
| c.on('data', function(buf) { | |
| c.write(' '); | |
| }); | |
| }).listen(1235); | |
| var counter = 0; |
| 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 ] ], |
| msgpack = require("msgpack-0.4"); | |
| msgpack.pack(JSON.parse(require("fs").readFileSync("../var/inputs.json"))) |
| 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 |
| #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, |