teleren/devto huggingface dataset:
Claves para una aplicación web en la nube
Published: 2021-11-15 17:45:33

**Claves para una aplicación web en la nube**

**no trabajar con datos en local**

La elasticidad implica la creación y destrucción de máquinas/instancias de manera dinámica. Por tanto, hay que tener presente que los datos de un servidor serán destruidos cuando se pare. Nuestra aplicación web en la nube tiene que estar preparada para tal eventualidad. Por ejemplo, si nuestra aplicación permite a los usuarios subir ficheros para que luego éstos sean consultados por el resto de usuarios, no podremos ubicarlos en un directorio local del servidor que atienda la petición.

Los diferentes proveedores nos ofrecen soluciones donde alojar nuestros ficheros para poder ser accedidos por las diferentes instancias de nuestra aplicación e incluso, en caso necesario, otros servicios.

Un ejemplo sería Elastic File System de AWS o File Storage de Azure.

**No usar datos en sesión de usuario en el servidor**

Los datos de sesión son información útil de cada usuario que se pueden guardar en el servidor. Habitualmente, son necesarios para un correcto funcionamiento de la aplicación. Estamos en la misma situación que el punto anterior. Para que nuestra aplicación web en la nube pueda beneficiarse de la elasticidad necesitamos dejar de depender del entorno en el cual se está ejecutando nuestra aplicación. Por tanto, requerimos de algún servicio que permita almacenar esta información y pueda ser accesible de manera rápida.

Para gestionar estas situaciones, los entornos Cloud nos ofrecen soluciones de base de datos de memoria como ElastiCache en AWS o Azure Redis Cache en Azure.

**Utilizar cache para el contenido estático**

El uso de cache hace que nuestra aplicación se libere de gestionar aquellas peticiones en las que el contenido no se modifica (p.e. una imagen). Si a esto le sumamos que dicha respuesta se ofrece desde diferentes partes del mundo en función de la situación geográfica del origen, se mejora la velocidad y  se reduce el consumo de recursos en nuestros servidores. No obstante, la aplicación web en la nube tiene que ser consciente de este hecho para poder gestionar estas peticiones y controlar cuando tiene, o no, que actualizar un contenido.

Servicios como Cloud Front de AWS o Content Delivery Network de Azure están diseñados con este propósito.

**Desplegar nuevas funcionalidades sin pérdida de servicio**

El último punto que, en nuestra opinión, una aplicación web en la nube debe cumplir, es realizar despliegues sin pérdida de servicio. Después, realizar pruebas con un entorno idéntico al productivo y garantizar, en caso de problemas, la vuelta a la versión anterior. Esto debería hacerse de manera rápida y transparente para los usuarios.

Diseñar y construir este tipo de procesos puede resultar complicado, ya que requiere de amplios conocimientos de infraestructura, así de como de la tecnología utilizada por cada proveedor. Solo los podremos implementar con éxito si establecemos sistemas automatizados de control de cambios, despliegue, y gestión de la infraestructura.
Validation, validation, validation
Tags: javascript, tutorial, html, webdev
Published: 2021-11-15 17:30:58

The first part was about the new controls HTML5 offers.
Another important requirement for forms is validation. 

## What is validation anyway?

Validation is used to check the validity of user data before further processing. Here, a distinction can be made between validation on the client side and validation on the server side.

Only the validation on the server is decisive for further processing. User data must never be trusted, even if the client performs a validation. **Never ever! No, never!**

Validation on the client is exclusively for quick user feedback.

## Client-side validation

Browsers now offers a large number of ready-made checks.

The simplest check is the mandatory field. This can be defined by the HTML `required` attribute.

```html
<input type="text" required="required">
```

![required](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dk074ynf9zyc9wziidj4.png)

The nice thing is that the browser and the operating system does all the work. Also, the controls and messages match the system UI.
 
Perhaps the most powerful check is the pattern Attributes.
Here you have the possibility to check your entries quite freely.

The following defines a mandatory field that allows a minimum of 4 and a maximum of lowercase letters.

```html
<input type="text" 
       required
       pattern="[a-z]{4,8}" 
       title="4 to 8 lowercase letters">
```

