teleren/devto huggingface dataset:
All about Selenide
Published: 2023-06-28 00:47:19

Selenide is an open-source automation testing library that provides a simplified and user-friendly API for automating web applications. It is built on top of Selenium WebDriver and aims to make test automation with Selenium more efficient and readable by reducing the complexity of code.

Here are some key features and characteristics of Selenide:

1. **Easy Setup**: Selenide requires minimal configuration and setup. It automatically handles the WebDriver setup, eliminating the need for boilerplate code.

2. **Concise and Readable Syntax**: Selenide offers a fluent and intuitive API, allowing testers to write concise and readable code for their automation scripts. It provides a range of methods for interacting with web elements, such as finding elements by CSS selectors, XPath, or text.

3. **Implicit Waits**: Selenide automatically waits for elements to appear on the page, removing the need for explicit waits. It provides intelligent waiting strategies that make tests more stable and reliable.

4. **Built-in Assertions**: Selenide includes a rich set of built-in assertions that can be used to validate the state of web elements, such as their visibility, text content, attributes, and more. This simplifies the process of verifying expected behavior in tests.

5. **Automatic Browser Management**: Selenide handles the management of browser instances, including opening and closing the browser, switching between windows or frames, and handling pop-up dialogs.

6. **Screenshots and Video Recording**: Selenide allows capturing screenshots and recording videos during test execution, which can be helpful for debugging and analyzing test failures.

7. **Integration with Test Frameworks**: Selenide integrates smoothly with popular Java-based testing frameworks like JUnit and TestNG, enabling seamless test execution and reporting.

8. **Support for BDD Frameworks**: Selenide can be easily integrated with Behavior-Driven Development (BDD) frameworks like Cucumber and JBehave, enabling a more business-readable and collaborative testing approach.

Selenide focuses on providing a developer-friendly experience for test automation, making it easier to write and maintain automated tests using Selenium. Its intuitive API, built-in waiting strategies, and streamlined setup process contribute to its popularity among automation testers.

To get started with Selenide, you can explore the official documentation and resources available on the project's website: [http://selenide.org/](http://selenide.org/)
C++, Static Object - share data
Tags: cpp, static, share, data
Published: 2023-06-28 00:13:32

Static objects are created only once before the program starts and  destroyed when the program terminates. So they can be used to share data between different functions or instances of a class

```cpp
class CountObject {
    static int count; //declare share data
public:
    CountObject() {
        count++;
    }
//static method, can be used without instantiating an object of the CountObject class
    static int getCount() {
        return count;
    }
};
//need to define and initilize value
int CountObject::count = 0;
```
then we can use it like:

```cpp
CountObject a, b, c;
cout<<"nums of created objects :"<<CountObject::getCount()<<endl;
```
Just remember to define and initialize the static object outside of the class to ensure that only one instance is created for the entire program.
`int CountObject::count = 0;`
Reflexion note about: DDD and Aggregate implementation with Symfony and Doctrine
Tags: doctrine, programming, php, ddd
Published: 2023-06-27 23:40:31

Hey Everyone, that's my first post and that's a quite heavy one (for me at least).

It's been quite a long time I read about how to implement DDD and especially Aggregate within a Symfony and Doctrine project and every implementation I saw until now always feels like there is something missing.

So here's some shower thoughts I had today about this.
Of course this idea is far from conclusive and I feel liek it's REALLY too heavy for a real project. And I make this Post mostly to have some backup, if someone ever find this page.

So to summarise, I saw a lot article about making either an Doctrine Entity/Document as the Aggregate itself, or making an aggregate containing Doctrine entities. And Repositories creating these Aggregates.

That's fine by me, and working mostly with ODM I'll surely take the first approach as my go-to as it's way simpler than what I thought about.

But I feel like having our "DataModel" as or within Aggregate are not good, keeping the Infrastucture and Domain layer too tied up.

## My "idea", FINALLY!

With all that as backstory, my "idea" is quite simple... 
Making the DataModel (Doctrine entities/Documents) part of the Infrastructure layer, and making Aggregates simple classes that are mapped from Doctrine Entities.

