teleren/devto huggingface dataset:
Form input validation WITHOUT JavaScript
Tags: css, tutorial, webdev, html
Published: 2022-08-15 18:58:00

I promised it and here it is, 

## BEHOLD!
{% codepen https://codepen.io/joelbonetr/pen/ZEbgQVG %}

## Quick Explanation

We need 2 things here:
1. The [pattern](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern) html attribute
2. Some CSS pseudos like [:valid](https://developer.mozilla.org/es/docs/Web/CSS/:valid) and [:invalid](https://developer.mozilla.org/es/docs/Web/CSS/:invalid)


### Pattern
The pattern attribute allows us to specify a regular expression that the inputted value must match in order to be considered valid.

**!important:** You must avoid using the pattern attribute on fields that have a validation by default like `<input type="email">` as the browser will validate the input according to the [RFC5322](https://datatracker.ietf.org/doc/html/rfc5322) and cast to `:valid` or `:invalid` consequently) on its own.

### :valid, :invalid

When used in an input, CSS considers it **:valid** when the regex set in the pattern attribute matches the user input on it. Otherwise it's considered **:invalid**.

## Basic Usage

`html` 

```html
<form>
  <label for="choose">Would you prefer tea or coffee?</label>
  <input id="choose" name="i_like" required pattern="[Tt]ea|[Cc]offee">
  <button>Submit</button>
</form>
```

`css`
```css
input:valid { color: green }
input:invalid { color: red }
```
In this example, because the pattern regex `[Tt]ea|[Cc]offee` only those 4 words will be valid:
- Tea
- tea
- Coffee
- coffee

If you type any of those, the color will change to "green" on the other hand if you type anything else, it will be "red" and any attempts to submit the form will lead to a browser message.

{% codepen https://codepen.io/Joelbr/pen/OJvamJy %}

### ending

If you try to submit (thats why I left that button in the codepen) while any input in the form is not valid, it will show you a message in YOUR language. Without the need of i18n or anything else, the browser will handle that for you.

I feel this a nice approach for UX; whenever you need to give a quick feedback to the user.

You can design it your way and extend your creativity adding other CSS pseudos like:
- [:focus](https://developer.mozilla.org/es/docs/Web/CSS/:focus)
- [:placeholder-shown](https://developer.mozilla.org/es/docs/Web/CSS/:placeholder-shown)
- [:in-range](https://developer.mozilla.org/es/docs/Web/CSS/:in-range)
- [:not](https://developer.mozilla.org/es/docs/Web/CSS/:not)

And last but not least, you can also edit the label or another element by using the adjacent sibling selector `+`, which is the reason I've set the **label after the input** in my first codepen, check the CSS! 😁

Also bookmark this for reference whenever you need it:
{% embed https://dev.to/joelbonetr/complete-css-guide-for-beginners-1gjc %}

Till the next one! 

<img src="https://odditymall.com/includes/content/upload/inflatable-jetpack-costume-2855.gif" alt="jetpack" title="jetpack" />
Best way to learn CSS : CSS Games Online
Tags: webdev, css, programming, beginners
Published: 2022-08-15 18:47:08

Best way to learn anything is through some engagements and visualization, and gamification it is. With online games you can learn more deeply anything, here are some website where I have learned CSS very deep and in detailed theory and hands-on coding.

1. FLEXBOX FROGGY

Website - http://flexboxfroggy.com/


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

2. Knights Of The Flexbox Table

Website - https://knightsoftheflexboxtable.com/


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

3. Flexbox Defense

Website - http://www.flexboxdefense.com/


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

4. Flexbox Zombies

Website - https://mastery.games/flexboxzombies/


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/suugkgvm28c2b993n5y7.png)
ODAK!
Tags: 21daysfocus, focustime, uninterruptedwork
Published: 2022-08-15 18:33:07


![Focus21days](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/20k7lqiofw01a2va2tat.jpg)Odağımı sürekli bir zaman dilimi içerisinde-şu an için 21 gün- teknik alanda belirlediğim bir hedefime doğru sabitlemeye karar verdim. Bu gönderim de hedefim yönündeki kilometre taşının ilki. Odaklı çalışma ile hedeflerin yazılı hale getirilip göz önünde tutuldukça gerçeğe bir adım daha yakın olduğunun farkına varmam sonucunda hedefi daha da kolay görülür bir noktaya bırakıp çalışmaya başlıyorum. #day1 "🎶#saveyourtears for another day."<u>Now, study time.</u> 💻🚀
Default Exports vs Named Exports
Tags: javascript, typescript, export, default
Published: 2022-08-15 18:26:00

```typescript
export default function A() {}

// vs

export function A() {}
```

I think that both methods are good. But I can see some advantages of named exports.

## Named exports will not allow to implicitly change the import name

```typescript
// No error with default export
import Button from '../components/Text'
// now we have a "Button" component 
// which is actually a "Text" component

// TypeScript will throw and error 
// if import and export names don't match
import { Button } from '../components/Text'
// we will get an error here
```

## Named exports are easier to re-export and organise

Imagine we have several UI components inside `components` folder. Each component in a separate file: `components/Header.tsx`, `components/Text.tsx`, `components/Button.tsx`, etc.

Now to be able to import these components as `import { Header, Text, Button } from '../components'` we just need to create the `components/index.ts`.

```typescript
export * from './Header'
export * from './Text'
export * from './Button'
```

Compare to the default exports where will  need to write:
```typescript
export { default as Header } from './Header'
export { default as Text } from './Text'
export { default as Button } from './Button'
```

## Named exports are shorter to write

```typescript
export function Component() {}
// or 
export const Component = () => {}
```

Compared to default exports:

```typescript
export default function Component() {}
// or 
const Component = () => {}
export default Component
```

---
If you have any questions or comments, please post them below, press 💖 button and happy hacking! 🙌🏻

## Credits

Photo by <a href="https://unsplash.com/@svsokolov?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Sergey Sokolov</a> on <a href="https://unsplash.com/?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Unsplash</a>
Computer Network: Types of transmission modes
Tags: beginners, opensource, devops, networking
Published: 2022-08-15 18:03:00

## Agenda

- What is Computer Networking
- Types of Transmission Modes in Computer Networks


**Computer Networking**

- It is an interconnected computing device that can exchange data and share resources with each other. 
- These networked devices use a system of rules, called communications protocols, to transmit information over physical or wireless technologies.

**Types of Transmission Modes in Computer networks **
There are three types of Transmission modes in computer networks:


**Simplex Mode:

- This is unidirectional.
- Sender can only send the data and re can only receive the data.
- Direction of message transmission: sender to receiver.

**Examples **-

- Mouse/keyboard/joystick to the computer
- Fire alarm system
- Loudspeaker
- Half Duplex Mode:
- Both communication points communicate to each other or we can say the sender can send the the message to receiver and vice versa but not at the same time.
- This means that while one device is sending, the other device can only receive, and vice versa.

**Examples** -

- A walkie-talkie
- A two-way radio that has a push-to-talk button
- Browsing the internet (requests, responses)
- Universal Serial Bus (USB)

**Full Duplex Mode**:

- It is approx the same as Half duplex mode.
- The only difference is that-Sender can send the message and the receiver  can receive the message and vice versa at the same time

**Examples **-

- Video calls/video conferencing
- Audio calls
- Live chats
Difference between Hardware,Software,firmware
Tags: devops, beginners, computerscience, opensource
Published: 2022-08-15 17:53:00

## Agenda

- Difference between Hardware, Software, and Firmware 

**What is Hardware **

- It is a physical component of the system/it's the physical part of the computer
- It can be touched by us.
- Examples- 
- Keyboard, mouse, cabinet, monitor, printer 


**What is Firmware **

- It is a kind of software that is associated with your hardware.
- It is installed at the time of manufacturing of hardware such as keyboards, hard drives, BIOS, graphic cards, and printers.
- It performs the basic functions of any hardware.
- You can update.
- Firmware is the foundation of the software stack that computer hardware uses for basic operations and to run applications.

**Types of Firmware:**

1. Low-level firmware 
2. High-level firmware 
3. Subsystem firmware 

**Examples in detail**
If the user is pressing any of the keys on the keyboard, then the system will know what to display or what to perform right!!

On your keyboard, there is a start button/power button, now when you press the start button/power button then how system identified that it's time to reboot /restart/shutdown?

In your washing machine, When you go to wash the clothes then you set a time 5minute by the timer button (that is hardware) now think, how at the preset time timer started to notify you by alarming, how the system identified that after 5 min I have to give the alarm.
well, these all basic functions happened because of firmware that is associated with your hardware.


**What is Software **

- A collection of instructions that tells the computer how to perform a particular task.
- It is generally stored in user-accessible memory. 
- Software is changed constantly.
- Software can be very big while the firmware is very small.
- It can be of three types :

System software
Utility software 
Application software
Full Circle in a Flask
Tags: python, webdev, beginners, programming
Published: 2022-08-15 17:28:48

## Small Wins & Spotify

- It's Sunday morning with a full day ahead of me, some oatmeal on my desk and a Discovery Weekly playlist I need to listen to...

Many YouTube and Flask documentation later, it is Sunday evening with a chicken sandwich with chips in my belly. I have connected my PostgreSQL database to my app (which I always thought I couldn't do without some sort of instructor). I have finally displayed my sample data on my page and I could not be happier. It has no style and the font is generic (speaking of generic...my discovery weekly playlist. Thanks Spotfiy) but it is a small win and I can't wait to fluster myself with some Valorant before bed.

## To-Do App...my friend
- It's Monday morning and too much caffeine later, my app.py is looking like I know what I'm doing.

With a little bit of debugging my database, and some syntax errors, I have a To-Do app using Flask. Anytime I succeed in rendering a button, or an input box, I smile because I think of how little I believed in my abilities months ago. To-do apps are such a great way to remind yourself that the complexity in your code is magnified by the weight of doubt. I can only speak to a newbie's experience, but nearly all my experience with programming has been clouded with a sense of inadequacy. 

To rid yourself of this my friends, I suggest just starting with small apps, render anything you can, enjoy the small bugs in spelling, and remember that Steven Spielberg was rejected from 3 film schools. You continue...you learn. You learn...you adapt. You adapt, you thrive. 

Snippet of my code:

![Flask Code](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/q34l08fw2nbbsmmtem7v.png)
FREE ONLINE EDUCATION
Tags: free, resources, opensource, beginners
Published: 2022-08-15 17:42:53


➢https://www.coursera.org/
➢https://www.edx.org/
➢https://www.khanacademy.org/
➢https://www.udemy.com/
➢ [MIT OpenCourseWare](https://ocw.mit.edu/index.htm) (Free Online Course Materials)
➢https://online.stanford.edu/
➢https://www.codecademy.com/
➢ [Learn Python for free](https://github.com/pamoroso/free-python-books)
Come here for { INTERVIEW PREPARATION }
Tags: interview, devjournal, python, programming
Published: 2022-08-15 17:41:00


➢https://www.ambitionbox.com/about-us
➢https://www.acetheinterview.com/
➢https://www.geeksforgeeks.org/
➢https://leetcode.com/
➢http://www.gainlo.co/
➢https://careercup.com/
➢https://coder.com/careers
➢https://interviewup.blogspot.com/
➢https://www.livecareer.com/resources/interviews/prep/interviewbest-blog
➢https://www.indiabix.com/
TOP 10 RESUME SITES
Tags: resume, css, design, webdev
Published: 2022-08-15 17:39:55


➢https://zety.com/
➢https://www.resumonk.com/
➢https://www.resume.com/
➢https://www.visualcv.com/
➢https://www.cvmaker.com/
➢https://resumup.com/
➢https://resumegenius.com/
➢https://www.resumebuilder.com/
➢http://www.resumebaker.com/
➢https://enhancv.com/
Here are some "CAREER" sites :)
Tags: programming, beginners, tutorial
Published: 2022-08-15 17:38:35


➢https://www.linkedin.com/
➢https://www.indeed.com/
➢https://www.naukri.com/
➢https://www.monster.com/
➢https://www.careercloud.com/
➢https://www.dice.com/
➢https://www.careerbuilder.com/
➢https://www.jibberjobber.com/
➢https://www.glassdoor.com/index.htm
Top Sites for "FREELANCING"
Tags: freelancing, webdev, react
Published: 2022-08-15 17:37:22

➢http://www.fiverr.com/
➢http://www.upwork.com/
➢http://www.odesk.com/
➢http://www.elance.com/
➢http://www.99designs.com/
➢http://www.freelancer.com/
➢http://www.guru.com/
➢http://www.peopleperhour.com/
➢http://www.freelanced.com/
➢http://www.ifreelance.com/
Curious about NEXT.JS
Tags: nextjs, react, javascript, codenewbie
Published: 2022-08-15 17:26:29

Hi Guys, I am a full stack developer with experience in Django and the MERN Stack. I've recently picked up React and I absolutely love the power of it. Never experienced such flexibility and accessibility in a library before. I am extremely curious about NEXT JS and it's future potential. Kindly share your thoughts so I can plan out my future path.
Thai Lottery
Published: 2022-08-15 17:13:12

Thai Lottery</strong> is drawn on the first and the sixteenth of every month. The ambitious and adventurous people Who are Seeking to check <a href="https://thailotterywinners.com/"><span style="color: #ff0000;"><strong>Thai Lottery</strong></span></a> <strong>Results</strong> Can Get Lottery Winning Number Details By Our Page. <strong>ตรวจหวยไทย</strong> Here, We are here to Give the Full Details of <strong>GLO Thailand Lottery</strong>.
<h2><strong>Thai Lottery Result Today </strong><strong>Live 16 August </strong><strong>2022 Winners</strong></h2>
<strong>Thai Lottery Today Result 16-08-2022</strong> ,Evening 16 August 2022 <strong>Thai Government Lottery</strong> Results to be Declared Today At 02.30 PM. Thailand's official national lottery is administered by The <strong>Government Lottery Office (GLO)</strong>. It is basically stated earning posture as Government lottery Office (GLO) also called Head office, pocketing 28% of lottery profits for state use. Around 19.2 of 67 million Thai people played the <strong>Thailand Government lottery</strong>, spending 76 billion baht (US$2.3 billion) billion baht (US$2.3 billion).
<p style="text-align: left;">The formula to win the Thai lottery is not rocket science but a simple, decent and rewarding formula. The formula for winning the Thai lottery is so simple that any Thai lottery player can easily get accurate and valuable numbers for the next draw and the lucky number. The players follow all these instructions, we personally guarantee that you will receive 100% of the lucky number of the draw. Success isn't always the last, but failure can be the last when you are determined and pushing for changes in your life , follow our website thailotterywinners with each draw and we will make sure you have lucky numbers. sure you have lucky numbers.</p>


[caption id="attachment_4736" align="aligncenter" width="640"]<a href="https://thailotterywinners.com/wp-content/uploads/2022/08/Coming-Soon.gif">
Build a Flashcard quiz with React
Tags: react, javascript, tutorial, webdev
Published: 2022-08-15 17:12:16

Welcome, today we're going to make a react flashcard quiz with React.js.

First, launch your terminal and use the **create react-app** command to create our new React app.


![](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rotdwrwzgk65js66nuo1.png)
Next, we open up our project in our code editor and and remove unnecessary code in the **App.js** file.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dh322it108kx6ru14097.png)
Next, we import React and make an array `questions_list` with our test questions in it. Then we develop **Flashcard.js** and **Flashcardlist.js** files in the src folder to store project-related components.

![](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gnbvbje8888pilhwhymw.png)
The structure of our flashcards is generated next by going to **Flashcard.js**. We create a function component and give it a props "card" to achieve this. When a flashcard is clicked, the card flip concept is used to reveal the answer. We import `useState` in order to achieve this.



![](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vxvp0z0j1jbe2zi0tohz.png)
In **Flashcardlist.js**, we import the `Flashcard` component and construct a list of flashcards, passing our `Flashcard` prop `card` to each element of the flashcards array.

![](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gy6awb7x9yy1y5byfuud.png)
After navigating to **App.js**, we import the **useState** hook and our `flashcardlist` component. We create a state variable array and assign it to the `questions_list` array.The array list is then passed as flashcards props to the `Flashcardlist` component. 

![](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/t51i9rufqcks6ktqzebp.png)
The styles for our flashcards are then stored in a Flashcard.css file that is created next. In Flashcard.js, this file has been imported.

![](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0qc9nl4huevoasw6bz3i.png)
After finishing our quick flashcard app using React, feel free to add more questions to the list to make it more interesting. [Here](https://github.com/Gbadeboife/Flashcard-quiz-app-using-React.js) is the URL of the github repository.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/f6opwcpgh30wsx2wxlfw.png)
Open-source for beginners
Tags: beginners, javascript, webdev, github
Published: 2022-08-15 16:45:58

Are you a beginner who is looking to contribute to open-source? Are you confused about where to start?
Then you have an opportunity to create your first contribution to open-source. **Open-Source-for-All** is a GitHub repo where you could learn to contribute to open-source projects through a step-by-step tutorial.
Here is the link to the GitHub repo: https://github.com/Sadeedpv/Open-Source-for-All
Stay till the end to know more.

## What is Open-source?

Open source software is software with source code that anyone can inspect, modify, and enhance.

## What makes Open-source software different from others?

Some software has source code that only the person, team, or organization who created it—and maintains exclusive control over it—can modify. People call this kind of software "proprietary" or "closed source" software.

Open source software is different. Its authors make its source code available to others who would like to view that code, copy it, learn from it, alter it, or share it. Mozilla Firefox, GNU/Linux, jQuery. etc. are some examples of open-source projects.

## Create your first Pull Request with **Open-Source-for-All**
Using this repository, you will have a comprehensive guide on how to contribute to open-source projects on GitHub. If you have any doubts, you can always raise a question on discussion.

### Thanks for your time and I hope you would consider contributing to the project 🎉🎊
Browser extension development is pain
Tags: programming, typescript, webdev, opensource
Published: 2022-08-15 16:36:11

You know those days when everything is crap, and when you get off work you think to yourself, at least get something done in your spare time?

For me, today was such a day. That's why I thought I'd dedicate myself to a topic which has annoyed me extremely in the past:
Browser plugin development. There are hundreds of tutorials out there, and 80% are outdated for years. Accordingly, I have
to write a unified project template for browser extensions. The template relies natively on TypeScript and Sass
as technologies, but of course it can be customized.

It has its own tool chain, which uses its own config file
which updates the `project.json` as well as the `manifest.json`. Furthermore, the basis for a variable templating for HTML
is built into the tool chain. This can be extended flexibly. By itself, the template allows building to manifest version 2 and 3,
to ensure compatibility for Firefox. However, the same is only rudimentary implemented, because with a bit of luck Firefox in the
compatibility with v3 manifest in the next months.

The whole project is available under the MIT license and can be downloaded or forked via [GitHub](https://github.com/JosunLP/BrowserExtensionTemplate/).

The same goes for improvement suggestions, feel free to fork me ^^

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kzo9tmcpx3oo0vn5gtln.png)
connect OpenVpn Server in Ubuntu
Published: 2022-08-15 16:28:29

simple step to connect our vpn office using ubutu
first we register our address / port / ip 
step to register our vpn 
-> open terminal and try cd into hosts
-> cd /etc 
-> sudo vi hosts

and we can register our vpn there

and install openvpn server in our system
command sudo su use as root

Sign in to your Linux system on the console or via SSH and obtain root privileges.
Run the commands below to install updates and trigger a prompt to reconfigure the timezone settings. 

```
apt update
apt upgrade
apt install tzdata
dpkg-reconfigure tzdata
```

2. Install OpenVPN Access Server from the software repository
Option 1: Install via repository (recommended) 
The recommended method to install the OpenVPN Access Server is to use the official OpenVPN Access Server software repository. You will need to be logged on to your Linux system either on the console or via SSH, and have root privileges. Then copy and paste the commands below to add the repository to your system, and install the OpenVPN Access Server client bundle and the OpenVPN Access Server package itself.

```
apt update && apt -y install ca-certificates wget net-tools gnupg
wget -qO - https://as-repository.openvpn.net/as-repo-public.gpg | apt-key add -
echo "deb http://as-repository.openvpn.net/as/debian jammy main">/etc/apt/sources.list.d/openvpn-as-repo.list
apt update && apt -y install openvpn-as
```

if u already install that 
check for run vpn service
```
systemctl start openvpn-server@server
systemctl status openvpn-server@server
```

if your system openVpn is running


```
● openvpn-server@server.service - OpenVPN service for server
     Loaded: loaded (/lib/systemd/system/openvpn-server@.service; enabled; vend>
     Active: active (running) since Mon 2022-08-15 14:41:44 WIB; 4h 30min ago
       Docs: man:openvpn(8)
             https://community.openvpn.net/openvpn/wiki/Openvpn24ManPage
             https://community.openvpn.net/openvpn/wiki/HOWTO
   Main PID: 15604 (openvpn)
     Status: "Initialization Sequence Completed"
      Tasks: 1 (limit: 28457)
     Memory: 1.8M
        CPU: 161ms
```