## Server

Besides the fact that user data should never be trusted, client-side testing holds other challenges.

For example, inconsistencies between the client and server validations can confuse the user. In the worst case, the validations prevent input.

For example, a form would not work if the client only allowed lowercase letters and the API only allowed uppercase letters.

Such obvious errors are likely to be noticed quickly, but there are also minor discrepancies that are then difficult to detect and frustrate the user and the developer.

_By the way, here applies as always: test, test, test._

## References

- [trust no one](https://dev.to/volker_schukai/trust-no-one-1j6n)
- [developer.mozilla.org/en-US/docs/Web/HTML/Attributes/required](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/required)
- [developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern)
* [we are hiring](https://about.schukai.com/de/jobs/)
Php Value in Upcoming Era
Published: 2021-11-15 17:29:49

We are living in the era of php. So many websites are built on this language. PHP is the most relied-upon language to run any website because it offers a number of benefits that other languages can't give, such as its easy-to-use coding style and flexibility. It has become one of the most popular web programming languages used by developers worldwide, with over 650 million websites using it at present.

Stay Tuned More to Come in Upcoming Days... 
Stay Connected to Unionwell Germany: https://www.deepmaterialar.com/
My first Hacktoberfest participation
Tags: contributorswanted, hactoberfest, github, 2021
Published: 2021-11-15 17:27:27

This was my first participation in Hacktoberfest, I liked it a lot and I was also apprehensive because I wouldn't complete it, many of the repositories I participated in were canceled making it difficult to complete, from 20 repositories only 5 were considered accepted.
How mastering your tools can make or break you as a dev
Tags: webdev, beginners, productivity, javascript
Published: 2021-11-15 17:06:37

I was working on my first offer on how to make your first contribution to open source.

But then...I realized that a huge blocker in devs with experience across the board is not mastering their tools

And...if you cant use the command line, you probably wont be able to make your first contribution to open source.

When Im talking about tools, I am talking about the tools we use on a daily basis to get our job done.

Like.....

...using the command line

...using git

....using our text editor

....etc etc

Now, why is this so important?

Glad you asked ;)

Being a developer is so mentally intense your tools need to be second nature.

Like a brush to an artist, or a sword to a samurai.

If youre struggling with your tools you cannot free your mind to solve the hard problems that exist in engineering.

So...

With all that being said...I thought it would be valuable to put together a quick resource on Mastering the Command Line in Under 30 Minutes.

I put the commands in there that I use most often on a daily basis to help you learn almost all of the commands you need to be a working developer or engineer.

Mastering the command line is E-SSENTIAL to being a developer. I probably spend most of my time in the terminal.

I see new developers scared to dive in to the world of the command line...

But I promise....its simple as long as you know what youre supposed to do and it will make your life as a developer so much easier.

Comment below if this is something you would be interested in :)

### If you want more:

 - **Come join our Facebook group to help you get your first job as a software engineer, career development, and so much more!**

