Category Archive: Miscellaneous

Mar 05

Remove Submodule from GIT Repo

There is no git submodule rm command, so it takes a bit of manual work to remove a submodule reference in your git repo From (https://git.wiki.kernel.org/articles/g/i/t/GitSubmoduleTutorial_c489.html) Delete the relevant line from the .gitmodules file. Delete the relevant section from .git/config. Run git rm –cached path_to_submodule (no trailing slash). Commit the superproject. Delete the now untracked submodule files.       …

Continue reading »

Share

Mar 02

Using Git Submodules

If you want to reference code from external repositories within your own repository in GIT – you’ll have to use GIT submodules. Let’s say that we have a repo called sandbox, and inside sandbox, we have a lib sub directory that refers to multiple libraries from other repos, looking like the following /sandbox # your …

Continue reading »

Share

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