teleren/devto huggingface dataset:
How to Upgrade From Laravel 9.x to Laravel 10.x
Tags: laravel, laravelframework, php, webdev
Published: 2023-02-25 01:18:30

---
title: How to Upgrade From Laravel 9.x to Laravel 10.x
published: true
date: 2023-02-16 16:06:46 UTC
tags: laravel,laravelframework,php,webdevelopment
canonical_url: https://blog.devgenius.io/how-to-upgrade-from-laravel-9-x-to-laravel-10-x-926b826b454f
---

[![](https://cdn-images-1.medium.com/max/1418/1*Rz8ddPLKGZJ0VwEDrAXmgA.png)](https://blog.devgenius.io/how-to-upgrade-from-laravel-9-x-to-laravel-10-x-926b826b454f?source=rss-17217f29618a------2)

Laravel creates an admin panel from scratch — Laravel 10 Upgrade Guide— Part 23

[Continue reading on Dev Genius »](https://blog.devgenius.io/how-to-upgrade-from-laravel-9-x-to-laravel-10-x-926b826b454f?source=rss-17217f29618a------2)
How to generate and launch RSpec specs with VsCode (ChatGPT included)
Published: 2023-02-16 16:01:05

Ruby, Rails, and RSpec are incredibly powerful tools that have greatly facilitated the process of backend development. However, despite the impressive capabilities of Rails and its CLI, there are instances where creating test files from scratch is necessary, such as when dealing with GraphQL queries, or when launching tests through shell scripts.

As a skilled 😎 developer, automation was the obvious solution for me. So, I utilized VSCode tasks to automate the process, and now it works seamlessly

VSCode tasks provide a convenient way to launch processes and run scripts directly from the VSCode palette. Additionally, it is possible to bind keybindings to these tasks for even quicker access.

1. To set up VSCode tasks for your Ruby project, first create a .vscode file at the root of your project directory. Then, create a .tasks.json file within this directory to define your tasks as follow: 

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


2. Then Add these following line to your tasks.json


```
  "tasks" : [
    {
      "label":"Open/Create test",
      "type": "shell",
      "command": "code spec/\`ruby -e 'puts 
\"${relativeFileDirname}\"
.sub(/app/,\"\")'\`/${fileBasenameNoExtension}_spec.rb",
      "problemMatcher": "$ruby"
    },

    {
      "label": "Run RSpec Test",
      "type": "shell",
      "command": "rspec ${file}"
    }
  ]
```
The following line can be a little bit cryptic at a first sight : 
```
"code spec/\`ruby -e 
'puts\"${relativeFileDirname}\"
.sub(/app/,\"\")'\`/${fileBasenameNoExtension}_spec.rb"
```

In essence, this code parses the path of your current file in VSCode, removes the 'app' directory from your Rails project, replaces it with 'spec', and appends 'spec' at the end of the file path. This enables you to maintain a consistent tree structure in both your app and spec directories. Although I chose to implement this in Ruby for fun, it can be written in any programming language of your choice. 


3. And there you go you can now with the palette run your task by: 
(In the palette) Tasks: Run Task > Open/Create Test for example.

But you can take it a step further and define a keyboard shortcut for your VSCode tasks. To do this, navigate to the palette and select 'Open Keyboard Shortcuts (JSON)'. 

Then, add the appropriate keybindings to your keybindings.json file. Note that the 'args' field is crucial for enabling VSCode to find and execute the specified task."
```
{
        "key": "cmd+shift+r",
        "command": "workbench.action.tasks.runTask",
        "args": "Run RSpec Test"
    },
    {
        "key": "cmd+shift+v",
        "command": "workbench.action.tasks.runTask",
        "args": "Open/Create test"
 }
```

PS: I tried to improve the code with ChatGPT but it did not do the actual things I wanted. 
If you have any feedback or suggestions for improvement, please feel free to leave a comment or suggestion. I'm open to all ideas and would love to hear your thoughts!🙈
10 Reasons You Should Contribute To Open Source Projects
Tags: opensource, osdc, programming
Published: 2023-02-16 15:55:00

## 1. Advancement in your Career
Open-source software provides an opportunity to practice your programming skills. Writing documentation, identifying issues, and fixing bugs inevitably boost your career. A junior developer can also learn to write code that is readable and maintainable.

## 2. Become a better communicator
By joining a community of like-minded people and participating in open source projects, you learn to give suggestions, explain problems clearly, and communicate because of the level of cultural diversity.

## 3. Mentorship from more experienced developers
As a member of an active open-source community, you get to work with like-minded people and learn from and gain feedback from more accomplished and above-average programmers.

## 4. Enhance your Technical skills
Contributing to free and open-source projects trains you to conform to the norms, rules, and best practices associated with the project. You also become better at interpreting other people's code or understanding how codebases work.

## 5. Grow Your Network
By joining an open-source community, you gain new acquaintances, learn from them, and exchange ideas, as well as broaden your professional horizons.

## 6. Get Job offers
The benefit of joining an open source community is that visitors to the open source project you contribute to can offer you a job or employment. In the same way, it can also improve your career prospects.

## 7. Enhance your portfolio and resume
Gaining experience in open-source software can help you secure employment. A hiring manager is more likely to recruit a developer who actively participates in open source than a more certified candidate with no open source experience.

## 8. Asynchronous Collaboration and Remote work experience
You gain remote work experience and learn how to work on a project more efficiently as a team when you are part of an open-source community.

## 9. Gain Credibility and Recognition in the technology industry
Generally, open-source contributions build your reputation as a great developer. Recognition from the open-source community can also motivate you to improve your skills and make a greater impact.

## 10. Become a better person
Getting in involved in an open-source project exposes you to a multicultural environment. This enables you to become a better individual as you learn to be empathetic, thoughtful, and tolerant.

Thanks for reading! If you have any follow-up questions, feel free to ask them in the comment section.
Testing the styles of DOM elements with React Testing Library
Tags: webdev, react, testing
Published: 2023-02-16 15:49:01

Photo by <a href="https://unsplash.com/@ro_ka?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Robert Katzki</a> on <a href="https://unsplash.com/photos/jbtfM0XBeRc?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Unsplash</a>
  
Sometimes -or often, depending on the case- we need to test some particular style that can change depending on some property.
The way this is implemented depends on the library we use for the styling.

Supposing that we have some text, inside a component, that depending on the prop it's white or black.
In the DOM, it will reflect this way. However, especially as it's not a fixed element, we should test how it behaves on different pages.

The test itself using React Testing Library is very simple because it checks directly the DOM:
```js
  render(<MyComponent>)
  
  const text = screen.getByText('text in the page')
  expect(text).toBeInTheDocument()
  expect(text).toHaveStyle({ color: '#FFFFF'})
```

The library converts the colour in hex code against RGB, so if they match, the test will pass; otherwise, it will return the returned RGB colour (i.e. 0,0,0) and the expected one (i.e. 255,255,255). With it, it's very easy to spot the mistake, or why a test is failing.

We can also test directly the prop that we're passing and the consequent change of colour in the component:
```js
  const {rerender} = render(<MyComponent changingProp='white'>)
  
  expect(screen.getByText('text in the page')).toHaveStyle({ color: '#FFFFF'})
  
  rerender(<MyComponent changingProp='black'>)
  
  expect(screen.getByText('text in the page')).toHaveStyle({ color: '#00000'})
```

You have to notice here that I had to call screen.getByText twice, because that function is returning immediately the DOM element. If I would set it as before in a variable, at the moment of checking 'text' the second time, it would have stored the previous DOM element and not the updated one.


Thank you for reading! Let's connect on [Twitter](https://twitter.com/AlexBuaiscia)
Manipulando Set no Redis
Tags: redis, braziliandevs, tutorial, programming
Published: 2023-02-16 15:48:40

## Introdução

No Redis a estrutura de dados Set é uma coleção não ordenada de strings únicas. Ela pode ser utilizada para, por exemplo:

1. Rastreie itens exclusivos (por exemplo, rastreie todos os endereços IP exclusivos que acessam uma determinada postagem de blog).
2. Representar relações (por exemplo, o conjunto de todos os usuários com um determinado papel).
3. Realize operações de conjuntos comuns, como interseção, uniões e diferenças.

## Comandos básicos:

1. `SADD`: adiciona um novo membro a um conjunto.
2. `SREM`: remove o membro especificado do conjunto.
3. `SISMEMBER` : testa uma cadeia de membros do conjunto.
4. `SINTER` : retorna o conjunto de barras que dois ou mais conjuntos têm em comum (ou seja, a interseção).
5. `SCARD` : retorna o tamanho (também conhecido como cardinalidade) de um conjunto.
6. `SMEMBERS`: retorna todos os membros do valor definido armazenado na chave.
7. `SSCAN`: retorno é um array de dois valores: o primeiro valor é o novo cursor a ser usado na próxima chamada, o segundo valor é um array de elementos.

## Desempenho

A maioria das operações de conjunto, incluindo adicionar(`SADD`), remover(`SREM`) e verificar se um item é um membro do conjunto(`SISMEMBER`), são O(1). Isso significa que eles são altamente eficientes. 

No entanto, para grandes conjuntos com centenas de milhares de membros ou mais, você deve ter cuidado ao executar o comando `SMEMBERS`. Este comando é O(n) e retorna o conjunto inteiro em uma única resposta. Como alternativa, considere o `SSCAN`, que permite recuperar todos os membros de um conjunto iterativamente.
Announcing Harvest Timer and Work Logs for Jira Cloud
Tags: harvest, jira, atlassian, timetracking
Published: 2023-02-16 15:47:43

NASHVILLE, January 16, 2023 – Twin Sun is pleased to announce the launch of [Harvest Timer and Work Logs for Jira Cloud](https://twinsunsolutions.com/products/harvest-timer-work-logs-for-jira-cloud/), a new time-saving app that helps teams sync their Harvest time entries with their Jira work logs. 
This app allows users to see up-to-date time tracking estimates within Jira, ensuring that team members know how much time has been spent on each task.

With Harvest Timer and Work Logs for Jira Cloud, users can start and stop Harvest timers from any Jira issue details screen, and add manual Harvest time entries if necessary.
The app also offers project-specific defaults so team members can quickly log time to the appropriate Harvest task within each Jira project.


![Our Harvest Timer and Work Logs for Jira Cloud app in action.](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rb1b27qpqi4lhwjlocqs.png)

Twin Sun uses Harvest for time tracking but wanted to see time logged to Harvest reflected in Jira. 
That's why they created this app: to make it easy for teams to sync their Harvest time entries with their Jira work logs, and to see up-to-date time tracking estimates within Jira.

<blockquote>
    <p>
        We are thrilled to be able to offer this app to teams everywhere. 
        We know firsthand how frustrating it can be to juggle multiple tools for time tracking and work logging. 
        With Harvest Timer and Work Logs for Jira Cloud, we've created a solution that simplifies the process and helps teams stay organized and on top of their tasks.
    </p>
    <p class="citation">
        Jami Couch, CTO
    </p>
</blockquote>

Find the [Harvest Timer and Work Logs for Jira Cloud on the Atlassian Marketplace](https://marketplace.atlassian.com/apps/1229874/harvest-timer-and-work-logs-for-jira) and streamline your team's time tracking today.
Python challenge_21🐍⚔️
Tags: python, challenge, beginners, webdev
Published: 2023-02-16 15:47:13

## Two Sum

- Given an array of integers nums and an integer target, 
Return indices of the two numbers such that they add up to target.

- You may assume that each input would have exactly one solution, 
And you may not use the same element twice.

- You can return the answer in any order.


### Example 1:

Input: nums = [2,7,11,15], target = 9
Output: [0,1]
Output: Because nums[0] + nums[1] == 9, we return [0, 1].

###### Task URL: https://leetcode.com/problems/two-sum

#### My Solution: 

```
def towSum(nums, target):
    pre_map = {}

    for i, n in enumerate(nums):
        diff = target - n

        if diff in pre_map:
            return [pre_map[diff], i]

        pre_map[n] = i

print(towSum([2, 10, 7, 11, 15], 9))

```

###### Learn Python 

🎥 {% youtube 2VRXU2H4q0c%}

### Connect with Me 😊

#### 🔗 Links

[![linkedin](https://img.shields.io/badge/linkedin-0A66C2?style=for-the-badge&logo=linkedin&logoColor=white)](https://www.linkedin.com/in/mahmoud-el-kariouny-822719149/)

[![twitter](https://img.shields.io/badge/twitter-1DA1F2?style=for-the-badge&logo=twitter&logoColor=white)](https://twitter.com/Mahmoud42275)
Why Design Patterns ?
Tags: programming, design
Published: 2023-02-16 15:36:10

As a developer, as we work on enterprise application problems using a programming language. We document the best practices & common recurring problems and proven solutions to those problems.

- The recurring problems and ready-made solutions which can be applied universally are **Design Patterns**

## Design Patterns

- Helps to identify recurring problems + Ready-made solution to it.

Example: If you want to create one instance of the class no matter how many times the objects have been created, we can use a design pattern.

- Idea of design pattern was born in Civil Engineering.
- Gang of Gour have popularized design patterns through their book. 

## Why Design Patterns

1. Reuse of particular situation & solution.
2. Application Structure will get better.
3. As it is proved and used universally, any developer can understand the flow of Application easily.
4. Provides common language across all community.

## Types Of Design Patterns

Types of design pattern depends on the problem.

1. Core pattern catalogue.
2. Java EE patterns catalogue.

Core pattern catalogue - 
1. Creational Design Pattern
  (Deals with problem's related to Object creation)                        
2. Structural Design Pattern
   (Deals with problem's related to Relationship between classes)                   
3. Behavorial Design Pattern                            
   (Deals with problem's related to communication should happen 
    between objects and classes)              
                            
                              
![Figure depicts Types of Design patterns](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yr767ljvwurhnwg5z5jh.PNG)


## How To Study & Use Design Patterns?

After learning the basics of object-oriented programming, one should follow the three-step learning process given below:

Acceptance: First, try to accept the fact that design patterns solve commonly occurring problems in object-oriented software design. Hence, when we are developing any object-oriented software we should not complicate the process by reinventing the wheel.

Recognition: Recognize the importance of following the best practices while developing object-oriented software applications. Read about the problems that are solved using design patterns and identify similar problems in your own development work. In this way, we may find a way to use these design patterns efficiently.

Internalization: Once a suitable design pattern is identified for our software application, we can try to implement it and add it internally to our application in such a way that it provides reusability, manageability, and extensibility.
Install PostgreSQL on Arch | Manjaro | Garuda Linux
Published: 2024-01-24 14:41:05

---
title: Install PostgreSQL  on Arch | Manjaro | Garuda Linux
published: true
date: 2023-02-16 15:34:14 UTC
tags: 
canonical_url: https://andwati.github.io/blog/install-postgresql-15-on-arch-manjaro-garuda-linux/
---

Getting PostgreSQL up and running on Arch Linux-based distros
NFT Marketplace Blur Releases Native Token for Community Ownership
Tags: cryptocurrency, blockchain
Published: 2023-02-16 15:18:05

After months of anticipation, zero-fee non-fungible token (NFT) marketplace Blur released its native token Tuesday.
The token will allow traders to participate in the platform’s governance protocol, as well as profit from the marketplace’s success through community ownership.
Blur said in a tweet that traders have 60 days to claim their airdropped BLUR tokens, which are trading at roughly 50 cents at press time, according to CoinGecko.
“Since launching [four] months ago, 146,823 users have traded $1.2 billion dollars [sic] worth of NFTs on Blur (wash trading excluded),” Blur said in a tweet. “This growth is breathtaking and was only possible with the support of the Blur community.”
According to data from DappRadar, Blur’s 24-hour trading volume stands at about $9.5 million, second only to leading marketplace OpenSea, whose trading volume is around $12 million.
NFT traders have been awaiting the BLUR token’s release since the platform went live. Originally set to release in January, Blur has been airdropping its token since October through “care packages” to collectors who have traded an Ethereum-based NFT in the past six months. On Tuesday, Blur delayed their token-launch by 90 minutes, warning collectors to be aware of potential phishing attempts and scam links.
Blur launched in October with a strategy to cater to professional NFT traders with a zero-fee marketplace. In its first 24 hours, it conducted $2.5 million in trading volume, creeping up on OpenSea’s trading volume. While the royalty-optional marketplace has added fuel to the fire to the ongoing debate among creators and marketplaces, it has continued to trail behind OpenSea’s trading volume numbers.
Launched in October, Blur's strategy is to cater to the needs of professional NFT traders in the zero-fee market, which has led to many NFT games having partnerships with them, such as CryptoKittes, F-Cat crypto game and other games. In the first 24 hours, his trading volume...
Migrating to Eleventy 2.0
Tags: webdev, jamstack
Published: 2023-02-16 15:16:00

Last week I finally upgraded my [Eleventy](https://www.11ty.dev/) instance after using version 0.12.1 for over a year. I tried to do this earlier but always gave up because I stumbled upon this or that issue. This time was no different, but I was determined to resolve all problems.

## Issues

The primary issue when updating to the new Eleventy was my templating language - Liquid. I chose Liquid because I am familiar with it since I work with Jekyll and Shopify every now and then.

The first issue that occurred was:

```bash
illegal filename "undefined" (via AssertionError)
```

After a quick investigation, I decided to switch to my own instance of Liquid library, as [documented on the Eleventy site](https://www.11ty.dev/docs/languages/liquid/#optional-set-your-own-library-instance).

I added the following code:

```js
const { Liquid } = require("liquidjs");

module.exports = (eleventyConfig) => {
  let options = {
    extname: ".liquid",
    dynamicPartials: false,
    strictFilters: false,
    jsTruthy: true,
    root: ["site/_layouts"]
  };

  eleventyConfig.setLibrary("liquid", new Liquid(options));
}
```

The most important part here is the `dynamicPartials: false` setting which resolves common pitfalls if you include partials without quotation marks.

Next issue was:

```bash
unexpected token at "{{ read.date ..." (via AssertionError)
```

I was using a variable inside the `assign` statement in Liquid, like so:

```liquid
{% assign readHref = {{ read.date }} | prepend: '#' %}
```

All I had to do is to remove the curly brackets around the variable:

```liquid
{% assign readHref = read.date | prepend: '#' %}
```

The final issue I had was:

```bash
Failed to lookup "../../assets/dist/css/devcards.min.css" in "site/_layouts" (via Error)
```

Apparently, Liquid can only look up files within the root folder defined in the configuration. The workaround was to define a new custom Liquid filter that returns the content of the file like so:

```js
eleventyConfig.addLiquidFilter('getCritical', (critical) => {
  return fs.readFileSync(`./assets/dist/css/${critical}.critical.min.css`)
}
```

And that's it. After resolving these issues, I could finally use the new version of the Eleventy static site generator.

For anyone interested, here's the full commit: <https://github.com/maliMirkec/personal-website/commit/f18c059ead7abf166f99715261638ccf9944cf5f>.
NFT Marketplace Blur Releases Native Token for Community Ownership
Published: 2023-02-16 15:15:35

NFT Marketplace Blur Releases Native Token for Community Ownership
After months of anticipation, zero-fee non-fungible token (NFT) marketplace Blur released its native token Tuesday.
The token will allow traders to participate in the platform’s governance protocol, as well as profit from the marketplace’s success through community ownership.
Blur said in a tweet that traders have 60 days to claim their airdropped BLUR tokens, which are trading at roughly 50 cents at press time, according to CoinGecko.
“Since launching [four] months ago, 146,823 users have traded $1.2 billion dollars [sic] worth of NFTs on Blur (wash trading excluded),” Blur said in a tweet. “This growth is breathtaking and was only possible with the support of the Blur community.”
According to data from DappRadar, Blur’s 24-hour trading volume stands at about $9.5 million, second only to leading marketplace OpenSea, whose trading volume is around $12 million.
NFT traders have been awaiting the BLUR token’s release since the platform went live. Originally set to release in January, Blur has been airdropping its token since October through “care packages” to collectors who have traded an Ethereum-based NFT in the past six months. On Tuesday, Blur delayed their token-launch by 90 minutes, warning collectors to be aware of potential phishing attempts and scam links.
Blur launched in October with a strategy to cater to professional NFT traders with a zero-fee marketplace. In its first 24 hours, it conducted $2.5 million in trading volume, creeping up on OpenSea’s trading volume. While the royalty-optional marketplace has added fuel to the fire to the ongoing debate among creators and marketplaces, it has continued to trail behind OpenSea’s trading volume numbers.
Launched in October, Blur's strategy is to cater to the needs of professional NFT traders in the zero-fee market, which has led to many NFT games having partnerships with them, such as CryptoKittes, F-Cat crypto game and other games. In the first 24 hours, his trading volume...