https://www.facebook.com/groups/310120400851953

 - **Here is a [link](https://engjobresources.carrd.co/) to get my top 10 interview resources for FREE**
Customizing your macOS Terminal
Tags: macos, terminal, customterminal
Published: 2021-11-15 16:59:10

---
title: Customizing your macOS Terminal
published: true
description: How to edit the Terminal Prompt name on macOS
tags: #macOS #Terminal #CustomTerminal
//cover_image: https://direct_url_to_image.jpg
---

As a developer or DevOp, you're likely to spend a lot of time in the Terminal, and you've probably already customized its appearance to suit you, but what about the prompt name?

The text that appears before the $ sign is the Terminal prompt name. This, by default is set to.

> HOST_NAME:USER_NAME CURRENT_DIRECTORY $

![Example](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ey6yjtp909e911fye4u6.png)

This can take up a lot of valuable real-estate on each line of the Terminal, depending on what you've named your computer. To change the default prompt, you'll need to make a change to your `.bash_profile` file.

Open up a new Terminal window and type the following command to ensure we're in the home directory

> cd ~/

Type `ls -la` to show the contents of your Home directory and check if a `.bash_profile` exists.

If it does not exists, go ahead and create one with the command

> touch .bash_profile

## Changing your Terminal prompt
Edit '.bash_profile' with your default or favourite text editor, in my case it's Vim, with the following command

> vi .bash_profile

press `i` (insert) and enter the following line 

> export PS1="\u$ "

and save by tapping `esc` key and type in `:wq`,(FYI: this is specific to the Vim editor). The `\u` flag sets the prompt to your username (in my case, Abayomi). Remember to keep a space after the `$` symbol to make things easier to read in practice.

Quit Terminal and relaunch to see your new prompt in action.

## A little extra
A little extra customization, my line looks like the following 

> export PS1="\u ~ >> "

and I ended uo with the following prompt

![Example](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/beywn0ss3ppug3a3e22f.png)

## More Options for customising the prompt
The following are a few common flags you can use to customize your Terminal prompt:

\d – Current date
\t – Current time
\h – Host name
\# – Command number
\u – User name

## Going further
There are several options for customising your Terminal prompt including custom strings, timestamps colours and even emoji
Successful Software Development in a Hybrid Environment
Tags: devops, productivity, opensource, discuss
Published: 2021-11-15 16:47:57

Remote work, especially for software development teams, is continuing to increase as digital transformation continues to evolve. We have learned that many people prefer working from home due to less time spent commuting, more productivity, and flexibility. Hybrid environments and emerging technologies are making it possible to meet customer demands while remaining effective in organizational expectations.

https://devops.com/successful-software-development-in-a-hybrid-environment/
Reinforcement learning with AWS DeepRacer
Tags: aws, programming, beginners
Published: 2021-11-15 16:31:55

###WHAT WE ARE WORKING TOWARDS
AWS Deepracer is a fun way to learn and implement Machine learning with hands on experience. Developers of all skill levels can get hands on with machine learning through a cloud based 3D racing simulator, which they can start using simply by logging into their aws account. AWS DeepRacer is based on the model of reinforcement learning (RL). RL is an advanced machine learning (ML) technique that takes a very different approach to training models than other machine learning methods.

###WHAT AWS DEEPRACER SERVICES PROVIDE
The user can now use the AWS DeepRacer 3D racing simulator. Experiment with multiple sensor inputs, the latest reinforcement learning algorithms, neural network configurations and simulation to-real domain transfer methods.


###HOW TO BEGIN
You will first need to create your own deepracer car by selecting the type of car, the skin you want on it, the track you want it to run on. And finally, you can train your model by setting the time you want it to train for and then testing it! As you progress you can participate in the AWS League.It is a global autonomous racing league, driven by machine learning.There are 3 stages that you can advance to :-

1. Start in the Open Division and win virtual cars
2. Advance to the Pro Division and win gear
3. Take on the League's best and win a DeepRacer
It is a fun community of many Machine learning Enthusiast and you can meet many new people thorugh the various community driven events.

###CONCLUSION
Here are some of the official AWS links from their website containing various resources from where you can learn to build your own models and tracks. You can also improve your racing performance.


That's it, I hope I was able to spark some interest into you. Now it's time to get your hands dirty! All the best!
![Spongebob meme](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lcl9qi4wm1eu2qj50l83.gif)
1 line of code: How to merge two Arrays and preserve all entries
Tags: javascript, webdev, productivity, codequality
Published: 2021-11-15 16:22:51

```javascript
const mergeArray = (a, b) => [...a, ...b];
```

Returns a new Array which contains all items of the two Arrays. 

---

## The repository & npm package

You can find the all the utility functions from this series at [github.com/martinkr/onelinecode](https://github.com/martinkr/onelinecode)
The library is also published to [npm as @onelinecode](https://www.npmjs.com/package/@onelinecode/onelinecode) for your convenience.

The code and the npm package will be updated every time I publish a new article.

---
Follow me on [Twitter: @martinkr](http://twitter.com/_martinkr) and consider to [buy me a coffee](https://www.buymeacoffee.com/martinkr)

Photo by [zoo_monkey](https://unsplash.com/@zoo_monkey) on [Unsplash](https://unsplash.com/s/photos/fuji)

---
Hello, World!
Tags: blog
Published: 2021-11-15 16:16:02

I thought I'd inaugurate this empty blog with the cliché-est cliché that ever clichéd in the world of programming. Mostly I'm just doing this so that you're not faced with an empty wall; but also there's a little bit of the sticking-to-tradition thing going on here.

I'm still working on the look and feel of this website but I'm hoping to start writing down thoughts and ideas here as I work on all that. 

Welcome.
A RTD-like documentation pipeline for GitHub Actions
Tags: actionshackathon21
Published: 2021-11-15 16:14:23

[Instructions]: # (To submit to the GitHub Actions x DEV Hackathon 2021, please fill out all sections.)


### My Workflow
[Note]: # (Please make sure the project links to the appropriate GitHub Actions repository, and includes [an open source license](https://choosealicense.com/) and README.)

In the recent years, lot of Python packages moved their documentation pipelines from third party services like ReadTheDocs to GitHub Pages, but some useful features were missing in the process.

This workflow intends to be a full featured replacement for RTD on GitHub Actions, giving back the control of the documentation deployment process to developers.

**Features:**

1. Support of `pip` and `conda` dependency files.
2. Build and deploy branches under `/branches/<branch>`.
3. Build and deploy tags under `/tags/<tag>`
4. Secure build and preview of pull requests under `/pull/<number>` via labels.
5. Manual trigger for branches.
6. Select branch to deploy the site (default: `gh-pages`).
7. Redirect the main domain to `/latest` or `/stable` (default: `/latest`).
8. Redirect the `/stable` subdomain to the latest SemVer tag, or the `stable` branch (if exists).
9. Automatic removal of pages from closed/merged pull requests, and deleted branches or tags.

**Not supported:**

Multi-language builds.

**Live demo:**

- https://epassaro.github.io/actions-rtd-workflow
- https://epassaro.github.io/actions-rtd-workflow/latest
- https://epassaro.github.io/actions-rtd-workflow/stable
- https://epassaro.github.io/actions-rtd-workflow/pull/1
- https://epassaro.github.io/actions-rtd-workflow/tag/v0.1.0

### Submission Category: 

[Note]: # (Maintainer Must-Haves, DIY Deployments, Interesting IoT, Phone Friendly, or Wacky Wildcards)

DIY Deployments


### Yaml File or Link to Code

[Note]: # (Our markdown editor supports pretty embeds. Try this syntax: `{% github link_to_your_repo %}` to share a GitHub repository)

{% github epassaro/actions-rtd-workflow %}


### Additional Resources / Info

[Note]: # (Be sure to link to any open source projects that are using your workflow!)

[Note]: # (Be sure to include the DEV usernames of your collaborators, if any)

[Reminder]: # (Submissions are due on December 8th, 2021 (11:59 PM PT or 2 AM ET/6 AM UTC on December 9th))

{% link https://dev.to/epassaro/deploy-your-package-documentation-on-github-pages-in-the-rtd-style-preview-prs-and-more-ogf %}
Best Websites to download Programming Books
Published: 2021-05-08 07:51:05

Every student want to Download Programming books using internet. Here I am going to describe about some best websites to download Programming Books in PDF.
1.Oreilly Books
Oreilly books are written by industry professionals with keen interest in that field. There is a book on almost every computer science related topic which can be easily navigated by using the search bar that is provided. These books contain a lot of information and are really technical, which helps in getting a good grasp of the discussed topic. Also you can scroll down to find the list of other free E-books they have other topics such as security ,IOT,design ,data etc.

2. Tutorialspoint
This is a website tailored for beginners ,with a simple user interface and a large catalogue of resources Tutorialspoint is a great resource to learn numerous technologies.

The resources include everything from the history of the software and uses examples extensively to explain concepts. The books are available as PDFs for those who prefer to take their reading offline. 

3. ComputingSavvy
Computing Savvy (computingsavvy.com) is a non-profit organization and is willing to promote computer science/information technology education. Computing Savvy is promoting computer science and information technology education by publishing information technology related quality articles, lectures, presentations and research findings on its online portal. The contact information of Computer Science/Information Technology Departments of Pakistani Universities and Computer Science/Information Technology Institutes with their specialties and offered courses also be published on the portal. We also provide download links of well-known Computer Science books and software on our online portal.

4. PDF drive
PDF drive has a large collection of freely downloadable Ebooks on a large number of topics be it technical or non technical. They constantly add to their collection of books and searching through them is a breeze using the search bar up top.

5. E-books-IT
E-books-it.org is a webiste that offeres free E-books on purely technical concepts. The user interface may not seem too modern but it simple to navigate and use. There is a sections that showcases new releases and also a section that allows for you to contribute books from your end.
Responsive Masonry Layout with TailwindCSS in 2 Steps
Tags: tailwindcss, react, typescript, masonry
Published: 2021-11-15 15:50:06

Masonry views on a website are visually appealing. Let's quickly create a carousel with you using TailwindCSS. This article assumes you have basic knowledge of Tailwind.

# 1. Configure index.css in your react-app

First of all, let's add @layer to your index.css file in src folder. We create masonry layout class for 3 different screen;

.masonry         (1 column)
.masonry-sm      (2 column)
.masonry-md      (3 column)


``` React
@tailwind base;
@tailwind components;
@tailwind utilities;

@layer utilities {
    @variants responsive {
        .masonry {
            column-gap: 1.5em;
            column-count: 1;
        }
        .masonry-sm {
            column-gap: 1.5em;
            column-count: 2;
        }
        .masonry-md {
            column-gap: 1.5em;
            column-count: 3;
        }
        .break-inside {
            break-inside: avoid;
        }
        
    }
}
```

# 2. Use them inside className 

Now you can use these classes as standard TailwindCSS feature. You should use them inside parent div.


``` React
<div className="masonry sm:masonry-sm md:masonry-md">

  <div className="rounded-lg bg-gray-500 p-4 break-inside">
    <p> lorem100 </p>
  </div>
  <div className="rounded-lg bg-gray-500 p-4 break-inside">
    <p> lorem150 </p>
  </div>
  <div className="rounded-lg bg-gray-500 p-4 break-inside">
    <p> lorem50 </p>
  </div>
  <div className="rounded-lg bg-gray-500 p-4 break-inside">
    <p> lorem200 </p>
  </div>

</div>
```


That is all. You now have a masonry layout that is simple to use and looks good.
TypeError: fs.existsSync is not a function
Tags: javascript, css, webdev, react
Published: 2021-11-15 15:42:56

### While using Sass in a react project and using useRef hook, one might come across this error:

![React and Sass error](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mp8vkxbcw5be3071xijo.png)

To solve this, simply look for 
## `import {yourvarname} from "node-sass";`

in the component where ref is being used and remove this line. Visual Studio Code automatically adds the line which causes the given error.

More on this: https://vscode-docs.readthedocs.io/en/latest/languages/css/
Building a Next.js app with Netlify, NextAuth.js, Prisma, and a PlanetScale serverless database
Tags: beginners, nextjs, netlify, serverless
Published: 2021-11-15 15:40:01

Git-centric workflows have fundamentally changed how we build for the web. As developers, we want isolated environments to develop and test our applications. As Netlify’s CEO Matt Biilmann mentioned in his recent Jamstack Conf keynote, our back-end data layer is still a single branch. It’s often talking to a long-running server or a production environment. 

It doesn’t have to be this way. PlanetScale supports database schema branching, deploy requests, and non-blocking schema changes. Your staging environment’s database can be isolated from the production environment’s database.

We are excited to announce a new Next.js starter app that can be deployed to Netlify with the “Deploy to Netlify” button, uses NextAuth.js for built-in authentication, and Prisma to interact with your PlanetScale database.

The starter app is located today on the Netlify Jamstack Templates page. Want to get started right away? Click the button below!

[![Deploy to Netlify](https://www.netlify.com/img/deploy/button.svg)](https://app.netlify.com/start/deploy?repository=https://github.com/planetscale/nextjs-planetscale-starter)

_Note: After you deploy to Netlify, you will need to follow the instructions in the [documentation](https://github.com/planetscale/nextjs-planetscale-starter) to get your PlanetScale database up and running._


Since this is just the first version of this starter app, we would love to hear your feedback!