Monthly Archive: February 2012

Feb 28

HTTPS with GITHUB

SSH port is blocked at many company firewalls – for no good technical reasons of course, but probably driven by security policies, and that means one cannot use github without either a weird proxy hack or via HTTPS, which github now supports. For cloning an existing repro – just use the https path. # public …

Continue reading »

Share

Feb 27

Working with HTML Canvas

Canvas is central to HTML5 for 2D graphics.  It is supported to various degree by the modern browsers, which of course means IE lags behind until version 9. The following creates a canvas element in an HTML page <canvas id=”example” width=”200″ height=”200″> Your browser does not support Canvas.  </canvas> To make the above work in …

Continue reading »

Share

Feb 25

NodeJS Serving Static Files

We have previously generated dynamic hello world in NodeJS – let’s now try to do so via serving a static file instead. The hello.html contains the following <html> <head><title>hello world</title></head> <body> <p>Hello world</p> </body> </html> To serve this file we can quickly hack our handler to just load this file whenever we are pointing to …

Continue reading »

Share

Feb 25

NodeJS Hello World

NodeJS hello world is pretty straight forward Download NodeJS & install it Verify via running node on command line Type up the following hello.js in your favorite editor var http = require(‘http’); http.createServer(function (request, response) { response.writeHead(200, {‘Content-Type’: ‘text/plain’}); response.end(‘Hello World\n’); }).listen(8080); console.log(‘Server running at http://127.0.0.1:8080/’); Run node hello.js You’ll see Hello World printed when …

Continue reading »

Share