teleren/devto huggingface dataset:
Having Trouble Creating Blocks of Code in my Blog Posts on Dev.to
Published: 2022-02-22 19:57:51

Hi all, 

I recently just posted an [article](https://dev.to/bredmond1019/getting-started-with-flask-7de) on here -- a tutorial for Flask -- and I was having trouble using the code blocks they supply us on here for markdown. 

For example, I had this below block in one part of my blog.   

```python
from flask import Flask        
app = Flask(__name__)
        
@app.route( ‘/’ )        
def index():            
     return ‘<h1>Hello World!</h1>’
```

Then I copied this exact block down further and this is what I got:

`` `python
from flask import Flask        
app = Flask(__name__)
             
@app.route( "/" )            
def index():                     
return "<h1>Hello World!</h1>"
` ``
     
I was able to replicate this by adding a space inbetween the three ` marks. However, I didn't add the space in my blog, I literally copied and pasted what you see in the first block that actually works. 

Any thoughts?

I was able to get it to work by just indenting all of the code, but I wanted to use the following version, and I wasn't able to with just indenting.


     ` ` `python
     code here
     ` ` `
Hashnode Subdomain with Netlify and Google Domain
Published: 2022-03-29 18:33:40

---
title: Hashnode Subdomain with Netlify and Google Domain
cover_image: "https://blog.eamonncottrell.com/_next/image?url=https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1645557248386%2FrmuHsMxTX.png%3Fw%3D1600%26h%3D840%26fit%3Dcrop%26crop%3Dentropy%26auto%3Dcompress%2Cformat%26format%3Dwebp&w=1920&q=75"
published: true
date: 2022-02-22 19:15:34 UTC
tags: 
canonical_url: https://blog.eamonncottrell.com/hashnode-subdomain-with-netlify-and-google-domain
---

If you're like me, you overcomplicate things.

<img src="https://media.giphy.com/media/qucJWFolJN6rS/giphy.gif" width="100%">

I made a custom Hugo theme for my personal portfolio and blog site last year. Here's the [Github](https://github.com/sieis/cottrell-theme). Here's the [main site](https://www.eamonncottrell.com/).

I registered the domain with Google. But I deployed the site with Netlify. Because I wanted to be awesome, learn many things, and take a circuitous route to the finished product.

<img src="https://media.giphy.com/media/Af7ap9r7NzJJe/giphy.gif" width="100%">

This year, I realized that it may actually be a solid idea to be publishing articles on a proper platform like Hashnode.

Thankfully, I can do both!

Part of the appeal of Hashnode is the mapping of the blog to a [custom domain](https://support.hashnode.com/docs/mapping-domain/). But when I went into Google Domains, I realized I'd set things up to use the DNS servers at Netlify.

![pic](https://cdn.hashnode.com/res/hashnode/image/upload/v1645555912603/5hL6gFjeE.png)

Fear not!

Heading over to [Netlify](https://www.netlify.com/), all that is needed is to setup a new record under the DNS settings here. The record type is CNAME, the name is whatever you want...in my case, I wanted it to be blog. And the value is hashnode.network. I left the TTL part blank (it's optional).

![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1645556104231/ELnDYcRNK.png)

And, that's it. It can take up to 24hrs to propagate, but mine worked at [blog.eamonncottrell.com](https://blog.eamonncottrell.com/) almost immediately.

![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1645556055224/1sqV4PF07.png)

Now I've got a couple choices that I'm not fully committed on yet. I could hop back into the code to my [portfolio site](https://www.eamonncottrell.com/posts/) and redirect the blog posts to Hashnode. Or I could have them living in both places. Redundancy here seems dumb, but I do still kind of like that I've got a custom built template over on my domain.

What do you think I should do?

Let me know!

Reach out over on [Twitter](https://twitter.com/EamonnCottrell) and/or [LinkedIn](https://www.linkedin.com/in/eamonncottrell/) and tell me what you think.

Here's my [portfolio site](https://www.eamonncottrell.com/posts/).
How to create a Python login page with tkinter
Tags: tkinter, python
Published: 2022-02-22 19:00:21

```Python
from tkinter import *
from tkinter import messagebox

window = Tk()
window.geometry("400x400")
window.title("Login")
window.config(bg="#f07167")

lbl1=Label(window,text="Login",font=("",40),fg="#fed9b7",bg="#f07167")
lbl1.pack(anchor="center")


lbl2=Label(window,text="Email:",font=("",30),fg="#fdfcdc",bg="#f07167")
lbl2.place(x=10,y=90)

ent1=Entry(window)
ent1.place(x=200,y=100)



lbl3=Label(window,text="Password:",font=("",30),fg="#fdfcdc",bg="#f07167")
lbl3.place(x=10,y=170)

ent3=Entry(window)
ent3.place(x=200,y=180)


btn1=Button(window,text="Apply",font=("",25),bg="#f07167")
btn1.place(x=150,y=300)
window.mainloop()
```
I found a job!
Tags: java, career, beginners
Published: 2022-02-22 18:56:30

I am so happy. It took 10 months to complete this career change from building engineering and architecture to coding.

The full stack web dev bootcamp was a great experience. So great that I resigned from my previous job (not tech related) and decided to pursue the dream full time.

After completing the bootcamp I started working there as a teaching assistant. This was a great experience to refresh and solidfy the whole experience. You learn OOP only when you try to explain it to someone who is not familiar with it.

I am now learning Java in this new company and loooking forward to post my findings.

Stay tuned!
Announcing the XRPL Grants Wave 2 Awards
Tags: xrpl, xrplgrants, blockchain, opensource
Published: 2022-02-22 18:52:47

The XRPL Grants Program funds software development projects that leverage the open-source XRP Ledger. After a successful [inaugural wave](https://dev.to/ripplexdev/announcing-the-first-wave-of-xrpl-grants-1hf9), XRPL Grants opened the call for applications for Wave 2 in Fall 2021. In this second wave, more than 30 teams from across five continents have been awarded nearly $4 million in total funding. [Awardees](https://xrplgrants.org/grantees) also get the opportunity to receive technical mentorship from a Ripple engineer to support project integration with the [XRP Ledger (XRPL)](https://xrpl.org/). 

More than 100 applications were submitted in Wave 2. Every project was carefully reviewed by the [judging committee](https://dev.to/ripplexdev/xrpl-grants-expands-judging-committee-140n), with experts and professors from organizations including Stronghold, Australian National University, University of Nicosia, Ryerson University, Northeastern University, and TU Delft. We were impressed by the quality and creativity of the applicants and projects.

Wave 2 of the XRPL Grants program focused on [Federated Sidechains](https://xrpl.org/federated-sidechains.html). In December, RippleX [introduced](https://dev.to/ripplexdev/ripplex-releases-engineering-preview-of-proposed-federated-sidechains-system-3ncp) an engineering preview, making it possible for developers to connect a sidechain to the XRP Ledger Mainnet or a test network. Awarded projects showcase the vast use cases for sidechains, including but not limited to: 
- NFT minting
- Charitable giving
- Sports club memberships
- Restaurant/retail orders
- Data security

Additional awardees encompass a range of exciting applications: tackling economic inequality, ocean conservation, artistic collaboration, equitable compensation for artists, and more. There are also a few metaverse projects that allow users to play games, attend concerts, and more.

In addition to projects related to the current focus area, XRPL Grants welcomes applications for any project that builds on the XRPL and involves some technical development. The applicant pool continued to impress, with teams in more than 25 countries across a wide range of topics and areas of expertise. 

🎉 Full List - [XRPL Grants Awardees](http://www.xrplgrants.org/grantees) 🎉

Applications for Wave 3 of the XRPL Grants program will open in March 2022. All information, including the focus area for Wave 3, will be posted on [XRPLGrants.org](https://xrplgrants.org/). 

Share questions or comments in the thread below, and join the [XRPL Developers Discord](http://xrpldevs.org/) for more updates.
Best Code Editor
Tags: webdev, opensource, javascript, visualstudiocode
Published: 2022-02-22 18:32:41

**A code editor is the place where we programmers spend most of the time.
I have been using Visual Studio Code for a long time and happy with it.**

_I found this list of Visual Studio Code keyboard shortcuts for windows._ 

https://code.visualstudio.com/shortcuts/keyboard-shortcuts-windows.pdf

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

**Share and suggest some of your most favourite code editor with its 
features.**

_Thank you for reading.
I am Tanwi, self taught developer and love to share the knowledge and tips with others. Follow me to get such more contents._
Dashboard - Validações e formatação
Tags: webdev, javascript, challenge, beginners
Published: 2022-02-22 18:23:17

## Campos de data e hora

Existem vários tipos de inputs como date, time, tel, email que modificam o formato do input ( cada navegador tem uma interface diferente) e deixam o HTML mais semântico. 

Para adicionar uma nova task temos os campos Data e Hora:

`src/components/ModalFormTasks/index.js:`

```jsx
<div>
 <label>
   Date
   <input type="date" onChange={e => setDate(e.currentTarget.value)} />
 </label>

 <label>
   Hour
   <input type="time" onChange={e => setHour(e.currentTarget.value)} />
 </label>
</div>
```

E para dar uma 'descolada' do texto dos campos na lateral, vamos dar um espacinho nesses inputs:

`src/components/ModalFormTasks/styles.js:`

```jsx
label {
...
	input[type=time],
	input[type=date] {
	  padding-left: 5px;
	}
...
}
```

Toda as modificações acima podem ser encontradas [aqui](https://github.com/DevGirlsMentor/dashboard/commit/fa86cdf6cb93c821ab7af516e17376bcd65440f7)

## Obrigando o preenchimento de todas as informações

Hoje temos um problema, que se o usuário não preencher as informações, mesmo assim estamos criando uma task, e assim deixando a task em branco. Para resolver isso, sempre que o usuário não preencher as informações vamos mostrar um alerta, para lembra-lo. 

Uma maneira simples de fazer isso é verificando se os valores estão preenchidos antes de adicionar uma nova tarefa, e caso não estejam, mostramos um alerta:

`src/components/ModalFormTasks/index.js:`

```jsx
function handleSaveTask() {
	if ( title && description && date && hour && responsable && status) {
   handleAddTask({
     title,
     description,
     date,
     hour,
     responsable,
     status,
   })
   onClose()
 } else {
   alert('Preencha todos os campos.')
 }
}
```

Toda as modificações acima podem ser encontradas [aqui](https://github.com/DevGirlsMentor/dashboard/commit/6ef388c33eaab1a0194c133485c7f0342889effb)
Testing in Laravel | Full Tutorial For Beginners | Laravel Testing Tutorial
Tags: laravel, beginners, tutorial, programming
Published: 2022-02-22 18:16:50

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

This video will show you how to make admin tests in Laravel. We are going to cover the basics of unit tests, feature tests, HTTP tests, database tests in Laravel.

Github Source Code: https://github.com/laraveller/laravel-testing

Laravel 9 tutorial.
Laravel testing tutorial.
Testing in Laravel.

Follow me:
Twitter: https://twitter.com/Laravellercom
Facebook Page: https://www.facebook.com/1laravellercom
Instagram: https://www.instagram.com/laravellercom/
Github: https://github.com/laraveller
Website: https://laraveller.com/

Playlists:
Laravel Roles and Permissions: https://bit.ly/3gOhM7d
LARAVEL INERTIA MOVIE APP: https://bit.ly/3FVMp4Q
Laravel Livewire Movie App: https://bit.ly/3s8D6v1
Laravel Classified Website - https://bit.ly/3nsFRnb
Livewire Employees - https://bit.ly/2ZtIpZY
Laravel Employees Management - https://bit.ly/3Gglt14
Laravel admin panel - https://bit.ly/3CcX75M

TIMESTAMPS
00:00 Start
02:56 Setup Project
09:06 First Test
18:01 Authentication Test
34:43 Product Test
39:41 Authentication User Can Buy Product
55:32 Authentication User Can Create Product Link
01:04:15 Admin Role Test
01:13:40 Authentication User Can Create Product
01:30:06 Authentication User Can Update Product
01:43:34 Authentication User Can Delete Product
01:50:09 Unit Testing in Laravel
My first terminal game!
Tags: firstpost, pythogame, easygame
Published: 2022-02-22 18:14:17

Hi! My name's Max and this is my first post here, on DEV!
I'm still working on my skills (just understood OOP), which is why I created this terminal game!

And I know it's bulky and unpractical (maybe even boring as I tend to use older words) but I'm proud of it! My main purpose was to try and get what the hell OOP is (I studied the same chapter over 4 times until something clicked!) and it kinda looks and feels half-baked but still awesome (at least I see it this way).

So, without further ado...

**The PLOT!!!**

_So, the main hero of this game is Barry - the most famous hero of Trialistia (that's a kingdom, btw) and he embarks on a journey to save the kidnapped Princess of the Gleaming Castle and defeat the Demon King (you'll know the details if you open it)._

Oh, and of course the link to my GitHub: [StriderDunedain](https://github.com/StriderDunedain)
(The "Adventure" repository)

P.S. For some unknown to me reason, it may not start from the first time, although it usually does
Is JavaScript good or bad for beginners?
Tags: javascript, webdev, beginners, programming
Published: 2022-02-22 18:10:31

**My view**

In my opinion JavaScript can be a great choice to begin with, but it depends a lot on the resources you use and what technologies you try to use with it.
If you actually want to _start learning software programming_ with JS, start with a very simple HTML page (just all you need to execute JS). Do not include any trending Framework, just concentrate on pure JS. Alternatively you can use Node, then there is no need to set up any HTML file.
I think, what learning JS can make difficult is the unnecessary flexibility it provides, but it is still important to understand the "bad" concepts, because you possibly will have to work with the code somebody else has written.
Good articles without explaining too early and too much unnecessary details can be very helpful to quickly learn how programming works. Just think about how equality with "===" is recommended, but knowing "==" is still worth it.

**Your view**
Please leave your opinion in the comments, even if you do not know a lot about JS. Every perspective is appreciated!
Create a DockerFile
Tags: webdev, beginners, programming, docker
Published: 2022-02-22 18:08:51

So you're interested in Docker? You came to the right spot. Today I'm going through what it is, a video tutorial on how to get started, and a tutorial on how to create a DockerFile.

#What is Docker
Before you even install and try to run docker, you should probably understand what it is. Docker is a light-weight way of running a program through containers and microservices. Monolith Server Architecture is a thing of the past because we traditionally hosted resources in one environment. This made it versatile, but also heavy and very difficult to update changes. Microservices are used to split up tasks into specific operations. In the picture below, you can see all the small microservices one interface may be running on multiple machines. The whole functionality of a backend is now in thousands of containers all over the world.

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

#Get started
You can follow this [tutorial](https://youtu.be/UOC5hksJoSM) to learn more about how to run docker on your browser. Remember when copying and pasting into docker you may have to use `ctrl` `shift` `p`.

#Create a DockerFile
1. Run your GitHub repo in the [docker playground](https://labs.play-with-docker.com/).
2. Run `touch Dockerfile`
3. Select `Editor` to open the file system. You should see your file.
![Editor showing Dockerfile](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/iq408hdikhprtv01uhxy.png)
4. Double click on the Dockerfile in order to edit its contents.
5. Paste in the basic information shown below.

```
# syntax=docker/dockerfile:1
FROM node:12-alpine
RUN apk add --no-cache python2 g++ make
WORKDIR /app
COPY . .
RUN yarn install --production
CMD ["node", "src/index.js"]
```

6. Run `docker build -t getting-started .`
7. Start the app with `docker run -dp 3000:3000 getting-started`
8. Open [http://localhost:3000/](http://localhost:3000/). You should see a running app.

You now have a working Dockerfile! Congrats and keep coding!
Blue-Green Deployment Explained
Tags: devops, programming, codenewbie
Published: 2022-02-22 17:50:40

**Blue/Green** deployment, also called **Red/Black** or **A/B** deployment, is a continuous deployment process created by _Daniel North_ and _Jez Humble_ in 2005.

The principle is to have two production environments, one called **Blue**, the other **Green**.

For example, the **Green** environment is the production version currently online, while the **Blue** environment is inactive.

Every new feature or bug fix is merged in the **Blue** environment. When it is time to release the new version of the website, a load balancer switches all users to the **Blue** environment, and the Green one becomes a backup version.

## Benefits
The biggest benefit is that you can easily and quickly rollback in case of emergency.

There is zero downtime, as the load balancer shifts all users to the **Green** version, and if something goes wrong, they can all be switched back to the **Blue** version.

## Drawbacks
Running two identical environments is expensive, and a pretty complex task.

Moreover, some users may encounter session problems, be forced to log back into the app …

## Conclusion
Blue/Green deployment is an interesting solution. I would advise you to also research Canary Deployment, another great solution.

---

Photo by Blake Connally on Unsplash
Use useState + constructor? (is it viable?)
Tags: react, typescript, javascript, discuss
Published: 2022-02-22 17:39:31

Good night guys, how are you?

What alternative would you have for this: use the useState hook, storing a constructor(class), centralizing data from an Interface as the main object and, in parallel, functions related to it (they handling the interface data and sending it to a service (api), handling the return and returning it to the component that has the State.)

Does this alternative of mixing the Hooks with an old building seem valid? With it, it is possible to apply SOLID and create a giant dependency on API calls by the service, the management of objects and their interactions with the Backend through classes, and using components/views as a unique and exclusive treatment of returns (100% frontEnd ).

Observation:
- Alternatives like useReducer serve well for the data interface ahead, but it doesn't allow me to keep my main object with its interfaces and that I can use its data to build a series of functions without being the blessed actions with the using a switch case?

I'd love a third-party opinion!
A CSS chapter closes...
Published: 2022-02-22 16:05:11

I walked into 100devs not knowing what to expect, my entire experience with making a website had been as a child playing around on Windows Notepad. 

It started off slow with HTML tags and structure ("Oh! Those look familiar!") and quickly picked up pace.

Soon came CSS fundamentals, and that's where it started to get fun!

Separation of concerns. The Cascade. Classes & IDs. Specificity. Relationships. Colors and fonts. The Box Model.

Responsiveness, media queries. Floats.

Those were the tools we were given when assigned the creation of 7 website layouts from scratch (8, if you count the bonus pushwork).

There are many things that could have made it easier, such as flex and grids, but we were supposed to focus on getting the hang of floats. I'm also sure things such as CSS preprocessors or libraries would have made the sailing smoother, but that was not the point.

[Click here to see the last one I made before submitting the homework.](https://02-hw04-hairsalon.raissa-k.repl.co/).

It's not perfect, or the prettiest. It can certainly be improved - and it will, in time, as I build up knowledge and learn more skills/tools...

...But it's mine, and I'm proud.   

I'm proud of my progress in this first chapter. 

I'm proud of how hard I worked.

And I'm ready to move on to JavaScript, fully aware of the Through of Sorrow that is waiting for me.


So here's to the past 6 weeks at 100devs, and the 24 more to come!
Munity
Tags: gamedev, python, flask, webdev
Published: 2022-02-22 17:34:29


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

Munity is a game where you can test yourself on things related to an artist.

This game gets the song and album names from Spotify, and then gets lyrics from Genius.com.

You can play it without signing up, but if you sign up, you can see your highest scores in each game and can have XP and money.

Currently, you can test yourself on an artist's song lyrics and album covers.

Thanks to @dillonb07 for the help with the logos!

Play it here: https://munity.vulcanwm.repl.co

Have fun playing it!!!
Can I see your desk setup?
Published: 2022-02-22 17:34:27

Because why not

This is my setup at work



![my work setup](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hdsu9rvelfp8q3br502w.jpg)


Keyboard: Keychron K2
Monitor: don't remember the model number Samsung 32 inch curved
Laptop: Legion Y540
Laravel 9, NO LTS Support!?
Tags: laravel, php, symfony, laravel9
Published: 2022-02-22 15:36:00

## Latest LTS finally!!

Laravel 9 was finally released on February 22nd, 2022.

At first, we are thrilled with **LTS (Long Term Support) of Laravel 9**.

However, Mr.Otwell (The author of Laravel) **decided to postpone the LTS**.


![RELEASE DIFF](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gh77yqoslpe6bzb6dcw3.png)

## Why Postponed?

You can find out the reason why the LTS is postponed on Mr.Otwell Tweet.

![Twitter](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mbg8slxfn2l07e69vfjj.png)
 
In short, **a [pull request](https://github.com/symfony/symfony/pull/45377) on Symfony Repository** causes the postponement of the LTS.

## LTS Again?

The answer is "Maybe or Maybe not".

In my opinion, if the [PR](https://github.com/symfony/symfony/pull/45377) were rejected, There would be high probability that the LTS comes back.

What do you think about it?
Feel free to leave your thought on discussion.

## Update! PHP 8.1 needed from Symfony 6.1

The [PR](https://github.com/symfony/symfony/pull/45377) was merged yesterday on Symfony.

Therefore, PHP 8.1 will be the minimum requirement for Symfony 6.1.

Read this article for more information.
https://symfony.com/blog/symfony-6-1-will-require-php-8-1

In Laravel, they have already merged a [PR](https://github.com/laravel/framework/pull/41250) which changes the minimum PHP Version From 8.0 to 8.1 for Laravel 10.