Tag Info

New answers tagged

1

Definitely take a look at Waterline.js. It has support for dozens of databases, including MySQL, PostgreSQL, MongoDB, and others. It exposes a uniform query interface that works across relational and non-relational ("nosql") databases Documentation: http://sailsjs.org/documentation/concepts/models-and-orm


3

I'm not familiar with the specific site you're integrating with, so this answer is about the general approach to this kind of problem. The best thing to do in this situation is ask the administrators of the site in question how they want you to do it. Of course, this isn't always possible, so if you can't do this, then the following approaches are in rough ...


1

In case you're using Express + Sequelize, you can do this by using a module called continuation-local-storage (henceforth cls, for brevity). Show me the code // When initializing your Sequelize instance var Sequelize = require( "sequelize" ); Sequelize.cls = require( "continuation-local-storage" ).createNamespace( "db" ); module.exports = new ...


0

There are certain benefits that you can gleen from having one combined javascript file over many smaller files. It does come with a few drawbacks, though. Pros: Better maintenance in your markup - Maintaining .js file references is easier. Just put one/few references across your main wrapper designs, and you don't have to worry about adding anything new ...


0

Most apps come with a standard email signup feature. You ask users to giver their email address, chose a password, and possibly also a username. Then you send an email with a random token (usually embedded in a link to your site for convenience), which the users must give back to you in order to prove that they own the email. Any user can use this method, ...


1

My general first recommendation about this, is don't use it, it makes programs harder to read with no real upside. The primary exception being constructor functions. In a library you can just leave this of a callback being global/undefined, anything you would pass as a this value may as well be passed as another parameter.


0

Use a callback, pass takeStuffBack to cleanStuff as callback taking the data: function cleanStuff(data, continuation){ // Clean data from needless stuff continuation(data); } fetchStuff in module2 becomes: function fetchStuff(data){ // Fetches stuff based on data module3.cleanStuff(data, takeStuffBack); }


1

First of all, I don't think Composer is trying too hard to be a PHP version of NPM - there may be similarities, but differences are to be expected. It may not be the best way to understand it to think of the tool as NPM, Maven, Rake or whatever, but translated into PHP. Secondly, understand that Composer solves 'problem' of autoloading in PHP. Having two ...



Top 50 recent answers are included