Introduction to Sails.JS ORM queries, part 2

In my previous post, I wrote about Sails.JS ORM which includes model definitions, joins, attributes and such. In this post, I will go over some simple and more advanced queries that will use the previous examples as a basis for our ORM queries. For a more comprehensive list of queries, check out the GitHub documentation for details. Sails.js uses Waterline out of the box as its ORM (object relational mapper) and it's basically an object-based way of querying the database. We created the models with a set of attributes, types, etc so it can be used as a 1:1 object representation of table/docume…

Read more »

Introduction to Sails.JS Models and ORM, part 1

I have been working with Sails.JS for a little while now and would like to share a bit of information on how to use the Models and Waterline/ORM (Object Relational Mapper) when working with your database. An ORM is basically an API to access your database and perform queries against it. Waterline as an ORM has built-in adapters that allows you to use MS SQL Server, MongoDB, Redis among a host of others. It simplifies the process of working with a database since you're using the same API regardless of what database you're using (see Waterline on GitHub to see if there's an adapter available for…

Read more »

The Art of Successful Learning

Posted on

I get asked a lot on how I'm able to learn something new in a short period of time. In a sense, I'm a naturally curious person and learning is something that I've been doing for my whole life. After college, I kept on reading books and constantly educated myself in various subjects. In this post, I'd like to share what I believe are the key ingredients to successful learning. I'd like to highlight some key points that leads me to better learning that might help some people along the way. It is worth recognizing that understanding the learning process is the key to successful learning. It is im…

Read more »

Facebook authentication using machinepacks in Sails.JS

When I got first started with Node.JS about two years ago, I came across Sails.JS and instantly fell in love with it. Two years later, it is still my "go-to" web framework when building a Node.JS application. If you're not familiar with Sails.JS, it provides a real-time MVC framework on top of Node.JS. It's basically the ASP.NET MVC for .NET or Rails for Ruby. While it has some pretty nice features out of the box (ie real-time capabilities using websockets, asset pipeline, CLI tools, etc.), the main selling points for me were the built-in conventions and solid, well-thought architecture. For e…

Read more »

Angular 1.4 experimental: directive within a directive

I recently ran into an issue where I have a fairly nested directive and within the directive itself has an input that requires a decorator type directive such as for validation. As far as the title of the blog post, I figure that with each Angular 1.x release (2 in the near future) it's probably best to tag these posts accordingly since each version introduces new syntax, etc and might not work if you're still on the earlier version. The problem I'll be using TypeScript for my example. For simplification, let's say that you have a directive that validates an input. The directive is called, "va…

Read more »