Posts by Daniel T. Sobrosa • 1,643 points
9 posts
-
2
votes3
answers5697
viewsA: Download images
Actually there is no way to do this via javascript, browsers have a security restriction that does not allow a request to be made to a different server. So who should do this is your back-end and…
-
11
votes4
answers512
viewsA: Debug applications in Nodejs
The Node itself already has a debug tool, just run your Node module as follows: node debug nome_do_seu_modulo Follow the documentation to see how it works: http://nodejs.org/api/debugger.html But…
-
38
votes4
answers66720
viewsQ: What is the correct way to make a regular Javascript substitution for all occurrences found?
What is the correct way to make a regular Javascript substitution for all occurrences found? The way I do these days: var i = 0; while ((i = str.indexOf("_", i)) != -1) { str = str.replace("_", "…
-
30
votes6
answers20110
viewsA: How to center the content of an element vertically?
In this way it is independent of the content: .container { position: absolute; width: 100%; height: 100%; background: #ccc; } .content { position: absolute; top: 50%; left: 25%; width: 50%;…
-
15
votes3
answers2138
viewsQ: How to perform unit tests on nodejs
I’d like to run unit tests on Node.js, I’m using the grunt-jasmine, but it does not recognize the variable exports, module and neither required. Is there a way to solve this or does someone suggest…
-
9
votes2
answers1058
viewsQ: How to configure HTTP authentication with Jboss?
I would like to protect my entire site with user and password, I saw that it is possible to do this using HTTP authentication, but I would like to know how to do this in Jboss.
-
25
votes2
answers4446
viewsQ: How to package a Node.js project into an executable?
I have a Node.js project but I need to create an executable for Windows and one for Linux, both of which still contain the built-in Node.js. I managed to do something similar in an app node-webkit…
-
8
votes2
answers1137
viewsA: How to use a module in Angularjs?
In part angular.module('app') .controller('HomeController', function ($scope, Authentication) { var usuario = { login : 'teste', senha : 'senha123'}; $scope.usuario =…
-
9
votes10
answers34548
viewsA: What is the difference between the == and === Javascript operators?
The === compares variables of the same type. The == follows rules like "true" == true, 1 == true, etc... Therefore, use "use Strict" at the beginning of your function or file, this forces the use of…