Posts by Fábio Jânio • 3,407 points
226 posts
-
0
votes1
answer113
viewsQ: How to select/find opening and closing quotes in a string using regex?
Passed a string I must apply a regex that selects the opening and closing quotes, ignoring any occurrence of quotation marks in the internal scope of the string. See some examples: "Deve selecionar…
-
3
votes2
answers50
viewsQ: How to avoid Greedy Repetition (.*) to search for string that has defined start, dynamic middle and defined end?
I have a log file that is searched via regex ^WebServer:.*endOfLine. Considering the log below this regex is generating 485 iterations (Steps): String: amet, consectetur adipiscing elit...Lorem…
regexasked Fábio Jânio 3,407 -
0
votes1
answer43
viewsQ: How to deal with the communication between containers in a swarm cluster?
I’m trying to climb a Cluster Elasticsearch on Docker Swarm, but I’m not succeeding in dealing with internal communication between us. The cluster knows and I can access the master on port 9200,…
dockerasked Fábio Jânio 3,407 -
0
votes1
answer26
viewsA: How to format an object in the Terraform output?
I was able to solve it by making it create as many objects as needed within the list/array. Code: output "info" { value = [for vm in linode_instance.vm : { label = vm.label ip = vm.ip_address }] }…
terraformanswered Fábio Jânio 3,407 -
0
votes1
answer26
viewsQ: How to format an object in the Terraform output?
I’m using the Terraform to climb my below in the Linode, everything goes very well, however, I am not able to format the output the way you would like it. My Output Variables is like this: output…
terraformasked Fábio Jânio 3,407 -
0
votes1
answer66
viewsA: How to synchronize script execution with asynchronous batch operation?
I was able to reach a satisfactory solution using Promise.allSettled (suggestion from @Luiz Felipe). Abstraction of the solution: // ... await Promise.allSettled(promises).then((results) => { //…
node.jsanswered Fábio Jânio 3,407 -
1
votes1
answer66
viewsQ: How to synchronize script execution with asynchronous batch operation?
To illustrate the problem let’s go to a real scenario: I have to access something close to 450 directories shared in network to get the metadata of a given file, this data will be later compared…
node.jsasked Fábio Jânio 3,407 -
2
votes1
answer4302
viewsQ: How to perform data validation using Yup with custom locale?
I’m trying to add input data validation to a small script I built using Express, the validation part is using Yup. I’m having a hard time organizing things because of the need to work with a custom…
-
1
votes1
answer55
viewsQ: How to indicate that a variable is an Express object using Javascript Docs?
I’m using the consign to automatically include routes in an application built with Express. In a given file I have the route: module.exports = app => { app.post('/users', (req, res) => { //...…
-
2
votes1
answer339
viewsQ: Does the Eslint option of "enforce code style" add any behavior when we are already using Prettier?
When we perform eslint --init, we first come across the following question: I performed two tests, one selecting "To check syntax and find problems" and other using "To check syntax, find problems,…
-
2
votes1
answer82
viewsQ: How to find, retrieve and delete a certain value in a multiline string in Javascript?
I need to locate a value (has defined default) in a text, recover it and then delete the record. const content = `Exemplo de texto: Lorem Ipsum is simply dummy text of the printing and typesetting…
-
0
votes1
answer89
viewsQ: How to view recorded records in Core Data?
I’m developing a small app on Swift for Macos, Everything was fine until you got to Core Data. I was able to record and recover data, it’s okay that it wasn’t as good as I wanted, but since it’s the…
-
0
votes0
answers23
viewsQ: How to safely store sensitive data collections in a mobile app?
In order to illustrate my doubt more clearly, think that I want to produce an app based on the primary goal achieved by Keypass or 1Password, that is, store sensitive data securely. My goal is to…
node.jsasked Fábio Jânio 3,407 -
1
votes2
answers631
viewsQ: How to verify the occurrence of a given string and return part of it?
I have a small solution developed on the Node.js platform, at the moment I need to check if a given string exists, if it exists it will be necessary to capture the value INTEIRO contained in this.…
-
1
votes2
answers81
viewsA: Is it correct to mix JSON format with Mysql?
In the case presented above you are using a Mysql database, that is, this is where you are persisting your application data. JSON, on the other hand, is a data structure that you are using to…
-
0
votes1
answer28
viewsA: How to use a method without having to import it directly into the file that invokes it?
I was able to find a solution to the problem by presenting. The structure was more or less like this: I created the settings file in /config/app.js: /** * Centraliza as configurações essenciais do…
-
0
votes1
answer28
viewsQ: How to use a method without having to import it directly into the file that invokes it?
In one of my files I have the following content: function env(param, defaultValue) { return process.env[param] || defaultValue; } module.exports = { title: env('TITLE', 'valor padrao'), url:…
-
1
votes1
answer349
viewsQ: How to use helpers in Node.js to load settings?
In the Laravel Framework we have the configuration files centralized in the directory /config, these are simple files php returning a array key and value. To access these settings anywhere in the…
node.jsasked Fábio Jânio 3,407 -
3
votes1
answer4074
viewsQ: What does Expressjs urlencoded mean in practice?
Analyzing a code built on the Nodejs platform, I came across the instruction express.urlencoded({ extended: false }), to try to understand it, I ended up using the Expressjs documentation, however I…
-
1
votes2
answers64
viewsA: How to parse a string with double space separator on the left of a character?
Regex was never my strong suit, but after researching several examples, I came up with a possible solution: preg_split('/\s\s+/', $string_aqui); In the initial tests it worked.…
phpanswered Fábio Jânio 3,407 -
2
votes2
answers64
viewsQ: How to parse a string with double space separator on the left of a character?
I’m having a hard time parsing a string to turn it into an associative array. For example, see an example of the string cited: Titulo Valor Desc item1 10 Descrição aqui novo aqui AB Mensagem Label…
phpasked Fábio Jânio 3,407 -
1
votes0
answers7
viewsQ: How to perform an efficient error treatment in Fluent interfaces?
I went up in Gibhub the repository Siebel-server-manager, my proposal is to create a simple and objective wrapper that abstracts some tasks performed via CMD (Microsoft Windows Command Prompt). In…
phpasked Fábio Jânio 3,407 -
0
votes2
answers276
viewsQ: Doubts about the import and overall use of Axios in Vuejs
I am using Axios in one of my projects with Vuejs, my doubt is directly linked to the global import form of the plugin. Currently I’m doing so: Create a /plugin/Axios.js file with this code: import…
-
0
votes0
answers25
viewsQ: Popper not found when using vuejs in Laravel
In one of my projects Laravel (5.8) I am using Vuejs, basically only created some components, I did not make any changes in the default configuration of Vue. But I’m getting the bug: Failed to load…
vue.jsasked Fábio Jânio 3,407 -
2
votes2
answers668
viewsQ: How to use filters in vuejs for data collections?
I’m having trouble filtering the data to be displayed in a select html. How can I apply a filter that based on a variable (which will be populated by another select) returns all.name items that…
-
0
votes1
answer54
viewsQ: How to calculate the total value considering a given attribute as increment or decrement parameter?
I have a spreadsheet in excel where purchase shares (C) and sale (V) are recorded in the same column, already in another column I have the traded values. Example: Ação | Valores ---------------- C |…
excelasked Fábio Jânio 3,407 -
1
votes1
answer329
viewsQ: How to turn an Eloquent Collection into a simple array?
I am making a consultation to the bank and is being returned a Collection... How do I stop instead of having to call $role->role to get the column value, get the same behavior by calling only…
laravelasked Fábio Jânio 3,407 -
1
votes0
answers248
viewsQ: How to create a multi-level menu with Adminlte Menu Runtime in Laravel?
I joined the jeroennoten/Laravel-Adminlte to a project Laravel 5.7, however, I’m having difficulty generating a menu with multiple levels. According to the reference in the project repository…
-
2
votes2
answers210
viewsQ: How to change the file extension recursively in GNU/Linux?
I’m trying to get all the files .sql of my project and change the extension to .md. I’ve been able to do this, however, the files are being moved to the system root, which is the path where the…
-
0
votes0
answers175
viewsQ: How can Ionic Devapp be able to list applications on the network?
I’m running an Ionic facility inside a Docker container. I released the necessary ports in the container, so much so that I can access the application by mobile from Ionic Devapp, just inform IP and…
-
-1
votes2
answers378
viewsQ: Why is it necessary to raise ng in 0.0.0.0?
I installed the Angular inside a Docker container (fabiojanio/Ionic), however, I am only able to access the application when I start the server in this way: ng serve --host 0.0.0.0 I would like to…
-
0
votes1
answer118
viewsA: How to work with the 'Camera' plugin to allow image upload when in a browser?
I managed to solve, it does not seem to be the best alternative, but it is working. The magic occurs basically within the method processWebImage. See the full js: import { Component, ViewChild }…
-
0
votes1
answer118
viewsQ: How to work with the 'Camera' plugin to allow image upload when in a browser?
I’m trying to implement a feature that allows me when in the browser, upload images, already on a mobile device, I will have the options to take a photo or choose an image from the gallery. Taking a…
-
0
votes1
answer93
viewsA: How to reuse snippets of code in Typescript in Ionic 3
I managed to solve part of what I wanted with this: import { Component } from '@angular/core'; import { AlertController, ItemSliding } from 'ionic-angular'; @Component({}) export class…
-
0
votes1
answer93
viewsQ: How to reuse snippets of code in Typescript in Ionic 3
On one of my pages, when the user clicks the button Delete an Alert is displayed requesting confirmation. This action exists on more than one page, to avoid duplicating code, how can I reuse the…
-
0
votes1
answer86
viewsQ: How to parse from one object list to another?
I have a list of tasks stored in an object items, I want to parse this list so that, anything with status open is stored in the variable openTasks and everything with status completed is storing in…
-
2
votes1
answer62
viewsQ: What is the default visibility of a variable in Typescript, what is the importance of var when declaring variables?
When declaring a variable, when we omit the visibility parameter (public, private and protected) the variable is created by default in which visibility? export class AddEditTaskPage { idade: number;…
-
2
votes1
answer54
viewsA: How to use auto-Reload (browserSync) on Ionic server when in a Docker container?
I found that everything was right when using the image: https://hub.docker.com/r/fabiojanio/php-apache-nodejs/ Just release the live Load port, which are: 35729…
-
2
votes1
answer54
viewsQ: How to use auto-Reload (browserSync) on Ionic server when in a Docker container?
I performed the installation of the ionic 3.20 in a container Docker. Everything works perfectly, but I’m having a hard time using the auto-refresh, when changing a file the content is not…
-
2
votes1
answer99
viewsQ: How do I work with github when A2F is enabled?
By enabling two-factor authentication on Github I am required to work with RSA key to update repositories? When A2F (Authentication Two-Factor) is active unique code is requested, I imagine Git…
-
5
votes4
answers25119
viewsQ: How to discard all commited changes?
How to discard all commited changes? Example: I have a project that has a few dozen commits, assuming that at a given moment I decide to discard everything which has not yet been confirmed via…
gitasked Fábio Jânio 3,407 -
4
votes1
answer66
viewsQ: Can any project be suited to the principles preached by SOLID? What are the steps to this?
I am trying to adapt one of my projects to the standards of SOLID, but I’m not getting out of ground zero. The project in question can be found at: https://github.com/crphp/webservice After some…
-
1
votes1
answer305
viewsQ: How to extract a chunk of an xml using PHP?
How can I capture/return everything between tags <*:Body> and </*:Body> using PHP, so that it doesn’t matter how many lines there are before or after both tags? <?xml version="1.0"…
-
0
votes1
answer724
viewsA: Error trying to perform Soap request with Soapclient
I identified the cause of the error. After analyzing the code more calmly I arrived at the method Consult (namespace: Crphp Webservice Soap), precisely in this excerpt:…
-
0
votes1
answer724
viewsQ: Error trying to perform Soap request with Soapclient
I’m having trouble making requests to a webservice using the Soapclient (PHP library). This is the message returned: SOAP-ERROR: Encoding: Object has in the 'Client' Property. Any idea what it might…
-
3
votes2
answers4008
viewsQ: Doubt about the structure of a use case
I have the following use case: I have three doubts, it’s them: Registering is a suitable name? In the above case it is correct to have the CRUD element? Manage user should be Keep user? This include…
-
0
votes2
answers1088
viewsA: How to work efficiently with branch in git?
Come on, since many of the doubts kept hammering in my head, I decided to study the subject a little but in depth. Considering the knowledge acquired, I will try to answer the questions that…
-
1
votes1
answer373
viewsA: How does the final git-flow (release) flow work?
After performing some tests I was able to define that this is it. When a git flow release finish <identificador da release> is executed, some of the actions fired are: Execute a merge --no-ff…
-
0
votes1
answer373
viewsQ: How does the final git-flow (release) flow work?
Briefly (consider using git-flow): I created a repository, managed my Feature, created a release, finished this release, consulted the log of the develop branch and had as output: commit…
-
1
votes0
answers68
viewsQ: How to destroy all sessions of a user, save the current session?
How can I at once log out of all other sessions of a user, preserving only the current session? I aim to apply this behavior when resetting the user password. By default Laravel keeps old sessions…
laravelasked Fábio Jânio 3,407