Category: General (page 1 of 4)

General posts, that don’t actually fit into any category

Wetland ORM for Node.js

Wetland tutorial

After around 459 commits and almost a year of coding, testing, reading specs and writing documentation, we finally have a solid ORM that we feel deserves a place in your application.

Wetland is a modern object-relational mapper (ORM) for node.js. It allows you to get started quickly, without losing flexibility or features. It brings ACID transactions, a unit of work, dev migrations and production migrations (generated), state maintenance using Proxies, recipe based hydration and much more to Node.js.

I could ramble on about wetland and all of its features for days, and I have. I did so in the form of documentation, which includes the just finished mega-tutorial for Wetland.


One of the next things we’ll do is create a series of videos based on the tutorial we’ve written. We’ll add a larger set of decorators for Typescript based projects, and improve the documentation even more.

Currently we’re trying to get the word out, and introduce as many interested developers to wetland as possible. Any stars on github, feedback, shares or questions are welcome.


If it’s your first time with wetland, perhaps first look at the quick start, or the example app. In any case, below you’ll find a list of links to resources.


If you have questions or feedback, you can find us on github in our main chat channel or our wetland channel on gitter.

(k)ubuntu on ideapad in legacy

Hello reader,

Did you just buy a new laptop, hoping you could just install (k)ubuntu and start working like a pro? And did this turn out to be an unpleasant experience because (k)ubuntu won’t boot? And are you also weirded out by my infomercial-style writing? Then I have the solution for you!

About a week ago I bought a nice new IdeaPad with awesome specs. After installing kubuntu, I couldn’t get it to boot up. It took me a while to find the problem, which turned out to be the simplest possible explanation (A typical case of Occam’s razor).

Assessing the damage

To make sure you’re experiencing the same problems, make sure you followed the following steps first, before trying the solution I’ll propose further down the article.


Make sure you used a 64bit version of the OS. If you came here because of a problem with a UEFI-bootable device, it’s highly likely you need 64bit.


If you’re using Legacy boot (BIOS), first make sure your boot mode is set properly (legacy, also set priority to legacy). Also make sure you have QuickBoot/FastBoot, Intel Smart Response Technology (SRT) and in the case of a laptop running windows 8, Fast Startup disabled.

In terms of booting, also make sure the correct boot order (the HDD first) is set.


This one might sound silly, but make sure you successfully installed (k)ubuntu, and that it didn’t crash on some sort of error.

The proposed fix

In my case, the problem was a missing boot flag. That’s silly, and can easily be fixed.

Start live cd/usb

We’ll need a terminal so we can run some commands to fix this problem. First, start the live cd. Once there, open up a terminal.

Check boot flag

Before we start messing with our disk, let’s first make sure that the missing flag is indeed the problem. Run sudo fdisk -l and check if your primary disk (HDD) has a boot flag enabled. You can read more about this here.

Set the boot flag

If the boot flag doesn’t exist, this is most likely the cause of your OS not booting.

  1. First, find the name of your primary disk. In my case, this is nvme0n1.
  2. Run fdisk, so we can manipulate the disk and add the boot flag.
    • sudo fdisk /dev/nvme0n1
  3. Now were in interactive mode, run the following commands in sequence:
    • a (toggle a bootable flag)
    • 1 (partition number)
    • w (write changes)
    • q (quit)
  4. Reboot your machine. You should now boot to (k)ubuntu.

I hope this helps someone!

Sails hook wetland ORM released

Today is a special day. Well, to us anyway. In our previous post, we announced the release of Wetland ORM. This post brings wetland to your project.

We’re happy to announce the release of sails-hook-wetland, a sails.js hook bringing the power of Wetland to projects near you!


  • All default sails blueprints.
  • Nested populates.
  • Migrations.
  • Runs side-by-side with waterline.
  • Unit of work (transactions).
  • Dirty checking (optimized).
  • Lower memory footprint.
  • Performance.
  • And the rest of the wetland features.

Getting started

To make it easy for you to get started, we’ve written an extensive README, and built an example application. The example application demonstrates the use of entities, repositories and use of custom actions.

This is simply a sails application, bundled with our authorization hook. You can run it as such.

Happy coding!

Wetland ORM for Node.js released

After almost a year of hard work, we’re happy to announce the release of Wetland ORM!

Wetland is a nodejs ORM, which stands for object-relational mapper. An object-relational mapper is responsible for allowing developers to communicate with their database using an object oriented structure.

SQL based database store data in a relational manner. This format is incompatible with most object oriented formats desired by developers.

Wetland is an attempt to formalize this communication, basing a lot of its architecture on the JPA spec. Other languages have similar systems in place. For example, PHP has Doctrine and Java has Hibernate.


The major features this ORM provides are listed below.

  • Unit of work
  • Transactions
  • Entity manager
  • Manager scopes
  • Cascade persist
  • Deep joins
  • Repositories
  • QueryBuilder
  • Mapping
  • MetaData
  • Entity proxy
  • Collection proxy
  • Criteria parser
  • More…

Getting started

To get started with wetland:

Happy coding!

Github credentials sharing

jspm install and github rate limiting

It has come to our attention (thanks to @michielcornille!) that some developers, probably unknowingly publish their username and password to the world. This is dangerous.

Using this information, people with ill intentions can:

  • Delete your account, or do anything else for that matter.
  • Login on your other accounts (logged in on heroku? your production environment is now vulnerable).
  • Login on other systems using the same credentials (people still don’t use different passwords on different sites).
  • Modify code and inject malware into existing repositories without you knowing.

