teleren/devto huggingface dataset:
Installing XDebug3 in VSCode
Tags: php, vscode, xdebug, docker
Published: 2022-08-17 18:49:12

Debug the code depending on how the code is, it's often torture, imagine arriving in a new environment without knowing anything about the project and having to identify where each endpoint passes to return the information.

To help in this process we can use debug, for this post I will show how to install `xdebug` and use it together with vscode.

## Installing XDebug

The first thing to do is install xdebug 
if you use linux just use the command:

```shell
sudo apt-get install php7.4-xdebug
```

_💡Change php to the version you want_

if you use a different version of operating system, visit the official website for a better installation

https://xdebug.org/docs/install

### Activating xdebug

After XDebug is downloaded and installed, you'll have to register and enable the extension in your `php.ini`. For this, open the file and at the end add the following lines:

```php
[xdebug]
zend_extension=xdebug
xdebug.mode=debug
```

_💡 Remember to restart your web server after applying these changes._

## VSCode

Now that everything is ready, we just need to show vscode how to use xdebug, and for that we have an extension ready, just install it

https://marketplace.visualstudio.com/items?itemName=xdebug.php-debug

### VSCode config

After installation you can click on the sidebar on `"Run and Debug"` and when you press start the configuration file will be created automatically in `.vscode/launch.json`

If you're having trouble, this is the file:

{% gist https://gist.github.com/walternascimentobarroso/853ca336362101b6f3e6d5bae51ff0ce %}


in this file we have two settings one for you to use when using the browser and the second one is to directly execute a file (as if using the command line)

## Extras 

## Docker 

To use in docker you need to follow a few more points you will follow the same process, but when you configure the file in php.ini, you need to add two more lines:

```shell
xdebug.start_with_request=yes
xdebug.client_host=host.docker.internal
```

_💡 NOTE: For see all files for php use `php --ini` ._

For a more complete version follow a makefile:

{% gist https://gist.github.com/walternascimentobarroso/08109a16abf5938c34a2bb7efe3e126b %}

and finally modify your `launch.json`, just add and change `pathmappings`

```shell
"configurations": [{
    ...,
    "pathMappings": {
        "remote/path/to/webroot/": "${workspaceFolder}",
    }
}]
```

Example:

{% gist https://gist.github.com/walternascimentobarroso/96547c061aa205de4434e11accdb5627 %}

***

## Thanks for reading!
If you have any questions, complaints or tips, you can leave them here in the comments. I will be happy to answer!

😊😊 See you! 😊😊

***

## Support Me
[Youtube - WalterNascimentoBarroso](https://www.youtube.com/channel/UCXm0xRtDRrdnvkW24WmkBqA)
[Github - WalterNascimentoBarroso](https://github.com/walternascimentobarroso)
[Codepen - WalterNascimentoBarroso](https://codepen.io)
Postman editor's pick - EthicalCheck.dev (free API security testing)
Tags: api, testing, security, programming
Published: 2022-08-17 18:41:00

[Ethicalcheck.dev](url) - is a free & instant API security testing web tool. 

It offers web UI, GitHub Action, and an API for developers to automate REST API security testing.

It addresses the critical need to find vulnerabilities earlier in dev cycles rather than reacting to breaches/data leaks.

Test your public-facing REST APIs for data leaks and OWASP vulnerabilities.

Here is our blog on Postman that got showcased as Editor's pick.
https://blog.postman.com/postman-and-apisec-ethicalcheck-integration-better-security-practices/

Thanks everyone for supporting and trying the webtool. Here is the link: [EthicalCheck.dev](ethicalcheck.dev)
Single Page Site Navigation
Tags: codepen, javascript, beginners, webdev
Published: 2022-08-17 18:31:56

This is a website that uses only one HTML page. When all website content is placed on one page, click on a navigation link forwards users to an HTML anchor on this single page.

TO LEARN HOW TO IMPLEMENT THIS, PLEASE REFFER TO THE LINK BELOW;

{% codepen https://codepen.io/dovineowuor/pen/jOzXbxQ %}
Where does self doubt come from? More importantly, what to do about it?
Tags: discuss, programming
Published: 2022-08-17 18:31:00

I just recently saw a [post](https://dev.to/sloan/what-is-your-greatest-weakness-as-a-software-developer-3i8h) asking anonymously "What is your greatest weakness as a software developer?".

### I replied with "self doubt". 

I have studied coding for over 20 years, and I still doubt myself all the time. Why?

I think if I look deep down, it was due to all the late hours, hard work and negative comments that my earlier jobs brought me. 

They still echo around in my head even though I've been in better careers for years now. 

Or maybe it's my own internal voice fighting me or a number of other factors. 

What ever it is, it's here. So I might as well work on it and try my best to do away with it. 

## How? 

Well, I meditate for one thing. I try to remind myself that I'm human and self doubt will come and go. It's just a feeling/thought, which can change.

So I choose to surround myself with positivity. I practice self care and remind myself of my accomplishments. 

I focus on the good things I've done and I just work to improve on the things I'm not great at. 

I try to be honest with what those are and face them instead of running away.

Speaking of running away, I don't do that if at all possible. I try not to avoid the hard tasks because they seem scary. 

That is a quick sure way to get lots of self doubt, by assuming you can't before you even started.

Most of the things in my career that I was terrified to face, ended up being a fluffy marshmellow compared to the dragon I thought I was facing. 

I have other tools as well but really it's just a mental game. Fill your life with positive things. Think positive.

If you can't think positive, you may be facing some sort of mental health issue, which is perfectly normal. I myself am I meds.

I needed a little extra to get my chemicals balanced out, mix it with the other work I put into myself and most days have the self doubt at bay...

Thanks for taking the time to read my thoughts on the subject.

Questions? Comments? Have some useful tips? Leave a comment. 

- DeChamp

---

Check out some of my other posts.

- [Get Dev.to posts on your personal site, with ease!
](https://dev.to/dechamp/how-to-quickly-get-devto-post-on-your-site-5cgo)
- [Come and look at my new site! Tell me what you think.
](https://dev.to/dechamp/i-finally-have-a-personal-site-mostly-1l7j)
Are you sure your backups work?
Tags: discuss, security
Published: 2022-08-17 17:58:00

As hopefully everyone, I have backups of all my data. After initial setup, I usually forget about it until something breaks, and I need to restore my data. This post is just a reminder: **please check if you can restore your data.** 

## But if you want to know my setup
I settled with [kopia.io](https://kopia.io/). It has a nice graphical (and terminal) interface, support for cloud and local storage, encryption, compression and as for now: it just works.
Before that, I used:
- Duplicati: buggy, my backups broke after few months (problem with cloud connection)
- Restic: no compression is a dealbreaker for me, as this increases storage costs in a cloud like Backblaze B2
Necesito Ayuda, REACT, por favor.
Published: 2022-08-17 17:52:00

(https://www.youtube.com/watch?v=ZfqnUm7w6ig&t=4920s)
Hola, soy principiante enéste mundo de programación, me encontré un tutorial en Youtube... no pude avanzar después de 1:19:00... allí me atasqué, me dice error en vsc... quiero terminar ése tutorial y el autor no responde ninguna pregunta desde hace 5 meses. Quien pueda ayudarmew, se lo agradezco muchísimo.

https://www.youtube.com/watch?v=ZfqnUm7w6ig&t=4764s

Gaby Zapata
🏁 Getting Started with SQL
Published: 2022-08-17 17:05:44


### :heavy_check_mark: Installing PostgreSQL

First, update the system software packages using the following command:
</br>

```bash
sudo apt update
```
</br>

and install the latest version of PostgreSQL from the default repositories.
</br>

```bash
sudo apt install postgresql
```
</br>

After intallation, you can confirm that PostgreSQL service is ative, running, enabled or ready to accept connections from clients using the following commands
</br>

```bash
sudo systemctl is-active postgresql  

sudo systemctl is-enabled postgresql 

sudo systemctl status postgresql 

sudo pg_isready
```
</br>

### :heavy_check_mark: Installing pgAdmin

[pgAdmin](https://www.pgadmin.org/) is a management tool for PostgreSQL, but it's not available in the Ubuntu repositories, so we need to install it from the pgAdmin4 APT repository, add the public key and create the repository configuration file.
</br>

```bash
curl https://www.pgadmin.org/static/packages_pgadmin_org.pub

sudo apt-key add

sudo sh -c 'echo "deb https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/$(lsb_release -cs) pgadmin4 main" > /etc/apt/sources.list.d/pgadmin4.list && apt update'
```
</br>


Then install,
</br>

```bash
sudo apt install pgadmin4
```
</br>

### :heavy_check_mark: Installing NodeJs and node-postgres
`node-postgres` is a collection of node.js modules for interfacing with your PostgreSQL database
</br>

```bash
sudo apt install nodejs
 
sudo apt install npm  

npm install pg
```

</br>


# 🔌 Connecting NodeJs with PostgreSQL 
</br>

```javascript
const { Pool } = require('pg');

const pool = new Pool({
    user: 'lessa',
    password: '88eb9394',
    host: '/var/run/postgresql',
    port: 5432,
    database: 'service_management',
});

pool.on('error', (err, client) => {
    console.error('Unexpected error on idle client', err)
    process.exit(-1)
})

const startDatabase = (req, res, query, values) => {
    pool.connect()
        .then(client => {
            return client.query(query, values)
                .then(result => {
                    client.release();
                    res.status(200).send(result.rows)
                })
                .catch(err => {
                    client.release();
                    res.sendStatus(500);
    
                })
        })
}

```

</br>

🔻 <strong>Exemple</strong> of data manipulation using `pg`
```javascript
const getCustomer = (req, res) => {
    const customer = [req.params.name];
    let query = 'SELECT * FROM customer WHERE deleted_date IS NULL'

    if (customer) {
        query += " AND name LIKE '%'||$1||'%'"
    }

    startDatabase(req, res, query, customer)
}
```

</br>


</br>


*******
Replace empty string to undefined value in Object (JS)
Tags: javascript, webdev, programming, typescript
Published: 2022-08-17 17:48:54

just create function like:

```javascript
 const replaceEmpty = (obj) => {
    let newObj = {};
    Object.keys(obj).forEach((key) => {
      if (obj[key] === Object(obj[key])) newObj[key] = removeEmpty(obj[key]);
      else if (obj[key] !== undefined) newObj[key] = obj[key];
      else if (obj[key] === undefined) newObj[key] = '';
    });
    return newObj;
  };
```

that's all, hope this func can help U 😵‍💫
Stay ahead on privacy with temporary E-mail
Tags: privacy
Published: 2022-08-17 17:46:00

Temporary email is a service which provides disposable temporary email addresses which delete itself after a certain time. Many websites and forums on the internet ask for your email addresses in exchange for visiting their page or to download files. These websites may or may not be a secure enough website, where they might trade your email with companies for their own profit. 
          Most insecure websites are always victims of data breaches and when you provide your personal/business email in an insecure website, your email can be an easy  target for hackers. Some websites even store your password in clear text, which when many of us reuse our passwords, makes our mail vulnerable to hackers.
         The best way to prevent this is to use a temporary email address. By using a  temporary email address, you are secure, anonymous, spam-free and you can also  keep the inbox of your real email clean. I personally use, “temp-mail.org” for temporary  email service. So next time a website asks for your email address, try using a temporary  mail id and you will see less spam emails in your spam box.

PRO TIP
         Use temporary email addresses on websites which provide free trials or limited  access per day. When your trial or a specific day’s access time has expired, you can log  out and sign in again with another temporary email address and prolong the access you  have to the websites. I use this on, “pngtree”, which is a website where you can  download png images. Only a premium member can download unlimited png images,  where for a free user, it’s only two images per day. I can download unlimited by using  temporary email addresses. You can also use this on, “TunnelBear” and get good VPN  service for free. 

[Tempmail](https://temp-mail.org/en/)
Why should you consider adding Rust to your stack?
Tags: javascript, rust, productivity, programming
Published: 2022-08-17 17:45:30

Rust is a high-level language with low-level performance, which brings us to our first ready:

## Performance

Unlike languages like C or C++, developing in rust is extremely fast and particularly satisfying, with the compiler extremely efficient in pointing out problems in the code, it becomes your friend and not your enemy (As I particularly felt developing applications in C around mid-2012 ).
It's a memory-safe language, forget the problems with null pointers and etc, garbage collector doesn't exist here because of the Ownership strategy.
Everything in the language is aimed at giving you the necessary possibilities to create the most performative systems possible with the practicality of interpreted languages like JS

## Expand your technical vision

The market demands more and more speed of delivery from developers and languages ​​like JS/TS help us a lot at this point, it has gigantic communities and many ready-made solutions, which hardly a JS developer will worry about concurrency problems, thread starving, efficiency in memory allocation, etc.
Each technology has its place and will better serve different situations, in terms of productivity, JS/TS is undoubtedly the best possible solution, depending on the needs of the system, it guarantees a fast and concise delivery, the problem starts when we tend to use the same technology for EVERYTHING.
Chances are, if you decide to learn RUST, you won't use it on your entire system, but rather create services to meet very specific demands that require extraordinary performance and security (You can even do everything in Rust, but as I said, each technology has its place and it would not be smart to do so in most situations).
I will exemplify with my work case, my company builds systems for financial solutions, in the case of a brokerage firm, 80% of the system is CRUDs, and for these 80% nothing better than a super productive language, but the 20% that is the order book used in trading and user balance control where atomicity and performance have to be guaranteed, that's where Rust shines, it gives you options that in the comfort of working so long with interpreted languages, you end up forgetting that exist, it brings you closer to the most basic fundamentals of building a computational system, giving you possibilities and a security that no other interpreted language will provide you.

## Opportunities
The Rust ecosystem is infinitely smaller compared to JS/TS, although I've been a language lover since 2019, I'm just now feeling full security in bringing it to my company's stack, as it's getting more and more mature, but far from being extremely comprehensive, this means a fertile environment for growth opportunities, the reasons mentioned above make Rust a very desired language, but there is a great shortage of professionals and tools to help development.
RuntDeale's taking off!
Tags: runtdeale, rust, bevy, gamedev
Published: 2022-08-17 17:38:00

[RuntDeale](https://github.com/CalinZBaenen/RuntDeale) is now ready for lift-off in development!
I've found the perfect engine! [Bevy](https://bevyengine.org/)!
It's a very competently written engine in an extremely well-composed language, Rustlang.

Here is what I have so far. A single image being drawn to the screen. (It's part of a spritesheet, which I will be utilizing more of from now on.)
![Screenshot of RuntDeale test.](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mdmutlx6kb87hu0kixz8.png)

Seriously, give the creator of Bevy, Carter, some love!
[@cart_cart](https://twitter.com/cart_cart) on Twitter and [u/_cart](https://www.reddit.com/user/_cart/) on Reddit.
Bevy also has a [Discord guild](https://discord.com/invite/bevy)!

<center><h2><b>Thanks for peering at my article!<br/>Cheers!</b></h2></center>
Typescript Series - Tuple to Object
Tags: javascript, webdev, tutorial, typescript
Published: 2022-08-17 17:38:00

I'd like to start by saying that I am doing this series to learn and understand better Typescript, so feel free to correct me or contact me.

### What it a tuple?
tuple types allow you to express an array with a fixed number of elements whose types are **known**, but need not be the same. For example, you may want to represent a value as a pair of a string and a number:

```
// Declare a tuple type
let x: [string, number];
// Initialize it
x = ["hello", 10]; // OK
// Initialize it incorrectly
x = [10, "hello"]; // Error
// Type 'number' is not assignable to type 'string'.
// Type 'string' is not assignable to type 'number'.
```

Now that we know what a tuple is, let's see what do we mean by Tuple to object.

```
const tuple = [1, '2', 3, '4'] as const
  
type result = TupleToObject<typeof tuple> 
// expected { 1: 1; '2': '2'; 3: 3; '4': '4' }
  
```
So let's see that magic in action.

```
type TupleToObject<Type extends readonly any[]> = {
  [Key in Type[number]]: Key
}
```
Time to break that sucker down.


`TupleToObject<Type extends readonly any[]>` In a nutshell you can read this as, Type extends an array of any type that its length won't change, remember for tuples we do know it's length, that is why we define the tuple variable `as const` so we cant modify it. 
```const tuple = [1, '2', 3, '4'] as const```
and we pass its array type right here in the params `TupleToObject<typeof tuple>`


`[Key in Type[number]]: Key` Here we extract the value of Key from the value at the position of the current index of the array (1, '2', 3, ...).

Note: More than its uses it helped me understand a lot of tuples, arrays and objects work, maybe it will help you too! 


Thank you!

you can find me here [My Twitter] (https://twitter.com/sarmunbustillo?t=pztqXmT7DH2pa9lDLjfrdQ&s=09)
Circuit Simulator Java
Tags: circuitsimulatorjava, circuitpython, circuit, simulator
Published: 2022-08-17 17:09:59

Circuit Simulator Java is an assignment which is designed to give you some experience in C programming. And also increasing your understanding of circuits.

You will be writing a C program to simulate the output of combinational circuits.



![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6wlxq6bf2yav44fo6paa.png)

Download the Code here https://hecodesit.com/circuit-simulator-java/
UK Global Talent Visa Requirements
Published: 2022-08-17 17:03:00

Global Talent Visa is easier to get than you might think. 

If you want to move to the United Kingdom, watch this video to learn about Global Talent Visa requirements for software engineers:

{% embed https://youtu.be/ks8SKnbMY8Q %}

Get the UK Global Talent Visa: https://beetlehope.com/talent/
First of all let me introduce myself.
Tags: webdev, programming, introducemyself
Published: 2022-08-17 16:34:00

Hello everyone, I'm Pedro Correia I'm a Software Engineer at ABB, I have 6 years of experience and all the time always working with Microsoft Technologies, like .net MVC, .net core, azure DevOps, but I have some pieces of knowledge with angular and reactjs. Currently, I've been working with a Poland team, I had never ever worked with a foreign team, and they are a great team, but I'm working from Brazil. In my free time, I like to play video games, play soccer(I support Palmeiras), and sometimes play skateboarding, I really like to go to the bar, luckily where I live there are many options for bars and parties. If you already visited São Paulo Capital, you know what I'm saying. The purpose of this blog is to practice and improve my English, and to write about my studies, so the main posts of this blog will be tech, but sometimes I can write about my passions as well.
![me](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c6z4y8duigsuitqjhq3w.jpg)

See you later.
CSS Concepts to Boost Your Productivity
Tags: beginners, css, productivity, webdev
Published: 2022-08-17 16:31:36

Even frontend developers avoid CSS like the plague.

There's no feedback when you make mistakes which can be frustrating. But, it doesn't have to be that way. It turns out that CSS is consistent and predictable.

Learning these 3 things can help you write more effective CSS:

## The Box Model
Everything in CSS has a box around it.

**Going from the inside out, there's:**

- Content
- Padding
- Border
- Margin
Targeting the correct property is essential when sizing elements.

## Flexbox
Getting layouts right is critical.

**Flexbox can help you:**

- Create a horizontal or vertical container
- Position child items predictably
- Control the size of those child items
- Recreate many layouts by nesting flexbox containers in different directions

## Stacking Contexts
z-index problems are the worst. Pick a bigger number and hope it works!

But what about the next time you have a z-index problem? Increase the number again? Here's how stacking contexts can help:

Child elements within a stacking context are bound by that context
Two stacking contexts will be layered relative to each other
Use the isolation: isolate css property to create a stacking context anywhere
Mastering the 3 tools above is a quick way to start writing better CSS.