Tags » Javascript

Registering static methods are remote methods in Loopback 2.0

Loopback 2.0 and getting:

throw message;
TypeError: Cannot call method ‘apply’ of undefined
at SharedMethod.invoke (/Users/devakone/tonsorious-strongloop-api/node_modules/loopback/node_modules/strong-remoting/lib/shared-method.js:213:17)

Reason is more than likely that you have defined a static method on your model that does not match the string used to register the static method as a remote method as outline here.


Creating Tic-tac-toe in JavaScript (and why I enjoyed it)

Tic-tac-toe is one of the simplest games around, yet it can be tricky to win. The concept of Tic-tac-toe is super simple: you have a 3×3 grid, and each player takes turns writing their respective symbol, either an X or O, in a square. 1,243 more words


Install Node.js

Install Node JS through NVM

Source: https://github.com/creationix/nvm

Why use NVM?

- You can manage multiple version of node in your dev

- Installing node directly will require sudo when you need to install stuff or do things with node ~ So Cumbersome! 135 more words

Analytics Definitions

This is a continuation of the Analytics series of posts.

Note: See Analytics on wikipedia or other sub-pages for more detailed discussions of these terms. 695 more words

Retrieve last created task of an Account

In this blog we will look into a scenario which is frequently used- “To get the last related record of the parent record”.
Let take a specific scenario. 267 more words


Creating a Hashtable (ish) JavaScript Data Structure with an Object Key

Recently I was working on a project and found myself with the need to be able to store and retrieve associated pairs of objects.  I wanted hashtable-like functionality that would also allow me to use objects as both keys and values in the associated pairs.   97 more words


JavaScript Canvas Games: Cleanup and Refining

So we have animations, spritesheets, player movement. Basically everything needed for a game. But this still doesn’t feel like a game. This chapter isn’t about any one particular topic but more going over some things to make your game more of an actual presentable thing. 1,801 more words