teleren/devto huggingface dataset:
#3 Estudos: Arquitetura Limpa
Tags: cleanarchitecture, cleancode, software, code
Published: 2024-02-27 01:21:48

Sabemos que o objetivo principal da Clean Architecture é criar sistemas que sejam independentes de frameworks, testáveis e fáceis de entender, manter e evoluir ao longo do tempo.

A ideia central por trás da Clean Architecture é a separação de preocupações e a dependência de direção. O sistema é dividido em camadas concêntricas, onde cada camada tem uma responsabilidade específica e depende apenas das camadas internas. As camadas são organizadas de forma hierárquica, com as camadas mais internas contendo a lógica de negócios e as camadas mais externas tratando de detalhes de implementação, como interfaces com o usuário e bancos de dados..

Mas na prática como essa divisão ocorre na estrutura de diretórios do nosso sistema?

Suponha que estamos desenvolvendo um aplicativo de lista de tarefas com as seguintes funcionalidades:

- Adicionar uma nova tarefa.
- Exibir todas as tarefas.
- Marcar uma tarefa como concluída.
- Excluir uma tarefa.

Aqui está uma possível estrutura de arquitetura limpa:


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

Agora, vamos explicar a organização proposta:

**domain**: Este pacote contém a camada de domínio da aplicação. Ele inclui o modelo de domínio (Task) e os contratos de repositório (TaskRepository). Esta camada representa as regras de negócio do sistema e é independente de qualquer detalhe de implementação.

**usecase**: Aqui estão os casos de uso da aplicação, que representam as interações que o usuário pode ter com o sistema. Cada caso de uso é uma classe Java que contém a lógica necessária para realizar uma operação específica, como adicionar uma nova tarefa, recuperar todas as tarefas existentes ou marcar uma tarefa como concluída.

**adapter**: Este pacote contém os adaptadores para integrar o sistema com elementos externos. O subpacote delivery contém apresentadores que formatam os dados para serem entregues ao usuário. O subpacote gateway contém adaptadores que lidam com operações de banco de dados. O subpacote controller contém controladores que lidam com as solicitações HTTP.

**TaskManagerApplication.java**: Esta é a classe principal do Spring Boot, que inicia a aplicação e configura o contexto do Spring. Aqui é onde você pode definir as configurações do Spring Boot, como componentes, serviços, configurações de banco de dados, etc.

Essa estrutura segue os princípios da Clean Architecture, com a separação clara de responsabilidades e a direção das dependências, garantindo uma aplicação que seja independente de frameworks e fácil de entender, testar e manter.
Javascript Variables
Published: 2024-02-27 01:18:28

Variables are named containers for data in Javascript. With variables, we are able to store values in memory and then enact specific actions on those values whenever necessary. Variables are able to hold simple and complex data types. 

We create variables using declarative keywords. The declarative keywords include key, let, and const. You create the variable by first typing out one of the declarative keywords and then whatever you'd like to call your variable. To assign it, you then type an equal sign(=) and set it to whatever data type you'd like.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wbxadvneaq7jl0brnckm.png)

Each variable name is case sensitive meaning lastname and lastName would be different so when you refer to the variable later, make sure to refer to it properly. All variable names should be written in camelCase so lastName is proper notation whereas lastname is not.

Var, let, and const are the three declarative keywords. When Javascript was first created, the only way to create variables was by using var, however, var was error-prone, specifically when it came to hoisting and being scoped to specific blocks of code. Due to this, let and const were made.

Var and let are reassignable, but const is not.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ssslh9thnw81px422fep.png)

Let and const can not be hoisted. Hoisting refers to the process where the interpreter appears to move the declaration of functions, variables, classes, or imports to the top of their scope, prior to execution of the code (MDN Web Docs). With var, you can reference the value before it is declared, but you can't do that with let and const. Only the variable name is hoisted to the top and not their assignment. Variables only get hoisted inside their own scope.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/npeszac2puwve31cos13.png)

Var is not scoped to if blocks or loop blocks, but let and const are scoped to both.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9rkvpaa3w5uq5080xb5y.png)

