Compile and serve go http apps

When developing go web apps we need to recompile and re-serve the application to view the changes we made. This process of making changes, stop the app from running, recompile and run again can be quite annoying. We need a tool that serves the app, notices our source code changing…

Read this article

Setup Karma to test Angular apps

Last post we talked about how to setup Karma with mocha and chai. This post we see some particularities in setting up Karma to test Angular apps. Since Karma loads the JavaScript files for us, we won't include an index.html to bootstrap the Angular app or to initialize some…

Read this article

How to setup Karma JavaScript test runner

Karma is a test runner developed by the Angular team trying to bring a productive test environment to developers. As a test runner it allows us to run our client side JavaScript tests in real browsers from the command line. Though we find plenty of information about Karma on their…

Read this article

Using the go router package

The router package provides a simple URL router and HandlerFunc dispatcher for go web apps. This post explains how to use it. In its simplest form, just create a router instance and register HandlerFuncs to HTTP verb/path pairs. Use the router by calling Handle and ListenAndServe. A working example…

Read this article

URL router for golang webapps

Last week I've created an URL router and HandlerFunc dispatcher for go (golang) webapps. I considered the following ideas (heavily borrowing from express/connect): registering handlers based on HTTP verb/path combos should be easy, as this is most often used split complex HandlerFuncs into multiple smaller one which can…

Read this article

Configuring haproxy to load balance multiple engine.io servers

Haproxy is a Load Balancer to forward traffic to multiple servers. It works with HTTP and plays well with WebSockets. Engine.io is the implementation of transport-based cross-browser/cross-device bi-directional communication layer for Socket.IO. It's WebSockets with fallbacks to make it work on the web. Engine.io is much…

Read this article

On passport.js, specific use cases

In the previous post, I talked about the authentication flow and the flow for subsequent requests using passportjs. This post will cover some specific use cases. What user information to store in the session and what not? It's best to keep the session information small and only attach user information…

Read this article

Understanding passport.js authentication flow

Passport.js is a flexible authentication middleware (allowing users to log in) that can be fully customised and works great with connect/express. It is flexible in the sense that it allows for different authentication strategies (think via Twitter, via our own user database - installed via separate modules that…

Read this article

Get to know backbone.js, before it becomes just another pain in the #!$

I'll be presenting about Backbone.js again to the Drupal community tomorrow morning at DrupalCampLeuven. My talk 'Get to know backbone.js, before it becomes just another "pain in the #!$"' addresses the need in the Drupal community to get up to speed about Backbone.js. Drupal 8 will ship…

Read this article

DUG about Backbone.js

Already introduced Backbone.js to Dutch Drupal developers. Today organized a Drupal User Group to talk about backbone.js to Belgian Drupal devs. Fortunately, we could spend a bit more time on the topic. Really enjoyed the talk. Audience asked lots of interesting questions. Thanks to Sven Decabooter for recording…

Read this article

Introducing d3.js at fronteers meetup

I presented about d3.js at a fronteers meetup in Mechelen. The talk is a practical d3.js introduction to teach some of d3's fundamentals such as data-joins, scales, axis, labels, ticks, animations... We started off with a plain SVG representing a chart, refine it, in each iteration touching a…

Read this article

Backbone.js, no more JavaScript spaghetti code

As backbone.js is committed to drupal 8, I gave an introduction talk about backbone at drupalJam in the the Netherlands. It's all about Backbone.js fundamentals with models, collections, views and their interaction (change event - rendering), to really understand what's going and how it helps manage JavaScript application…

Read this article

Introducing Grunt.js, the JavaScript Task Runner

Together with Anthony Ringoet, I presented about Gruntjs at the Node.js User Group in Antwerp. We gave a practical introduction to using Grunt.js. Once the basics (installing, using) were adressed, we took on some more advanced, in depth topics such as tasks, "magic" config attributes and project scaffolding…

Read this article

Corelio annual report with backbonejs and reponsive d3js charts

I was asked by Johan from Wolf's Little Store to help creating some d3js charts for Corelio's 2012 Annual Report. We ended up creating a backbone.js application to display the slides touching on different topics. Some of the challenges Display the chart axis on page load, but only start…

Read this article

Extend Fail2ban to send text messages every time a user/bot gets banned

To prevent scripts from brute forcing their way into my VPS via SSH I use Fail2ban. It's a tool that checks the logs for password failures and set IP rules that blocks that user's IP for a given time. I have it already set up to send emails (one of…

Read this article

Install latest version of node to use without sudo

Explains the steps I followed to install node from source on Ubuntu server. This is just kept as a reference, jump to the resources to get the link to a more detailed article. Ensure we can build/curl // Update package manager sudo apt-get update // Install compiler sudo apt-get install build-essential…

Read this article

Get directories size in linux

To find out the sizes of the different directories in our current location do: du -csh * Which stands for: du: disk usage c: grand total, might think of it as "compute total" s: summary h: human readable …

Read this article

Visualization worldwide Spotify track availability with d3js and Twitter's flight framework

To get familiar with Twitter's flight framework, I created a small data visualization of Spotify's worldwide track availabilty. I use the Spotify API to find the availability of the track wordwide. The results are visualized with d3.js. The countries for which the track is available are highlighted on a…

Read this article

Tools used to create data visualization Apps for Antwerp

We used a couple of tools to create our data visualization for Apps for Antwerp. d3js D3js played a mayor role. It is a JavaScript data visualization library with just the right amount of functionality to create visualizations. It does not try to do too much by providing configurable charts…

Read this article

Apps for Antwerp submisson: visualizing Antwerp's districts

We submitted a small data-visualization app for Antwerp's first Apps for Antwerp event. A challenge for developers to come up with useful applications or visualizations using the city’s data. Our app visualized Antwerp's nine districts on different parameters. We settled on a minimal donut chart, see for yourself. A…

Read this article

How to remove all files but one from command line?

To remove all files but a given one do: find . -type f -not -name "application.make" | xargs rm To also remove the directories do: find . -not -name "application.make" | xargs rm -r …

Read this article

View logfiles while logs update

To view logfiles while they update do: tail -f path/to/logfile_name Thanks Jeroen for the tip.…

Read this article

How to find out which ports are in use

To list all the ports in use on your machine, do: netstat -anf inet To see which process is using a specific port, do: // sudo lsof -i :<portnumber> sudo lsof -i :80 The above will list all processes using port 80. To kill a process, do: // kill -9…

Read this article

Visualize latest commits from all branches in git

Use git show-branch to know which branch last was committed to. git show-branch --color It visualizes all branches with their last commits.…

Read this article