Skip to main content

All Questions

Tagged with
24 votes
3 answers
8k views

Converting an IP

I've written a DNS tool in Node and would like to know if there's a better and more efficient way of handling the conversion from an IP to a long. I'm not too good at bitwise just yet and would like ...
user avatar
16 votes
2 answers
45k views

Exporting routes in node.js Express 4

I'm using Express 4 to provide routes to HTML/Jade files, and as well to provide an API. I want to separate routes from server file, and go even further- separate API from WWW. My code now looks like ...
Jarema's user avatar
  • 263
15 votes
1 answer
296 views

Making an efficient and healthy db call for a real-time browser game

I'm doing a calculation for a real-time browser game, where users can invest some of their balances to the site. I need to update their invest's based on ...
Lazy's user avatar
  • 163
15 votes
2 answers
5k views

Test mongoose model

I have mongoose model: ...
Naor's user avatar
  • 505
14 votes
6 answers
1k views

Creating cards for a game of SET

I'm creating cards for a game of SET. Can the following be rewritten in a more programmatic way, possibly getting rid of the embedded for loops? ...
Randomblue's user avatar
13 votes
1 answer
259 views

Generate a URL, shorten it, insert it in a tex file and compile those tex files

I have written a NodeJS module and its tests to generate a URL, shorten it with Bitly, insert the short link in a tex file, compile these tex files to PDF and then merge them into one. The code is ...
springloaded's user avatar
13 votes
1 answer
2k views

Basic chat server and client using WebSocket

Based on Node.js in Action (Manning Publications) chapter 2 "Building a Multi-room Chat Application", I've taken the model they presented (which is all typical ES5 and jQuery) and completely ...
Phrancis's user avatar
  • 20.4k
12 votes
2 answers
3k views

Generate a nested structure based on a list of file paths

I'm currently working on a small application, as a learning exercise for a Javascript novice. I need to generate an object based on a folder structure. Here is an example of the folder structure: ...
user avatar
12 votes
1 answer
743 views

Make a summary from a larger text-file

This code makes summaries from larger texts. I have searched around for an algorithm and found the following: Associate words with their grammatical counterparts. (e.g. "city" and "cities") ...
Nilzone-'s user avatar
  • 1,436
12 votes
1 answer
19k views

Seeding MongoDB using Mongoose models

I'm using mongoose to seed a mongodb database based on my mongoose models. I'm particular interested in improving the seed code. I have two models, an article and a category. The relationship between ...
Gerard Downes's user avatar
11 votes
2 answers
4k views

NodeJS broker between MongoDB and RabbitMQ

I wrote a small program that aims to take some data from the MongoDB database and put them in the RabbitMQ queue. I tried to use only promise style but I am a beginner in JavaScript. Could you please ...
Julio's user avatar
  • 113
11 votes
1 answer
574 views

node.js passport wrapper

I have started some experiments with node.js. Any comment on style (especially the callbacks) and best practice is appreciated: PassportControl.js ...
Loki Astari's user avatar
  • 97.2k
11 votes
2 answers
11k views

Node.js password salting/hashing

In view of the recent LinkedIn breach, would anyone care to review my data access routines relating to user access? This is a standard node.js module, accessing a Postgres database. ...
stusmith's user avatar
  • 245
11 votes
3 answers
979 views

Garbage collection in JavaScript multiplayer game

I am currently creating a Multiplayer Game using node.js and web sockets. The client side is receiving the positional information and applying it to all the players on the client side. Each client ...
user avatar
11 votes
1 answer
221 views

Cardshifter web client deploy script

The Cardshifter web client is coming along! The game client is a web app written mostly in Angular.js and is hosted at at play.cardshifter.com. @SimonForsberg (who runs the server) is getting tired of ...
jacwah's user avatar
  • 2,671

15 30 50 per page
1
2 3 4 5
56