To summarize, variables are named containers for data in Javascript and an essential to master when coding. Variables can hold simple or complex data types and must be written in camelCase. The three declarative keywords for variables are var, let, and const. Var is reassignable, but is not scoped to if blocks or loop blocks. Let is reassignable and scoped to if blocks and loop blocks, but it is not hoisted. Const is not reassignable or hoisted, but it is scoped to if blocks and loop blocks.

References:
https://developer.mozilla.org/en-US/docs/Glossary/Hoisting
Towing Pros Darwin
Published: 2024-02-27 01:14:34

Towing Pros Darwin

Reliable towing services within Darwin and surrounding areas!

We Provide Affordable Darwin Tow Truck Services. Our team will be glad to assist you with any of your towing needs and will be able to provide you with any service you need when it comes to transporting or recovering your vehicle.

- Tilt Tray Towing
- Roadside Assistance
- Remote Towing
- Vehicle Recovery
- Wreckage Removal
- Heavy Duty Towing
- Container Towing
- Motorcycle Transport

24-Hour Emergency Service!

Towing Pros Darwin
31/9 Carey Street, Darwin, Northern Territory, Australia 0800 
08 8986 7128 
https://towingprosdarwin.com/
info@towingprosdarwin.com
Phone Addiction
Published: 2024-02-27 00:52:11

**Your own phone is your enemy!**

Your own phone can be the best thing you have or be the biggest distraction you holding on your hand.

Unfortunately, the way our brain processes information is backwards. For example, if you reject an advertisement today, often you will continue to see it later on. What is the most effective approach to market ads? Using Phones(THE DRUG)!

It's challenging to reverse what you just saw on your phone, but after seeing it multiple times, your "perception" of it becomes less negative. Before you realize it, you've become another consumer of the information and guess who is in charge? "Your Phone"

Think about and Analyse how much of your everyday activities are influenced by the amount of time you spend on your phone ("Ads, videos, or blog post"). Your daily activities determine how much you need of it, and over time, that need will either grow or decrease. A phone is a Drug!

![Think Loud](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cfjj8dim4r6bz4itbdj9.jpg)

A phone is like a narcotic; before you realize it, you're "addicted to it," obsessed with the latest developments, and "switching from one application to another." And I wonder if those who make money from it are any different from those who struggle with addiction?
Creating a Multi-Column Search Feature in a React Data Table
Tags: react, tanstack, webdev, javascript
Published: 2024-02-27 00:45:52

Implementing a multi-column search feature by one text field is essential in some cases. This article will guide you through the process of adding such a feature to a React data table component using the `@tanstack/react-table` library.

## Understanding Multi-Column Search

A multi-column search allows users to type a query into a single search bar and have the table filter its rows based on that query across multiple columns. This means that rather than having separate search fields for each column, users can enter one term and the table will display rows that match this term in any of the specified columns.

## Implementing the Multi-Column Search

### Step 1: Define the Filter Function

Firstly, we need to define a filter function that will be used to search across multiple columns. This function will concatenate the values of the specified columns and then check if the concatenated string includes the search term.

```jsx
import { FilterFn } from '@tanstack/react-table';

// Custom filter function for multi-column searching
const multiColumnFilterFn: FilterFn<Restaurant> = (row, columnId, filterValue) => {
  // Concatenate the values from multiple columns into a single string
  const searchableRowContent = `${row.original.name} ${row.original.type} ${row.original.location} ${row.original.owner}`;

  // Perform a case-insensitive comparison
  return searchableRowContent.toLowerCase().includes(filterValue.toLowerCase());
};

```

### Step 2: Integrate the Filter Function into the Column Definition

Next, we integrate this filter function into our column definition for the React Table. In this example, we will apply it to the `name` column, but the function will actually filter across multiple columns.

```jsx
{
  accessorKey: 'name',
  header: ({ column }) => (
    <DataTableColumnHeader column={column} title="Name" />
  ),
  cell: ({ row }) => (
    // ... cell rendering code
  ),
  filterFn: multiColumnFilterFn,
}
```


## Conclusion

