Posts by André • 484 points
12 posts
-
0
votes1
answer222
viewsQ: Command "dotnet run" too slow
When I execute the command dotnet run via the command line in my ASP.NET Core project I have to wait 8 to 10 seconds until I can access the browser to test any changes. I downloaded Visual Studio…
-
5
votes3
answers3579
viewsA: How many days is the current month with Javascript?
function diasNoMes(mes, ano) { var data = new Date(ano, mes, 0); return data.getDate(); } // Exemplo: console.log(diasNoMes(2, 2017)); // Exibe 28. …
javascriptanswered André 484 -
4
votes1
answer598
viewsA: Print 2 records per page with Mpdf
$i = 1; // Número de registros mostrados, começa com 1 para não dar erro de divisão por 0. foreach ($registros as $registro) { echo $registro; // Exibe o registro. if ($i % 2…
-
1
votes1
answer68
viewsA: Spawn play ENOENT Nodejs
From what I searched, this library (Troubadour) needs an audio player installed on your system, you can check the list of supported players on this page:…
-
5
votes2
answers82
viewsA: Problem with browsers
Press CTRL+Shift+I to inspect the page element, go to the Network tab and check the Disable cache checkbox, as shown in the image below. Whenever your inspect element is open the cache will not be…
-
3
votes1
answer312
viewsA: jQuery function does not work inside if
When executing this line: var cancelamento = $("#cancelamentoMes").text().replace('%',''); The cancel variable receives the #cancel Mes element, picks up its text and swaps all % for nothing,…
-
0
votes2
answers482
viewsA: Auth rules with Nodejs + Passport + Mongodb
When creating the JWT token, you can store information within it, such as the user id, the user name, and the access level him. Having its access level, you can create a middleware that checks…
-
4
votes1
answer951
viewsQ: How to run different Node.js sites on the same server?
I have a Linux server and on this server I have several hosted websites, each with its folder and files. I want to start using Node.js to create the API’s for each site. What’s the best way to do…
-
1
votes1
answer516
viewsA: Reuse of connections in Nodejs + Mongoose
The connection to the database should be in the main project file, the one that Node will run, so the connection will only be made once. For example, the code below is your main file, the app.js,…
-
0
votes1
answer955
viewsQ: How to organize the REST API and website frontend?
I am creating a Single Page Application site, for this, I created a Restful API on Node.js that does all the actions in the database, login, sending emails and etc. I thought of creating a "public"…
-
3
votes4
answers1986
viewsQ: Where does JWT keep the tokens?
I am following the following tutorial to create an authentication system using Node.js and JWT: https://scotch.io/tutorials/authenticate-a-node-js-api-with-json-web-tokens By following the steps of…
-
3
votes3
answers5760
viewsA: Is there any equivalent of "$(Document). ready()" with pure Javascript?
You can also use the script tags at the end of body, as shown in the code below. With the script inside body the code will only be executed when body is loaded. <!DOCTYPE html> <html…
javascriptanswered André 484