An example of this, used in our own repository can be found here.

In our case, it’s a readonly access token. But some use their github username and password instead. for obvious reasons, I will not be linking to examples in this post.

This is usually done by developers due to github’s rate-limiting on api requests, which occurs for example when working with JSPM. There’s nothing wrong with using a token, provided you’re careful.

What can I do?

If you already have your username and password on github, change your password. It’s in version control now, and people have it.

If you’re using an access token, check the permissions. Anyone can use your token, and if it has too many permissions, you’re now vulnerable. You can safely change the permissions without breaking the token itself.

  1. Always use 2FA. Read more about it here. This makes sure that even if someone gets your login credentials, they can’t do anything.
  2. Don’t put your credentials on github. Not even base64 encoded (that can just be decoded). Instead, take one of the alternative approaches (for instance environment variables).
  3. When creating access tokens for your account, give it the minimal permissions required.

Please share this article with anyone you might think is vulnerable for this.

Thanks for reading,

happy coding!

Release posts

Good day to you all!

This blog post is just the “hello world” of our new release posts. We have been working hard to provide quality modules for aurelia over the past six months, and we’re proud of what we’ve accomplished so far.
We’ve unified the structure of our repositories, including docs, tests, linters and more.

On top of a bunch of small utilities and repositories we’ve released, we’ve also created these:

These modules are being used, and are becoming more important. This all means it’s time to be more public about what’s going on with these repositories.

Starting with our next big release, we’ll be posting updates on this blog about what exactly it is we’re releasing. This includes migration guides, fixes, features and more.

That’ll be it for now. Until next time!

PHPStorm / Webstorm plugin acejump

Fresh IDE, happy me

Today is a good day. I got to configure my IDE on a new machine, which is always a joy. I started setting up the basics such as code style, libraries, line numbers, eof newline etc and moved on to the plugins. To my surprise, very few people I work with seemed to be familiar with an amazing plugin called AceJump. This triggered me to write about it and try to better your IDEs one by one.

What is AceJump?

AceJump is a plugin by johnlindquist that allows you to jump your cursor through a file, by simple find and magic. The plugin itself has the following description:

General usage instructions
Hit “ctrl+;”, type a char, then select a char to jump to. When selecting the char “shift” will select the block between the cursor and char. You can toggle “target mode” by tapping “ctrl+;” again, which will select the word you jump to. You can remap the AceJump keyboard shortcut in File->Settings->KeyMap and search for “Ace Jump”. Right-click on it, then select a different shortcut.

The simplicity of the plugin, and the power it gives you makes it an important tool to have in your arsenal. More info about the plugin can be found in this youtube video by John: Ace Jump.

Where can I get it?

You can find the plugin by clicking here or by going to File->Settings->Plugins->Browse Repositories and searching AceJump.

Babel ES7 Leading decorators must be attached to a class declaration

If you ever find yourself seeing this error, the solution is very simple. Remove the semicolon behind your attributes.


As an example, here’s the (current) default app.js from Aurelia. I’ve introduced the bug on line 7.

Upon adding a semicolon behind your decorator (@inject(Router)) you’ll find yourself having above error. So, to fix the error simply remove the semicolon.

Q&A: Schema attribute sails.js models


What is the schema attributes inside models in sails


The schema attribute defines whether or not to enforce the schema.

Come again?

Relational databases tend to have a predefined schema (including what type can be stored, what the name of the column is etcetera). Whatever you insert, fetch or update has to adhere to that schema. Mongo, redis etc don’t have that. You can just insert whatever makes you happy. By setting schema to true, you’re forcing waterline to apply the same rules to schema-less adapters.

javascript dependency management

Hello fellow geek,

A while back, I wrote an article about javascript dependency management, explaining my discomfort with most options out there. I tried filling the void with something meaningful by creating useuses; a gulp plugin that adds zero extra bytes to your combined files but does add meaning to your individual files.

I came to realise, that this plugin was flawed in a couple of ways, so naturally I’ve fixed those flaws. And thus I stand here today to proudly present a new module that takes a different approach but still uses the same solution.


But before I do, I’d like to explain what @uses is supposed to mean, why I think it’s better and how it should be applied.

What’s @uses?

@uses is an annotation I’ve been using for a while now. It allows me to keep track of what dependencies my files have easily.

How do I use it?

Here’s what it looks like:

As you can see, it unobtrusively informs the developer about the dependencies being used by this particular file. So using it is really simple: just maintain the dependencies of your file in the annotations, and you’re already doing it.

So, why is it better?

The arguments I’ve presented in my previous blog post still stand. In summary:

  • It doesn’t add extra bytes
  • It doesn’t force a dependency upon you
  • It doesn’t use weird tags, or magic. Just an annotation.
  • I adds value to your files.


Like I mentioned earlier, I made quite some improvements to the module. Here are the biggest ones.

It’s not a grunt plugin anymore

The biggest flaw was that it forced you to use gulp. There was no standalone version, or alternative for let’s say gulp.~ Useuses itself is now a standalone module that can be used via the CLI, or programmatically.

This means it can be used in grunt, gulp, or any environment for that matter.

It’s faster

I’ve made improvements in the file searches, sorting of dependencies and making sure there aren’t any duplicates. These improvements have made this module a lot faster.

It’s lighter

The module does its job by utilising streams now, not buffering the entire file, for every file. This means that its memory footprint is a lot smaller.

Using it

You can find the module here:

Github: NPM:

©SpoonX 2017