By following these steps, you can enhance your React data tables with a multi-column search feature. This not only improves the user experience by making it easier to find relevant data but also streamlines the interface by reducing the clutter of multiple search fields.
We Are Burnaby’s Laneway Home News & Property Listing Resource!
Published: 2024-02-27 00:45:12

[Burnaby Laneway Houses](https://www.burnabylanewayhouse.com/)
4481 Hastings Street
Burnaby, BC Canada V5C 0L6
Tel: 604.961.3559
E-mail: info@burnabylanewayhouse.com

https://www.burnabylanewayhouse.com/

We Are Burnaby’s Laneway Home News & Property Listing Resource!
BurnabyLanewayHouse.com is brought to you by the expert realtor team at Oakwyn Realty Northwest.
We are the dedicated Burnaby Laneway and Coach house professionals devoted to helping you achieve your real estate objectives. We’ve crafted our distinctive team approach to provide tailored, top-notch service that caters to laneway home opportunities. The core of our business thrives on our loyal repeat and referral clientele. We offer Laneway homes by city on our online map.
"From Despair to Determination: A Photographer's Journey of Turning Life's Lemons into Lemonade"
Published: 2024-02-27 00:24:35

Amina stared at her camera, feeling defeated. Another rejection email had just landed in her inbox, adding to the pile of unpaid bills on her kitchen table. The weight of responsibilities was heavy on her shoulders—caring for her mother, keeping a roof over their heads, and pursuing her dream of becoming a photographer seemed impossible to balance.

One evening, while scrolling through her social media feed, Amina stumbled upon an exhibition by a renowned artist, Nadia. Her work was breathtaking, each photo telling a story that resonated with Amina deeply. She decided to attend the exhibition, hoping for a glimmer of inspiration.

As she walked through the gallery, Amina was captivated by Nadia's photographs. They spoke to her in a way nothing else had in a long time. Lost in thought, she didn't notice Nadia herself standing beside her until she spoke.

"I see you've been admiring my work," Nadia said, smiling warmly.

Amina blushed, feeling like an intruder. "I'm sorry, I didn't mean to..."

Nadia chuckled. "No need to apologize. I'm glad my work speaks to you. What's your name?"

"Amina," she replied, still in awe of the artist before her.

"Well, Amina, keep creating. The world needs your perspective," Nadia said before disappearing into the crowd.

Those words echoed in Amina's mind on her way home. She realized that she had been waiting for someone to give her permission to pursue her passion. But Nadia had shown her that the power to change her narrative was in her hands.

From that day on, Amina approached her freelance gigs with renewed determination, pouring her heart into every photo she took. She started a blog to showcase her work, slowly gaining recognition in the photography community. With each new opportunity, she grew stronger, proving to herself and the world that she was capable of turning life's lemons into something sweet.
Essential websites for front-end developers
Tags: webdev, programming, javascript
Published: 2024-02-27 00:05:09

Front-end developers have many essential websites and tools that can help them improve work efficiency, learn new technologies, and solve problems encountered during development. Here are some recommended essential websites:

1. MDN Web Docs: Mozilla Developer Network provides extensive and detailed documentation on web technologies, including HTML, CSS, JavaScript, etc. It is an indispensable reference resource for front-end developers.

2. Stack Overflow: This is a developer community where you can ask and answer questions. When you encounter technical difficulties, you can often find answers or solutions on Stack Overflow.

3. GitHub: As one of the largest code hosting platforms, GitHub has many open-source projects and resources available for learning and use. At the same time, you can also share your own projects and code here.

4. npm (Node Package Manager): For developers using Node.js, npm is essential. It provides a large number of packages and modules that can help you quickly build and expand applications.

5. CodePen: This is an online code editor that allows you to create and share HTML, CSS, and JavaScript code snippets. It is also a great learning platform where you can view the works of other developers and draw inspiration from them.

6. JShaman: A well-known platform for obfuscating and encrypting JavaScript source code, which can be used to obfuscate JavaScript code, compress JavaScript code, and encrypt Html code.

7. FreeCodeCamp: This is a free online learning platform that offers a series of courses and projects on web development. By completing these projects and challenges, you can improve your programming skills and obtain certification.

8. DevDocs: This is a search engine that combines multiple API documentation, including HTML, CSS, JavaScript, and various front-end libraries and frameworks. You can quickly find the information you need here.

9. Can I use: This website provides browser compatibility information for web technologies. During the development process, you can use it to check if your code works properly in different browsers.

10. Responsive Design Checker: This is an online tool that can help you test the responsive design of your website. You can view your website on different devices and screen sizes to ensure it displays correctly in various situations.

These websites and tools are commonly used by front-end developers in their daily work, and they can help improve work efficiency, solve problems, and learn new technologies.
6 Months Web
Tags: webdev, javascript, react, programming
Published: 2024-02-27 00:04:57

In 6 months, I self-taught web development, covering basic concepts to advanced technologies like React in 2023.   

You don't need another course...

Now, I freely share the materials and websites I used.   

Want it for Free ?

**[materials](https://abrizzer.gumroad.com/l/learning)**
Fallback Routing with Axum
Tags: axum, rust, webdev, routing
Published: 2024-02-27 16:25:41

---
title: Fallback Routing with Axum
published: true
date: 2024-02-27 00:00:00 UTC
tags: axum, rust, webdev, routing
canonical_url: https://coreyja.com/til/fallback-routing-with-axum
---

Yesterday I ran into a small problem with my Axum routing for my blog. So today I wanted to take 10 minutes and do quick write up about it!

My blog uses `Axum` as its Web Framework of choice. I was looking through some old emails and found one where a reader reached out about a post I made! (It was [this one about FZF Spell Checking in VIM](https://coreyja.com/posts/vim-spelling-suggestions-fzf/))

But I realized that it was linking to an older URL format, The link was to `https://coreyja.com/blog/2018/11/10/vim-spelling-suggestions-fzf.html`!

And you can see I was using a different URL structure then, and my current blog didn't have a redirect setup!

And that was our goal! I wanted `https://coreyja.com/blog/2018/11/10/vim-spelling-suggestions-fzf.html` to redirect to `/posts/vim-spelling-suggestions-fzf`. And I also decided that I wanted `blog/anything-else-here` to redirect to `/posts`

Simple enough!

I added these two routes to my Axum Router function:

```
.route("/blog/:year/:month/:date/:slug", get(redirect_to_new_post_url))
.route("/blog/*catchall", get(redirect_to_posts_index))
```

And I expected this to work out of the box! But it didn't :sadnerd:

Instead I got an error about conflicting routes. Luckily the answer is relatively easy, at least in my case! I just needed to use `nest` to target all the `/blog` urls and then use a `fallback`. Here is what I ended up with!

```
.nest(
  "/blog",
  Router::new()
    .route("/:year/:month/:date/:slug", get(redirect_to_new_post_url))
    .fallback(redirect_to_posts_index)
)
```

And now I was able to get all the redirects working as I wanted! Go check out that 'old' URL above now and with any luck you should be redirected to the right post!
Building a design system in a few hours with Symfony
Published: 2024-03-01 23:30:07

---
title: Building a design system in a few hours with Symfony
published: true
date: 2024-02-27 00:00:00 UTC
tags: 
canonical_url: https://www.oliverdavies.uk/archive/2024/02/27/building-a-design-system-in-a-few-hours-with-symfony
---

[I recently spoke with Mark Conroy](https://www.oliverdavies.uk/podcast/11-mark-conroy), Director of Development at Annertech, on the Beyond Blocks podcast. We discussed building something useful in a day and building design systems with web components.

Inspired by that conversation, I spent this afternoon experimenting with web components and seeing how I could use them within a design system we're building, as I think they can solve a particular need we have.

Following that, I thought I'd see how I could build my own design system and decided to do it with Symfony and see what I could achieve within a few hours.

It was a great opportunity to take Symfony 7 for a spin and explore and test some things that [Ryan Weaver and I discussed in our episode](https://www.oliverdavies.uk/podcast/10-ryan-weaver-symfonycasts), such as Symfony UX and Twig components.

Each component is a Twig component with its own PHP class and Twig template, which is rendered when I visit its URL, and I can use the HTML-like `<twig:Logo />` syntax to include child components.

You can [view the code on GitHub](https://github.com/opdavies/symfony-design-system), and it may be something I use and work on in the future.

P.S. There's less than a year until Drupal 7's end-of-life date. [Plan your upgrade to Drupal 10 now!](https://www.oliverdavies.uk/drupal-upgrade)
Google Next 24 - Rust, Python, and WASM in Apps Script
Tags: webassembly, rust, appsscript
Published: 2024-02-29 07:25:29

---
title: Google Next 24 - Rust, Python, and WASM in Apps Script
published: true
date: 2024-02-27 00:00:00 UTC
tags: wasm, rust, appsscript
canonical_url: https://justin.poehnelt.com/posts/2024-google-next-talk-rust-python-apps-script/
---

I will be giving a talk at Google Next 2024 on how to use Rust, Python and WASM to extend Google Apps Script. The full title is _Unleashing the power of Rust, Python, and WebAssembly in Apps Script_.

[![Google Next 24 - Rust, Python, and WASM in Apps Script](https://justin.poehnelt.com/images/next-24-rust-python-apps-script-wasm-session-xU7HzkYK1n-600.jpeg)](https://justin.poehnelt.com/images/next-24-rust-python-apps-script-wasm-session-xU7HzkYK1n-600.jpeg)

See the session details at: [Lightning Talk](https://cloud.withgoogle.com/next?session=IHLT300)
Day 914 : Fly
Tags: hiphop, code, coding, lifelongdev
Published: 2024-02-26 23:24:26

_liner notes_:
- Saturday : I was in Oakland, Ca for work so I did the radio show remotely from my hotel room. Everything worked perfectly. Got to do some exploring before the radio show and stopped by the Black Panther Party Museum. That was dope! After the radio show, I went to see "Demon Slayer" in 4DX and then got to see André 3000 in concert. Kind of an amazing day! The recording of this week's show is at https://kNOwBETTERHIPHOP.com

![Radio show episode image of a sign for the Black Panther Party Museum with the words Feb 24th 2024 Live from Oakland](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8s0vbnyoiqtdnodto36y.jpg)

- Sunday : Checked out of my hotel and wandered around Oakland for a couple of hours and took a bunch of pictures. Saw a parade. Visited a video game museum. Then I headed to the airport, worked on some stuff and waited to fly home. You can check the whole trip at https://dwane.in/developerweek .

- Professional : Flew in this morning a couple of hours before my first meeting. Had a couple of them back to back. Afterwards, I was so tired, I feel asleep, haha Woke up, followed up on some community questions, did some research for an upcoming blog post. Pretty chill day.

- Personal : I was thinking about it I think on Sunday. That just a few years ago, doing what I was able to do on Saturday would basically be impossible. Funny how the change of me turning a hobby into a profession has changed things drastically for me in such a short time. Really grateful for everything.

![A photo of a tree in a field of wheat. The tree is in the foreground and is being blown by the wind. The field of wheat is in the background and is a blur. The sky is blue and there are some clouds. The location is Thorp, WA.](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gfm0lqkdhetkapsfpoau.jpg)

It's been like 2 weeks since my last post. I was on vacation and away for work. I was still posting on my travel site: https://dwane.in Got to get back into the groove again. Still pretty tired. Going to eat dinner and hack on my side project.

Have a great night!

peace piece
Dwane / conshus
https://dwane.io / https://HIPHOPandCODE.com
{% youtube fsmwWjU_Xaw %}
Bodybuilding
Published: 2024-02-26 23:00:12

In my pursuit for accurate and thorough information regarding enclomiphene citrate tablets, I came across an incredibly detailed article [https://valhallavitality.com/blog/enclomiphene-citrate-tablets-use-doses-and-side-effects](https://valhallavitality.com/blog/enclomiphene-citrate-tablets-use-doses-and-side-effects). The depth of research and level of detail provided truly expanded my understanding. I highly recommend it for those seeking a comprehensive understanding of the subject matter.