Moving my blog to GitHub!

In order to kickstart my blog again after a while of inactivity I decided to move from Wordpress to Github pages. Will be fun to try out the new features available with pages and Jekyll!

Read More

Presentation-poll

Some weeks back i was given an idea from a colleague of mine, they were going to have a workshop with a larger group of people and needed some way to keep track of people were on the right track following along. This sprung the idea for the little application i now have created namely http://presentation-poll.com

Read More

Meteor + Ionic

So, i had a session trying out the new Ionic support for Meteor! My expectations were high and the experience was pleasant. I ended up doing a small angular-meteor application, scraping some information of my companies list of employees, neatly wrapping it in Ionic framework. You can read the full blog post here if interested! The source code for the application can be found on my git-repo!

Read More

Meteor + Ionic, oh how i have waited...

With the new official Angular support in meteor 1.2, a lot of new and exciting stuff is starting to emerge in the meteor eco-system. The most recent being the newly official support with the hybrid mobile application framework Ionic. This is something that i have been waiting for since i first started using Meteor. The necessity of being able to create nice and neat mobile applications without being a css god is something that i have missed out in the meteor family up until now. Having used ionic prior to meteor im exited to try out if it will run as smoothly as it does native Ionic with the reactive power from Meteor. Exciting stuff!

Read More

List contains element in bash

I just came across this nice way of verifying if a list contains a specific element in bash.

containsElement () { for e in "${@:2}"; do [[ "$e" = "$1" ]] && return 0; done; return 1; }
a_list=("foo" "bar")

if containsElement "$1" "${a_list[@]}"; then
echo "$1 found in a_list!"
fi

kudos to the op of this solution : stackoverflow

Read More

Meteor Update Highchart Dynamically

Reactiveness is always key when we are working in Meteor. Hence it would be nice if we could deliver fully reactive charts with little effort. Thankfully this is very easy using the highcharts package!

Read More

Meteor session and Date

Not 100% sure this has been included or not in the most recent release of Meteor, but for a time there was a problem when trying to store dates in the Meteor Session object due to JSON-compatibility issues and the hot code push. For those whos still running on a version experiencing problems storing dates in session, the way i worked around this was simply to use moment with two helper methods.

getChosenDate = function() {
  return moment(Session.get('chosenDate'));
};

setChosenDate = function(date) {
  Session.set('chosenDate', date.valueOf());
};
Read More

Meteor, rapid and fun!

So the last couple of days i have been exploring the world of Meteor, a platform for building mobile and web applications in pure javascript. The undeniable conclusion is, its rapid, rapid fast development for those already comfortable with javascript.

Read More

Document your API using Swagger

Swagger in all it’s simplicity is a framework used to represent and describe your Restful API’s.

Why would we want to use Swagger? Swagger is a good tool used for closing the gap between documentation and implementation when developing our RESTful API’s. Used to its full extent, we get a nice sense of control given that we are able to explicitly declare both what there server expects to receive being called, as well as when the request have been handled, what we expect to to return.

Read More

Send SVG to server

Using javascript, I ended up just parsing my svg html as a string and sending it with my post data.

var svg = document.getElementsByTagName('svg')[0];
var xml = (new XMLSerializer()).serializeToString(svg);

Include it in your post data and send it to the server…

Read More

Abstract Security Filter on Controllers

What i wanted to achieve was a generic way of determining if a user in my system was suppose to have access to a certain part of the system. I’m sure there are some really nice plugins or stuff that achieves this, but the way i achieved this functionality was to implement a controller based access filter. This way i can limit all actions in that controller simply by defining action: ‘*’

Read More

Username regex spring-security-plugin

Working with spring security plugin in grails, i wanted to narrow down the username possibilities to a “simple name” or an email. This was easily achieved by defining a constraint in my User class provided by the spring security plugin.

Read More

Grails truncate taglib

Ran into this taglib created by Adam Creeger which lets you truncate strings in your grails views. It was exactly what i was looking for except for the missing possibility of also clicking it to extend and show the full text. Here is my updated version for achieving this.

Read More

Grails exception in gsp

I just came across a neat way of handling potential exceptions for when using taglibs or similar in your gsp code.

In my problem scenario i had defined some generic (twitter-bootstrap) modals that were to be pre-rendered with some form data based on a template located in each controller view. The only problem was that this template was not used in each and every controller view, resulting in that navigating in some controllers raised an exception due to missing templates.

Read More

Grails asynchronous view loading with remoteFunction

This is in no way anything new, i just wanted to share an example of a really nice approach (imo) on how you can load some operation heavy rendering asynchronously using the grails remoteFunction. Assuiming that you have a database with a large dataset that you want to aggregate and render in some fashion on a gsp page , but you do not want to stall the pageload opon navigation.

In our gsp we could add something similiar to this..

Read More

Grails and JBoss HornetQ

I would just like to share a setup i did a while back connecting my Grails application(app.grails.version=2.2.3) sending JMS messages to a JBoss HornetQ.

There were some information but not a lot on different approaches in setting up the connection factories, some more extensive than others…

Any way… The way i ended up doing it was to define my HornetQJMSConnectionFactory as a bean defined in resources.xml. I can then use this bean to instantiate a new JmsTemplate producer which then an be used to actually send the messages.

Read More

MQTT and Android

A while back a friend and started developing an online multiplayer Geo-Racing game where a group of people are able to compete against each other in a race from Point A to Point B anywhere in the world (almost). In all its simplicity it is basically like any other running gps tracker out there, with an additional built in competitive system. This post is simply just a small introduction and overview of some of the technologies that is included in the project and a brief introduction of the backend mechanics of the game.

Read More

Mule and FTP, downloading multiple files from within a Callable component

Versions:

  • MuleESB v.3.2.1

This is just a solution i wrote in order to dynamically download multiple files from an FTP server programmatically from within a Mule Callable Component.

This is most likely not the most kosher way of getting multiple files from an FTP, however it did give me the satisfactory results since i was able to selectively choose which files to download and one by one send out in the flow construct.

Read More