Microsoft Office

Keyboard Shortcut for Inserting Comment in Word for Mac

If you have come to this post, chances are you like me found yourself tired of adding comments by using the mouse and was surprised that the “Insert Comment” didn’t feature a keyboard shortcut… but dispair not, the solution is here…

Very intuitively (not really), the keyboard shortcut to insert comment is

Command + Alt + A

If you want to see for yourself or set it to something else, you can find the setting here:

Tools > Customize Keyboard > Insert > InsertAnnotation

Now, you can enjoy the thrill of being able to review documents galore without having to let your fingers leave your keyboard… what a production boost, eh !?


Early Fuse Experiment… porting the Angular-Resource Module to Fuse

Fuse is a cool new front-end technology, probably the coolest alternative right now creating cross platform mobile applications with Native Performance…

I do a lot of CRUD applications, so as part of the learning process, I decided to experiment with how it would be to port the omni-present Angular-Resource ($resource) module to be used in Fuse.

This is still very very early stuff, I just wanted to share it quickly to inspire other people just starting out with Fuse to tinker themselves and share their own cool stuff…

Anyways, enough talking, let’s get to it…

My first task was to use the fetch operation which is the recommended way to make network requests via HTTP, it’s a first-class citizen in Fuse which resembles the same status it will take the browser in the future…
You can read more about the proposed standard for the Fetch API here:

My experiment is based on the lab recently published by Jake from FuseTools… basically just replacing his call to fetch with a call to the Get operation on my resource implementation, which eventually wraps and uses fetch…

It illustrates how it’s relatively easy to implement a 3rd party reusable library and how it can be imported into your Fuse project.

The standard used is CommonJS, and contrary to what FuseTools document themselves, I found during my experiment that its possible to both use the advised syntax of module.exports, but also the less convoluted syntax of exports.[memberName], which is the default for e.g. the TypeScript compiler.

I have included a link to an archive at the end of the post which contains all the files required for the experiment, please feel free to play around with it.

If you are interested in contributing to the further development of the fuse-resource module, please take a look here (

Until an official TypeScript definition is released for Fuse, I’m maintaining my own definition which allows me to compile against the global members of Fuse…

Now, this is very early stuff, so please understand that it’s very rough around the edges and covered in wet paint, and that I’m only sharing it because I’m very excited of where Fuse is taking the next generation of cross-platform development for both mobile, but also desktop, which is one of the really cool features of Fuse…

Example usage

Download the project files from here:


Hacks to get Loopback App’s running on Heroku

To get Loopback App’s running on Heroku, a couple of hacks are required due to the way Loopback manages it’s configurations.

The first issue to solve is to get Loopback to take the port number from the environment since Heroku uses arbitrary port numbers to target different applications.

There is probably a more elegant way, however I first wanted to stay out of node_modules files, so I opted to just focus on modifying server.js.

It’s actually very easy, since loopback internally supports passing arguments to the listen function all the way out from the server.js file.
It does this by switching between automatic configuration and explicit configuration from the arguments passed to the listen function.

So, basically it’s just amending the “start” function to fetch the port number from the environment and pass it as argument to the listen function.

I have done it this way…

app.start = function () {
   // start the web server
   var port = process.env.PORT || 8000;
   return app.listen(port, function () {
      console.log('Web server listening at: %s', app.get('url'));

Using node-sass with latest version of io.js

When using node-sass together with io.js, one of the problems is that it’s not updated to work with the latest version of io.js (at the time of writing, v.1.6.2).
Currently node-sass only supports io.js until v.1.2.

This causes the installation of node-sass and any libraries that depends on node-sass to fail to fetch all resources during installation, which eventually causes processes that tries to use the node-sass library to fail.

The error message during installation is (in my case, using io.js 1.6 on a MBP) the following:

Can not download file from

The error message in the process trying to use node-sass:

Error: `libsass` bindings not found. Try reinstalling `node-sass`?

The failing part is when the node-sass library tries to fetch binding files which are necessary to connect to some of it’s libraries, the solution is therefore to either change the code where it fails (easy, but messy, not my recommendation) or simply download the binding files and manually add it to node-sass (easy, and also a bit messy, but at least we don’t change the code, so a bit easier to manage).

So, what I did, downloaded the file from here:

and save it to the following location:

Now, when you execute a process that uses node-sass, it will find the file, and even you are not running io.js 1.2, the binding still works (only tried with io.js 1.6).

It’s by no means a perfect solution, but it solves the problem immediately and it’s something easily automated since it only involves downloading and copying some files, not changing some code…


Simple WhoAmI for Loopback

Retrieving the currently authenticated user in a Loopback Application can be done in many ways, and one of them is the one I want to share in this post.

I wanted to be able to utilise the Angular SDK as well as the Explorer, so adding a routing manually in a boot script was not really an option, however simple that might be, so I decided to opt for implementing it as a custom Model.

The first thing to do is to create a whoami.json and whoami.js file in the commons directory.


  "name": "WhoAmI",
  "base": "Model",
  "plural": "whoami",
  "acls": [
      "accessType": "*",
      "principalType": "ROLE",
      "principalId": "$everyone",
      "permission": "DENY"
      "accessType": "*",
      "principalType": "ROLE",
      "principalId": "$authenticated",
      "permission": "ALLOW"


module.exports = function (WhoAmI) {

    WhoAmI.whoAmI = function (req, next) {
        var AccessToken =;
        AccessToken.findForRequest(req, {}, function (aux, accesstoken) {
            var UserModel =;
            UserModel.findById(accesstoken.userId, function (error, user) {
                next(error, user);

            accepts: {arg: 'req', type: 'object', http: {source: 'req'}},
            returns: {arg: 'user', type: 'object'},
            http: {path: '/', verb: 'get'}

Secondly, I make sure to add the model to the model-config.json

"WhoAmI": {
  "dataSource": null,
  "public": true

Now, when you restart the server, you will see the following endpoint having been added to your API


And because of the ACL’s we set in the model, all requests without an access-token are handled by the security of Loopback… so there you go, a nice and easy WhoAmI !

Alternatively… a bootscript

If you for some reason should be inclined to prefer putting it in a boot script, all you have to do is to create a file in the boot directory of the server with the following content

module.exports = function (server) {

    var router = server.loopback.Router();

    router.get('/whoami', function (req, res) {

        var AccessToken = server.models.AccessToken;
        AccessToken.findForRequest(req, {}, function (aux, accesstoken) {
            if (accesstoken == undefined) {
                    'Error': 'Unauthorized',
                    'Message': 'You need to be authenticated to access this endpoint'
            else {
                var UserModel = server.models.User;
                UserModel.findById(accesstoken.userId, function (err, user) {