Posts by Colasanto • 468 points
29 posts
-
3
votes2
answers84
viewsQ: Filter object array from a Javascript search string
I have an array of objects where sometimes a property can come null. I need to apply a filter to this array to capture objects that have the field and functionality that are passed by a string in a…
-
2
votes2
answers52
viewsA: How to get HTML buttons with javascript
One way to do it would be to capture all buttons, then iterate through them and condition actions according to button values. For example: const buttons =…
javascriptanswered Colasanto 468 -
0
votes2
answers108
viewsA: Access variable item in JSON using Node.js
Probably not the best way to access such property (including I will follow the post to learn), but you can use a for in to iterate on the property PETR4 or any other within the results. Example:…
-
-1
votes1
answer465
viewsQ: Settings Jest + Mongodb
I am studying jest and stuck in a part in the course where it is made the configuration of the project to run the jest next to the mongodb. I’m using the dependency @Shelf/jest-mongodb.…
-
0
votes1
answer92
viewsA: Failed to open my server by Node.js
I don’t quite understand the question of permission you mentioned. The only thing done in his code was to instantiate a server that would run on port 5500 - http://localhost:5500/. However since you…
-
1
votes1
answer56
viewsA: Gestures at angle 9 with hammerjs
After losing all day, I found the problem, I leave here for future reference. It is necessary to import the HammerModule package @angular/platform-browser in the app.module.ts and list it in imports…
-
-1
votes1
answer56
viewsQ: Gestures at angle 9 with hammerjs
I’m trying to use the hammerjs to capture the swipe in the mobile version of my application, however, the event swipe seems not to be recognized since the console.log within it is not logged.…
-
-1
votes4
answers117
viewsA: How to simplify javascript "getElementByid"
See if this makes sense to your case. We create a small function that takes all inputs for type, and scans all of them enabling and disabling according to the checkbox, in this way, we do not take…
javascriptanswered Colasanto 468 -
1
votes1
answer707
viewsA: Vscode does not show the node_modules folder in Explorer
Enter into the preferences of VSCODE and check if there is the option **/node_modules in the block File:Exclude. If it exists remove it. Way: CTRL+, -> Research Exclude -> Must be the first…
-
1
votes1
answer99
viewsA: Is it possible to create a remote repository on github through the terminal?
It is possible yes (evaluate if it is worth the effort), follows below: curl -i -u user:pass -d "{\"name\":\"test\",\"private\":true}" https://api.github.com/user/repos It is necessary to hit the…
-
0
votes1
answer690
viewsA: Attempted import error: 'Yup' does not contain a default export (Imported as 'Yup'). NPM
How are you importing Yup into your project ? It doesn’t have a standard export, so you can’t import it this way: import yup from 'yup', you need to import it like this import * as yup from 'yup' to…
-
1
votes1
answer49
viewsA: Position Material icone within tag span
In the parent element you must put position: relative and have a fixed size on it, and the element you want to position should be like position: absolute; https://jsfiddle.net/2xr46an0/ I changed…
-
1
votes1
answer169
viewsA: Blank space on the mobile side at ver são mobile the site has a white side, link http://deivilydias.github.io/
The white side is occurring for two reasons: Element button of id="acao", he has the property visibility="hidden", this property hides the element on screen but keeps its position in the DOM element…
-
0
votes3
answers75
viewsA: How to leave a text (on the left) on the photo side (right side) in the same div? I am new and I am very lost
If I got it right, you want to put the text next to the image (left text, right image). To do so, simply involve the h2 and the p with a div, and in his class sobre-projeto2, include ownership…
-
1
votes1
answer410
viewsA: Javascript - Regular expression for formatting values in real
I will post an alternative to regex. Refers to a native javascript function toLocaleString. const valor = 1542; const currencyBRL = (value) => { const formattedValue = value.toLocaleString(…
-
1
votes2
answers94
viewsA: Email Marketing - Responsive
I use a tool called MJML for mounting templates. It has its own code and is very complete. In the end, we get a specific html code for responsive emails. Here you can find some examples of templates…
-
0
votes1
answer24
viewsA: convert pdf files with pdfjs
Maybe I can help with some idea. I had a similar problem using jsPDF, it seems that the html methods are deprecated (both the addHTML as to the fromHTML), the exit I found was the following: install…
-
1
votes1
answer40
viewsQ: Object change with javascript
My API is returning a array with the objects in the following structure: [ {id: 1, name: "Flávio", position: "SP - Atacante"}, {id: 2, name: "João", position: "SP - Goleiro"}, {id: 3, name:…
-
0
votes2
answers186
viewsA: preventDefault() does not work
Try to change your call from onSubmit for: <form onSubmit={prevent}>
-
1
votes3
answers1189
viewsA: How to structure React Js folders and files?
I particularly like to use the structure below. Separation components (truly reusable components at any point of application), pages (the pages), services (any external access), helpers (functions…
-
0
votes3
answers375
viewsA: What does [] mean after a variable?
When talking about array, the indexer is the position of the element within the array, since if this model is used in objects, we will be referencing a key of the object. Example: let arr =…
-
0
votes1
answer58
viewsA: Superimpose one <div> to the other keeping them aligned to a third <div>
Take a look here if that’s about what you need. https://jsfiddle.net/y1ng07oz/ Basically, you need to create a container (called content in the example), this container needs to be relative, by…
-
1
votes2
answers67
viewsA: Change color of partition
A gringo stack workaround https://stackoverflow.com/questions/6382023/changing-the-color-of-an-hr-element hr { display: block; height: 1px; border: 0; border-top: 1px solid #ccc; margin: 1em 0;…
-
2
votes1
answer1195
viewsA: How to take the margins from the page? HTML/CSS
Use in your CSS the following snippet: html, body { margin: 0; padding: 0; }
-
0
votes2
answers51
viewsA: How do you use the console to display the X and Y position values of the mouse?
An example of use. Here you have the element where you will capture the mouse. const el = document.querySelector('.canvas); Here the event that captures the position within the element.…
-
1
votes1
answer86
viewsA: How to add a text to an input via javascript?
I’m not sure I understand, but if you understand. First you capture the input you want in javascript, something like: const ipt = document.getElementById('id_do_input'); and later changes its value…
-
0
votes1
answer177
viewsQ: Help with API/useEffect - React
I need to make a call to the API with React and for that I’m using Axios. Doing a test with the code below, on the console I can see the result: const [bill, setBill] = useState([]); useEffect(()…
-
1
votes0
answers79
viewsQ: Logs in postgresql
Good morning Everybody, I have a trigger to log in INSERT, UPDATE and DELETE in the postgresql, but the way I’m logging in, it’s as if the bank’s own user had done the operation. I needed to be…
postgresqlasked Colasanto 468 -
1
votes0
answers678
viewsQ: Expo-cli installation error
Personal talk. I am trying to install expo-cli on linux (using sudo or not) and am getting the error below: npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! [email protected] install: `node-pre-gyp…