Gulpfile.js for vanilla AngularJS projects

Since I’ve learnt Angular, most of my front-end web applications are written in it. Its brilliant. Everything works fine, up to a point where your application has grown 10 times the size it was since you started it. At some point you’d want something to accelerate your delivery. That’s when gulp comes in.

Gulp is kinda like a build tool but for javascript based applications. It runs on Node.js and is available on npm. All you need to do is:

or if you are using a unix based application:

That gets you access to the gulp command line. Once you have gulp installed, you need to something that tells it what to do with your project. Unlike many other build tools, gulp favours code over configuration. This means that rather than writing XML or YAML files that define the tasks, you write code. This is what makes gulp unique.

So, here’s what I have. Below is my gulpfile.js that I use in most of my AngularJS projects: Continue reading

Waiting for tomcat to start up in a script

So here’s something that I have found that waits for tomcat to come up but rather than polling or a static time based wait, it uses FIFO pipeline to wait.

Drop this into a tomcat-util.sh file, make it executable and then source the file:

You’ll now have isTomcatUp available as a bash command.

 

Some thoughts on the RESTful way of the APIs

So, it’s been a while now since I have written a post reflecting my thoughts on a subject. It has been primarily like this since I’ve been busy doing what I always do – trying out new cool things and ideas.

In almost every app, every SaaS platform or every web based backend system I write, the first thing I start with is an API. This API first attitude has helped me in many ways. First and foremost, it helps me think how the architecture must work to suffice the needs of the client. It also leads me to think about containers and how best to distribute load etc. Now, this might seem like an overkill when just trying out a new idea but it at least gives me a rough estimate of the scope of the project that I’m looking at. Besides, now a days, working with thick client frameworks like Angular JS almost demands that you have a strong backend with a well written collection of APIs. Continue reading

Notes from TechCrunch Disrupt London 2015

TC2015 1

Day One

Sevenhugs remote

EU startup. Easy control of Phillips hue lights. Maps the person with the remote into a 3D space. Could potentially be used for indoor navigation?
Point the device at any smart bulb or device and instantly control it.
Quite expensive. €200 to produce the remote. Continue reading