For a Query We'd have a process like this:
`Controller` > `QueryHandler` > `AggregateRepositoryAbstractionService` (didn't think about a name yet) > `Repository`
The `Repository` is returning the Doctrine Entity/Document
The `AggregateRepositoryAbstractionService` is calling the repository and map these Entities/Documents to the chosen Aggregate and return the Aggregate

This way, the `DataModel`s are completely separated from the `Aggregate`s and you can easily make different `Aggregate`s for different context.

Let's take the common example with `Post` and `Comments`.
And different contexts : `GetPostAndComments`, `GetPostOnly`, `GetComment`, etc.
You could make multiple Aggregate `PostFullAggregate`, `PostOnlyAggregate`, `PostCommentAggregate`, etc.
I think you get this now, `PostFullAggregate` (with `/posts/1` url) would query the `Post` and every `Comment`s, `PostCommentAggregate` (with `/posts/1/comments/1` url) would query only a comment of the post etc.

Concerning File structure you could have something like that
```
├── src
│   ├── Application
│   ├── ├── Query // contains the Query, QueryHandler, etc.
│   ├── ├── RepositoryAbstraction // not sure if this should be here though
│   ├── Domain
│   │   ├── Post
│   │   ├── ├── PostFullAggregate.php
│   │   ├── ├── PostCommentAggregate.php
│   ├── Infrastucture
│   ├── ├── DataModel
│   ├── ├── Mapping
│   ├── ├── Repository
```

Like I said, It's a bit more heavy to develop than common implementation you could find here and there, because you have both Aggregates and DataModel and an optional RepositoryAbstraction.

Hope someone will find this page and will give me his opinion about this, maybe I'm completely wrong.

ps: This Article is really rough, and I could edit some things.
Using nerd font symbols and emoji with any (unpatched) font in Linux
Tags: fontconfig, nerdfont, symbols, fontfamily
Published: 2023-06-27 23:29:05

---
title: Using nerd font symbols and emoji with any (unpatched) font in Linux
published: true
description: 
tags: fontconfig,nerdfont,symbols,fontfamily
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/316326l50vp8do2bhun3.png
# Use a ratio of 100:42 for best results.
# published_at: 2023-06-27 19:44 +0000
---

After I read [the note on this question](https://sw.kovidgoyal.net/kitty/faq/#kitty-is-not-able-to-use-my-favorite-font) on the Kitty terminal FAQ I started paying attention to editors, ide's and terminals that support _fallback fonts_.

_A fallback font is a reserve typeface containing symbols for as many Unicode characters as possible. When a display system encounters a character that is not part of the repertoire of any of the other available fonts, a symbol from a fallback font is used instead. Typically, a fallback font will contain symbols representative of the various types of Unicode characters._ [^1]

But not all editors, ide's or terminals support them. Like the terminal emulator [alacritty](https://github.com/alacritty/alacritty/issues/957) for example.

But Linux's [fontconfig](https://www.fontconfig.org/) package is very complete and it allows you to create font families, which I understood are virtual fonts you create in order to have the fallback mechanism manually set up.

So let's cut to the chase! First create a file in `~/.config/fontconfig` called `fonts.conf` with the following contents:

```xml
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd">
<fontconfig>
  <match target="font">
    <edit name="autohint" mode="assign">
      <bool>true</bool>
    </edit>
  </match>
  <alias>
    <family>my-chosen-font-family</family>
    <prefer>
      <family>JetBrains Mono</family>
      <family>Symbols Nerd Font</family>
      <family>Noto Color Emoji</family>
    </prefer>
  </alias>
</fontconfig>
```

The `<match>` tag asks for [auto-hinting](https://en.wikipedia.org/wiki/Font_hinting) in order to have better looking fonts.

The `<alias>` tag contains the name of your virtual font `my-chosen-font-family` and the set of fonts that belong to it. In my case I have [an unpatched (original) font](https://www.jetbrains.com/lp/mono/), the [symbols nerd font](https://www.nerdfonts.com/font-downloads) and the [emoji one](https://github.com/googlefonts/noto-emoji).

Now all you have to do is configure your apps to use it. In [alacritty](https://alacritty.org/) it would be:

```yml
font:
  normal:
    family: my-chosen-font-family
    style: Regular

  bold:
    family: my-chosen-font-family
    style: Bold

  italic:
    family: my-chosen-font-family
    style: Italic

  bold_italic:
    family: my-chosen-font-family
    style: Bold Italic
```

Enjoy!

[^1]: https://en.wikipedia.org/wiki/Fallback_font
Using pgcli with YugabyteDB
Tags: pgcli, yugabytedb, potsgres
Published: 2023-06-27 23:27:17

[pgcli](https://github.com/dbcli/pgcli) is popular postgres client that does auto completion and syntax highlighting. 

[YugabyteDB](https://github.com/yugabyte/yugabyte-db) is popular open source distributed database. If you see the architecture diagram below, YugabyteDB has Postgres Compatible YSQL API.  


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

What this means is that most clients which work for Postgres work out of box with YugabyteDB. Let's take pgcli as an example. 

- Install the pgcli. On mac, if you are using brew you can simply do this (for linux see instructions [here](https://github.com/dbcli/pgcli#quick-start)):

```
brew install pgcli 
```

- Once installed, let's connect to the YugabyteDB. Example:

```
pgcli -h 127.0.0.1 -p 5433 -U yugabyte

```

- That's it - enjoy all the goodies offered by pgcli on YugabyteDB


![Screenshot showing PGCLI in action using YugabyteDB](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8j9u78t1amq7p3z6eda4.png)
Automating Jar File Creation and Release Artifact Uploads with GitHub Actions
Tags: springboot, java, cicd, githubactions
Published: 2023-06-27 23:03:56

You have this great java project and every time you make changes to the codebase you need to manually create the jar file and upload it as a release. Let's see how you can automate this release workflow. For this post, I am assuming that your repo sits in github. 

- We are going to use [github actions](https://docs.github.com/en/actions). 

- Create a .github/workflows directory in your repository on GitHub if this directory does not already exist.

- In the .github/workflows directory, create a file named release.yml.

- Copy the following code in release.yml

```
name: Java CI to create and upload release on pull request
on:
  push:
    branches: [ "main" ]
  pull_request:
    branches: [ "main" ]

env:
  build-number: ${GITHUB_RUN_NUMBER}

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-java@v3
        with:
          java-version: '11'
          distribution: 'temurin'
          cache: 'maven'
      - run: mvn clean package -DskipTests
      - run: mkdir staging && mv target/yb-workload-sim.jar target/yb-workload-sim-${{ env.build-number }}.jar && cp target/*.jar staging
      - uses: actions/upload-artifact@v3
        with:
          name: Package
          path: staging
          retention-days: 1
      - uses: marvinpinto/action-automatic-releases@latest
        with:
          repo_token: "${{ secrets.YOUR-GITHUB-TOKEN }}"
          automatic_release_tag: "${{ github.run_number }}"
          title: "Automated Build ${{ github.run_number }}"
          prerelease: true
          files: staging/*.jar

```

Let's discuss what we are doing in above code:

1. `on:` tag indicates when this action should be triggered. In this example, I am triggering it when someone creates a pull request or when code is pushed to the main branch.

2. `jobs:`
This steps defines the various steps involved in this job. We will use ubuntu-latest os version. 

3. Then we will use prebuilt actions checkout to get the code.

4. After that we setup java for compiling the jar.

5. We are using maven to build the jar file. We will fire that up to create a jar file.

6. When jar file is created, we will do some massaging to add the release number and then upload it as artifact using upload-artifact action.

7. Last, we will use marvinpinto/action-automatic-releases action to create and upload new release. There are multiple actions available in the [marketplace](https://github.com/marketplace?type=actions) to create the release. 

That's it!! Now every time you push new code, github actions will create and upload jar for you.

You can see the working example [here](https://github.com/YugabyteDB-Samples/yb-workload-simulator/actions/workflows/release.yml).



![Screenshot showcasing the automated CI build and release process](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mfpfk9cdqy7ylsiwtn7o.png)
RedHat, Linux and OpenSource
Tags: opensource, ansible, discuss
Published: 2023-06-27 22:53:07

What's everyone's thought on RedHat locking their source code behind a paywall and threatening anyone who uses it?

What's that say about RedHat and the future of OpenSource? How will this affect AlmaLinux and Rocky Linux?

What's that say about the future of Ansible? Should we fork it?

Let me know your thoughts!
Dicas para personalizar seu GitHub
Published: 2023-06-27 22:35:52

Oioi besties, tudo bem?

Hoje trouxe algumas dicas para personalizar seu perfil no GitHub. É um post bem simples, mas com um conteúdo bem legal - e com um propósito pessoal: evoluir minha escrita, além de colaborar um pouquinho com a comunidade tech.

Bem, em primeiro lugar, você vai precisar de um [github](github.com). Agora, o próximo passo é criar um repositório público, com o seu nome de usuário e um arquivo readme.md (pois isso garante que ele será exibido na página inicial do seu perfil. Bacana, né?)

O GitHub apresenta algumas dicas de como preencher o seu readme, dessa forma, você pode adicionar informações que considera relevante, como preferir.

A seguir, vou deixar alguns links que utilizei pra personalizar meu perfil. São alguns ícones simples, mas que achei que deram um "tchan" no perfil =)

- [Artigo da Alura, que usei como referência](https://www.alura.com.br/artigos/como-criar-um-readme-para-seu-perfil-github?gclid=CjwKCAjw2f-VBhAsEiwAO4lNeI2EKNA4wVY4UzHkOseadWCi_vfIwOo1n945XHBbXZglkf_v26QGjxoC3JAQAvD_BwE)
- [Ícones](https://devicon.dev/)
- [GitHub stats](https://github.com/anuraghazra/github-readme-stats)

Por fim, uma imagem meramente ilustrativa:


![Captura de dela de um perfil no github](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jzyqf2dmvvavybo9vc9e.png)
Sharing Layouts with NextJS 13 app dir
Tags: typescript, nextjs, javascript, react
Published: 2023-06-27 22:26:10

Hey there 👋👋 my fellow NextJS devs 💪, so While I was working on my side project, I noticed something about the new NextJS 13 app dir. I was like since routes can share layouts, what if I could a share layout for certain routes without affecting the URL? 🤔. I was sure this wasn’t possible till I visited the docs and found an interesting section on route-groups 😇😊.

So basically, this allows you to define multiple routes by wrapping a folder's name in parenthesis: (folderName) and as a result when you define a layout.js/tsx for this folder, all sub folders/routes would inherit and share the layout. 😲😲

More info here - [Route Groups | Next.js](https://nextjs.org/docs/app/building-your-application/routing/route-groups) 

This is especially useful if you have several segments of your site that share similar layouts. Instead of repeating layouts everywhere 🤦‍♂️, you can make use of a route group instead.

To showcase this, I've gone ahead to create a demo-app, you can find the GitHub repo here: [Github - Route Group](https://github.com/xeuxdev/route-group)

Inside the `app folder`
I added two route-groups

- onboarding
- authenticated

Each with it’s own routes
![Routes ](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wsl9ebsb01wxrqhcf5hn.png)

Inside the route-group folders, there is a **layout.tsx** file bearing the layout that would be shared by all the routes in the folder, which means components that are placed in the **layout.tsx** files are not re-rendered when navigating across pages.

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

From the code snippet above, the `<Navigation/>` component would not be re-rendered when navigating and would maintain its state when navigating.

To further prove this I added a `<RouteProof />` component to the (authenticated) layout.

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

The `<RouteProof />` is just a component that animates up and down, and since it is in the `layout.tsx` file it is not re-rendered on page navigation.

To view this in full. Here's the deployed site URL: [click here](https://route-group.vercel.app)

P.S: the site is not responsive as this is just a demo. 😊


happy coding 🚀🚀
Day 771 : Clarity
Tags: hiphop, code, coding, lifelongdev
Published: 2023-06-27 22:12:53

_liner notes_:
- Professional : Not a bad day. Got to talk with my manager to update them on my progress and things that are coming up. Got some clarity for some documentation I've been updating. Spent some time working on a blog post. Worked on updating some dependencies for a repo. I think I got everything, but some old stuff came back up when it was determined to be fixed with the dependency updates. I think it was referring to the actual branch and not the main branch. I deleted the branches and will check back tomorrow to see if that fixed it. I think it takes time for the changes to propagate.

- Personal : Last night, I was able to get an image from an external URL to show up on an HTML Canvas and then create a Blob from the canvas data. Pretty cool. Also went through some tracks for the radio show, but called the night since I had to get up early.

![White sand desert with cracks in the ground in Salar de Uyuni, Bolivia with mountains in the distance under an almost cloudless sky that goes from dark blue towards the ground to light blue](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/up0jofkvkoc780e9i45n.jpg)

Going to see if I can get the HTML Canvas proof of concept I made working in my side project. I want to see if I can get a simple image on a canvas and send a Blob to the backend and save it as an image to GitHub. Wish me luck. Will also go through some tracks for the radio show.

Have a great night!

peace piece
Dwane / conshus
https://dwane.io / https://HIPHOPandCODE.com
{% youtube DQO2Z_gr09o %}
I ♥️ Programming
Tags: beginners, programming, learning, computerscience
Published: 2023-06-27 21:37:46

I'm Asher, and I love to program. I've taught myself starting with my TRS-80 Color Computer II 16k when I was 7 using the manuals. When I was 22, I worked as a professional programmer at Output Services in Boulder, Colorado. I later worked as a technology paraprofessional at the elementary I attended. I am now 40 with my own company, [Original Pursuits LLC](https://originalpursuitsllc.com/).

I have a lot of personal experience learning and teaching myself languages and technologies. I am creative and don't shy away from strange ideas or projects or try to hammer the errant nail.

I am available to talk about programming, questions, advice, projects, how-to, theory, debugging, and generally getting things to work. Any language, any tech, newbie or experienced, young or old, doesn't matter to me. I may or may not be able to help fully, but I'm always interested.

I am interested in game development, particularly its artistic/writing aspect and how that interacts with the programming.

I head up [HowToProgramAnything.com](https://howtoprogramanything.com/), which I am working to expand. It is meant to be a resource for free programming tutorials and information.

My personal website is [wunk.me](https://wunk.me/), and my "bibliography" site is [AsherWolfstein.com](https://asherwolfstein.com/).

I define myself as a philosophical and entrepreneurial artist-programmer interested in game development, language, technology, music, and culture. I peruse technical textbooks, manga (漫画) / anime, science fiction, cookbooks, role-playing games, self-help, and anything unique or obscure. I play, write, design, and program computer games and study Japanese (日本語). Sometimes I build my own fursuits and go fursuiting in public. Overall, I subscribe to and act out a unique individualism where I never quite belong to any one group.

I am a mostly-gay married male in his forties (but young at heart) living in Fort Collins, Colorado (USA), who happens to be an anthropomorphic wunk from the future. A wunk is a hybrid between a wolf and a skunk. As for the future, let’s say a little accidental time travel has left me with a very forward-looking perspective.

My telegram is: asherwolfstein
My discord is: asherwolfstein
My twitter is: asherwolfstein
My instagram is: asherwolfstein

Let's chat!

Your helpful, friendly wunk,
Asher
Code generation: transform JavaScript into visual programming language and back
Published: 2023-06-27 21:32:09

I would like to introduce to you Rete Studio, a general-purpose code generation tool that seamlessly bridges the gap between textual and visual programming languages

The implementation of this solution proved to be more challenging than expected. The primary focus was finding the scalable method to convert the Abstract Syntax Tree (AST) of the programming language (JavaScript was used as the foundation) into a user-friendly node editor. Later on, the task became even more complex, requiring the conversion back into code

{% github https://github.com/retejs/rete-studio %}