teleren/devto huggingface dataset:
See the History of a Method with git log -L
Tags: nablopomo, programming, git, ruby
Published: 2023-11-05 16:31:34

---
title: See the History of a Method with git log -L
published: true
date: 2023-11-03 00:00:00 UTC
tags: nablopomo,programming,git,ruby
canonical_url: http://calebhearth.com/git-method-history
---

Git can “trace the evolution” of a specific method when passed `-L` using the `:<funcname>` variant. Let’s take a look at the history of this blog’s posts’ `published` scope, which is used in most places that articles are listed out. You can see that git is able to identify the boundaries of the method even as the length changes and it prints out the full method with diff from each commit in the log, which is filtered to changes to that method.

 

```diff
$ git log -L :self.published:app/models/post.rb -n3
commit d1fbdf3b9a5bd37dd49d61c61ee0f51c75fdb806
Author: Caleb Hearth <caleb@calebhearth.com>
Date:   Thu Feb 2 16:36:34 2023 -0700

    Decree, LFW, new homepage, RSS-only posts

diff --git a/app/models/post.rb b/app/models/post.rb
--- a/app/models/post.rb
+++ b/app/models/post.rb
@@ -15,6 +15,6 @@
   def self.published
     all
-      .reject { _1.frontmatter[:draft] }
+      .reject { _1.frontmatter[:draft] || _1.tags.include?("rss-only") }
       .select { _1.date <= Date.today }
   end
```

[Read more](http://calebhearth.com/git-method-history)
How Do You Make Friends?
Tags: discuss, codenewbie, beginner
Published: 2023-11-03 00:00:00

---
published_at : 2023-11-03 00:00 +0000
---
What strategies have you found effective for making friends and building a social life in a new place, especially when you don't initially know anyone?

Follow the [CodeNewbie Org](https://dev.to/codenewbieteam) and [#codenewbie](https://dev.to/t/codenewbie) for more discussions and online camaraderie!

*{% embed* https://dev.to/codenewbieteam *%}*
DevX Status Update
Tags: puppet, community
Published: 2023-11-03 16:29:00

---
title: DevX Status Update
published: true
date: 2023-11-03 00:00:00 UTC
tags: puppet, community
canonical_url: https://puppetlabs.github.io/content-and-tooling-team/blog/updates/2023-11-03-devx-status-update/
---

## Hope you all had a Spooky Halloween!

Well, that’s Halloween done and dusted, I hope you all had fun and squeezed in as much as you could.

To anyone with lingering regrets over not having as much fun as they could, Christmas is now right around the corner, or Thanksgiving if your living in the US, so it’s almost time to start getting ready for that.

## puppet-lint and rspec-puppet

To follow up on what we talked about on the last blog, we spent the last week openly discussing our plans in regards to what what names our gems will be released under going forward. After going over all of our options we have decided to firmly establish a naming convention that we will follow going forward, the above gems being renamed to `puppetlabs-lint` and `puppetlabs-rspec` with their repo and cli fllowing.

While this may be inconveniant in the short term it is our goal to, by having a clearly defined naming convention, reduce complications going forward in the future.

## Community Contributions

We’d like to thank the following people in the Puppet Community for their contributions over this past week:

- [`pdk-templates#515`](https://github.com/puppetlabs/pdk-templates/pull/515): “Allow puppet-lint fail\_on\_warnings to be disabled”, thanks to [nabertrand](https://github.com/nabertrand)
French Fridays for Developers - 017
Published: 2023-12-14 18:51:45

---
title: French Fridays for Developers - 017
published: true
date: 2023-11-03 00:00:00 UTC
tags: 
canonical_url: https://gingerkiwi.dev/blog/2023-11-03-french-fridays-for-developers-017/
---

In March, 2023 I started French for Devs Fridays to celebrate getting to 400 days on Duolingo. Today marks 643 days! Here you'll find weekly useful and/or amusing French phrases for developers.

Today's quote is cybersecurity related - because both the Toronto Public Library and the British Library have been victims of ransomware attacks. All us devs in Toronto and anyone else that were using O'Reilly eBooks through TPL for professional development and reference have been out of luck since last weekend.

Today is my:

- 🇫🇷 **643rd day of French** ,
- 🇳🇱 302nd day of Dutch,
- 🏴󠁧󠁢󠁷󠁬󠁳󠁿 141st day of Welsh,
- 🇩🇪 63rd day of German,
- 🇳🇴 57th day of Norwegian,

Here's this week's French for Devs quote and translation.

Week 16, 29 septembre 2023

> _«Traitez votre mot de passe comme votre brosse à dents. Ne laissez personne d’autre l’utiliser et achetez-en un nouveau tous les six mois.»_ <br> ~ Clifford Stoll

English: French for Devs #017, November 03 2023

_"Treat your password like your toothbrush. Don’t let anybody else use it, and get a new one every six months._"<br> ~ Clifford Stoll
Simple ci/cd to deploy a static React/Vitejs project on AWS S3
Tags: aws, s3, cicd, react
Published: 2023-11-02 23:59:50


**Requirements**: docker installed and aws account previously created

[create AWS account](https://aws.amazon.com/pt/resources/create-account/)

[install docker](https://docs.docker.com/get-docker/)

for this case, we will create a React project using Vite

`yarn create vite react-docker-aws --template react-ts`

run this command after the project has been created to install all dependencies

`yarn`

then run the following command to make sure the project is running

`yarn dev`

now, it's time to create our pipeline to deploy the project on AWS. Create a folder called ".github" at the root of your project, inside of it create a folder called "workflows", and inside of it a file with the name you prefer, but for this case, we will use the "deploy-to-aws-s3.yml"

it will be our pipeline to deploy

`name: Deploy to AWS S3

on:
  push:
    branches:
      - main

jobs:
  deploy:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout code
        uses: actions/checkout@v2

      - name: Setup Node.js
        uses: actions/setup-node@v2
        with:
          node-version: 16

      - name: Install dependencies
        run: npm install

      - name: Build React app
        run: yarn build

      - name: Configure AWS credentials
        uses: aws-actions/configure-aws-credentials@v1
        with:
          aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
          aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
          aws-region: us-east-1

      - name: Deploy to S3
        run: aws s3 sync dist/ s3://react-docker-aws
`

to find or create your AWS access keys you can follow this [approach](https://www.msp360.com/resources/blog/how-to-find-your-aws-access-key-id-and-secret-access-key/#:~:text=1%20Go%20to%20Amazon%20Web,and%20Secret%20Access%20Key)%20option.)

`aws-region` is the region you prefer to host your project, usually the `us-east-1` is cheaper

in the last line on the run: `dist` will be your folder if you create and build a Vitejs project, if you used create-react-app then it will be the build folder, and "s3://react-docker-aws" is your bucket name on AWS
SOLID Principles
Tags: webdev, programming, tutorial, learning
Published: 2023-11-02 23:57:00

## Solid

In the world of software development, the search for best practices is incessant. Among the various methodologies and techniques that have emerged over the years, one stands out: the SOLID Principles. This acronym, which represents five fundamental principles for developing robust and flexible software, has revolutionized the way programmers approach their projects.

The SOLID Principles were formalized by Robert C. Martin, also known as Uncle Bob, in his book "Agile Software Development". This set of principles aims to provide clear guidelines for code design, making software easier to maintain, extend, and understand over time. In this article, we will explore each of the five SOLID principles: 
* **SRP** (Single Responsibility Principle);
* **OCP** (Open/Closed Principle);
* **LSP** (Liskov Substitution Principle);
* **ISP** (Interface Segregation Principle);
* **DIP** (Dependency Inversion Principle);

## Conclusion

By understanding and applying SOLID Principles in software development, programmers can create systems that are more robust, flexible, and easier to maintain. These principles not only promote code cohesion and flexibility, but also facilitate collaboration between development teams and promote component reusability. In a constantly evolving technological landscape, adopting SOLID Principles is essential to building high-quality software that meets user and market demands. Therefore, investing time and effort to understand and apply these principles is a fundamental step for any developer seeking excellence in their work.

***

## Thanks for reading!

If you have any questions, complaints or tips, you can leave them here in the comments. I will be happy to answer!

😊😊 See you later! 😊😊

***

## Support Me

[Youtube - WalterNascimentoBarroso](https://www.youtube.com/channel/UCXm0xRtDRrdnvkW24WmkBqA)
[Github - WalterNascimentoBarroso](https://github.com/walternascimentobarroso)
[Codepen - WalterNascimentoBarroso](https://codepen.io)
L'UX accessible avec Gérôme Grignon
Tags: a11y, ux, frontend, html
Published: 2023-11-02 23:31:05


![UX définition](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/155jxswoq15riom1ii9h.png)

Prenons le _contexte d'un jeu vidéo_.

Nous avons toujours un personnage secondaire qui nous aide à comprendre les mécanismes du jeu.
🐼 Si nous faisons le parallèle sur le web, ce serait l'**accessibilité**.

Nous retrouvons aussi l'interface du jeu qui sera pensée par l'UX Designer.
Pour finir, la performance du jeu doit être irréprochable pour une meilleure immersion.
🐼 Les devs bichonnent leur code pour obtenir des bons scores sur les métriques des **Core Web Vitals**.

Je vous laisserai approfondir le sujet des Core Web Vitals via le talk de Nicolas Frizzarin (rediffusion sur la chaîne Youtube du DevFest 2023 de Nantes).

> Aujourd'hui, nous allons regarder d'un peu plus près l'accessibilité avec la célèbre petite fée: Navi.

Ces planches découlent de l'excellent talk de Gérôme Grignon.

![Gérôme au DevFest de Nantes 23](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/br1j1irxqcv1qb44nj5j.png)
___

## Imaginez ...

> que **Navi** représente un lecteur d'écran utilisé sur votre site web par votre utilisateur.

**ARIA** (**A**pplications **I**nternet **R**iches et **A**ccessibles)

![Navi pète un câble](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fu0pzmtsqjzfih37e8t5.png)

![Calme toi Navi!](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k6kfwy61tyz1lh4yv726.png)

Les éléments sémantiques HTML disposent de fonctionnalités de navigation au clavier, de rôles et d'états définis en standard.

🐼 Mal utilisé, cela devient une nuisance plus qu'une aide.

Pensez à vous appuyer sur les `aria-attributes` pour compléter les éléments HTML et non re-coder ce qui est déjà présent nativement.
___

> Et sinon ?

![Navi coupe la parole au discours principal.](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2g4j3wqtnrrzr128w0zv.jpg)

![La Grande Fée apprend à Navi à être polie.](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u6lz683tpq8zoi342raq.jpg)

> Pour les notifications et alertes, pensez `aria-live`avec `polite`/ `assertive`.
> Plus d'infos pour gérer les changements intervenants dans sa page, [cliquez ici](https://developer.mozilla.org/fr/docs/Web/Accessibility/ARIA/ARIA_Live_Regions).

___

> Encore un exemple de cas ?

![Navi n'arrête pas de décrire alors que le chargement n'est pas terminé.](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rmgpvh360impq4l7hk8p.jpg)

![Et si on demandait à Navi de patienter ?](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qcm55x9sggd54qyvdawm.png)

> Avec `aria-busy`, vous pouvez faire patienter les lecteurs d'écran lors d'un chargement de page. Ils liront les éléments une fois chargés.

____

## Découvrez ...

> `aria-relevant`, `aria-atomic`, `aria-controls`, les arias de progression, `aria-current`, `aria-hidden`, `aria-disabled`, ... et bien plus ...

Allez vite voir la rediffusion du talk de **Gérôme Grignon** sur la chaîne Youtube du DevFest de Nantes 2023: **20 min de connaissance sur les attributs ARIA**.

**A vous la régie !**
What are the leading book-writing companies?
Published: 2023-11-02 23:27:02

There are many companies in Chicago that provide professional book writing services. One of the best companies we heard was the Excel [book writing company](https://excelbookwriting.com/). Nowadays they are doing wonders in their field. Excel Book Writing Company in USA offers a wide range of writing services, including book writing, book publishing, editing, and more.
Gratitude, ambition and under-achieving
Tags: career, productivity, learning
Published: 2023-11-02 23:12:01

Ever since a child, my parents always told me to be grateful for what we have and that we're lucky and there are people with a lot less than we have. This is solid advice and something I've always tried to keep in mind. I would say I'm an ambitious person and with that, I often balance feelings of gratefulness with ambition.

A year or so ago I also stumbled upon a book called "The Unfair Advantage: How You Already Have What It Takes to Succeed" - by Ash Ali and Hasan Kubba. The premise of the book is that we all have unfair advantages that take shape in various forms. For example for myself, living in London, having a degree, being a native English speaker and so on. The concept of the book is eye-opening and one that's stuck with me for the past year.

While the concept has stuck with me for a while, it's not always been motivating. Sometimes it's been quite the opposite. I've found myself thinking, "I'm so lucky, I should be doing more with my life". This is where my biggest fear comes in. I'm scared that I'm not doing enough with my life. I'm scared that I'm not making the most of my unfair advantages and with that my potential. Not reaching my potential I think about often. I suppose it stems from being younger and seeing football players with huge potential not making it to the top for whatever reason. The feeling of everyone backing you, wanting you to do well but you disappointing them by not reaching the heights everyone had in mind. This is the very feeling I'm afraid of. It might seem like this is societal pressure, but I believe it's deeper than that. It's the promise and the internal battle of knowing I could have done more that scares me. I don't want to look back in 30 years and think I could have tried harder or done more. I want to look back and know I gave it my all.
Upcoming Global Day of Code Retreat
Tags: gdcr, gdcr23, gdcr2023
Published: 2023-11-02 23:05:16

---
title: Upcoming Global Day of Code Retreat
published: true
description: Reminder of the Global Day of Code Retreat 2023
tags: gdcr,gdcr23,gdcr2023
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fstsomfu44d8xudlscun.jpg
# Use a ratio of 100:42 for best results.
# published_at: 2023-11-02 22:57 +0000
---

Just a quick reminder that the next [Global Day of Code Retreat](https://www.coderetreat.org/events/) is about to take place next Saturday.

From their website:

>  Coderetreats are free day-long, intensive practice events, focusing on the fundamentals of software development and design. By providing developers the opportunity to take part in focused practice, away from the pressures of "getting things done", the coderetreat format has proven itself to be a highly effective means of learning and nurturing software development skills.
>
> All over the world, people are coming together in small communities of practices to learn, explore and grow.

After a COVID19 forced break, and personal reasons, I intend to participate in the one nearby.

It's always nice to meet other developers, and it's inspiring to work on one's skills (both hard and soft skills).
Generating a new SSH key for Github projects
Tags: webdev, github, developer, softwaredevelopment
Published: 2023-11-02 22:23:03

### **Introduction**

In this article I'll say about how to create a new ssh key and provide it on cloud for to be safe in our applications and softwares. It's can became easily for make safely connections remotely from your machine as git pull/push.

### **Get started**
   
- **Open the terminal and paste the text below, substituting in your GitHub email address.**

```
$ ssh-keygen -t ed25519 -C "your_email@example.com"
```

*Note: If you are using a legacy system that doesn't support the Ed25519 algorithm, use:*

```
$ ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
```

It creates a new SSH key, using the provided email as a label.

>
> Generating public/private algorithm key pair.
>

- **When you're prompted to "Enter a file in which to save the key," press Enter. This accepts the default file location.**

```
Enter a file in which to save the key (/Users/you/.ssh/id_algorithm): [Press enter]
```

At the prompt, type a secure passphrase. For more information, see "Working with SSH key passphrases."

```
> Enter passphrase (empty for no passphrase): [Type a passphrase]
   
> Enter same passphrase again: [Type passphrase again]
```

**Notes:**

In the terminal, access until to path `/.ssh` and then run commands there. Also it’s important to say that email from first command generation is you personal account of Github.  

Its there is’t need typing password because we will use pull request only, and not push.

In the Github, you can put empty title for create key.

> **Fonts**: 
> https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent

> https://git-scm.com/book/en/v2/Git-on-the-Server-Generating-Your-SSH-Public-Key
> 

**Adding a new SSH key to your GitHub account**

> **Fonts**:
> https://docs.github.com/en/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account
> 

**How to Clone a Specific Branch**

`git clone --branch <branchname> <remote-repo-url>`
You can convert the string field to int and then compare. If the db value is in sting
Published: 2023-11-02 21:45:40

You can convert the string field to int and then compare.

If aggregation add a match stage

{"$match" : {"$expr" : {"$gt" : [{"$toInt" :"$diskSizeGb"} , 200]}}}
If find

find({"$expr" : {"$gt" : [{"$toInt" :"$diskSizeGb"} , 200]}})
*$expr allows us to use aggregate operators to query
🇧🇷 A Ineficiência do Regex e Como Otimizá-lo
Published: 2023-11-02 21:29:58




![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4q9bhlnan7bbjs3ke3ce.jpg)



## Regex, o vilão da performance
Você sabia que expressões regulares (regex) podem ser extremamente ineficientes em certos cenários? Isso ocorre principalmente devido a '**backtracking**' excessivo, que pode levar a tempos de execução exponenciais!

Por exemplo, considere o regex `(a+)+b` e a string `a...a!` (onde ... são milhares de 'a'). Esse regex tentará diversas combinações antes de falhar, tornando-se muito lento.

Mas a boa notícia é: o V8 (motor JavaScript do Chrome e Node.js) introduziu uma flag experimental para lidar com isso: `--enable-experimental-regexp_engine-on-excessive-backtracks.`



## 🔍  Teste Prático:


``` js
const regex = /(a+)+b/;
const input = 'a'.repeat(5000);
console.time('Regex Sem Otimização');
input.match(regex);
console.timeEnd('Regex Sem Otimização');
```


o resultado será algo em torno de `70.885ms`

Para usar a flag no Node.js:

``` shell
node --enable-experimental-regexp_engine-on-excessive-backtracks seuScript.js
```

Com isso, ao detectar backtracks excessivos, o V8 mudará para um mecanismo de regex diferente e mais eficiente!

Aqui o resultado caiu pra `1.977ms` 😲

Lembre-se: regex é uma ferramenta poderosa, mas com grandes poderes vêm grandes responsabilidades. Use com sabedoria e sempre monitore o desempenho!

Olhe https://v8.dev/blog/non-backtracking-regexp para mais informações.



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

## Newsletter


Gostou desse conteúdo? Aproveita pra se inscrever na nossa newsletter https://highperformanceletterbr.substack.com/
Postamos conteúdos sobre performance e otimização todas as semanas!

## Primeiro curso de performance backend js do brasil(ou do mundo)


#### 🚀 Domine o Desempenho Backend com JavaScript! 🚀

🎓 Apresentamos o PRIMEIRO Curso de Performance Backend em JavaScript no Brasil! 🇧🇷

🔥 Seja um dos pioneiros a explorar o mundo do desenvolvimento backend com foco em eficiência e velocidade. Este curso exclusivo é sua porta de entrada para se tornar um especialista em otimização e desempenho de aplicações JavaScript.

####  🌟 O Que Oferecemos:

**Instrutores Especialista:** Aprenda com um profissional que atua com esse assunto no dia a dia.
**Conteúdo Avançado:** Desde fundamentos até técnicas avançadas de otimização.
**Projetos Práticos:** Coloque suas habilidades à prova com desafios reais.
**Comunidade e Networking:** Junte-se a uma comunidade vibrante de desenvolvedores.
**🛠️ Domine Ferramentas e Técnicas Essenciais:** Conteúdo prático sobre as melhores tools de monitoramento e análise de recursos

#### Análise de Performance;
Diagnóstico;
Otimização de Código;
Gerenciamento Eficiente de Memória;
Eventos e streaming;

####  🚀 Transforme a forma que os outros devs te veem:
Esteja na vanguarda do desenvolvimento backend. As habilidades que você adquirirá são inestimáveis e altamente procuradas no mercado de trabalho para posições senior.

✅ Acesse: https://highperformanceschool.hotmart.host/
My Journey with Prettier, ESLint, and VSCode
Tags: webdev, opensource
Published: 2023-11-02 21:05:27

I recently embarked on a mission to enhance my coding environment by integrating Prettier, ESLint, and configuring Visual Studio Code (VSCode). Little did I know, this journey would be both rewarding and filled with unexpected challenges.

**Setting the Stage:**
The journey began with the quest for clean and consistent code. Prettier, the code formatter, promised to take care of the nitty-gritty details, while ESLint offered the power of static analysis to catch potential bugs and enforce a consistent coding style.

**The Configuration Odyssey:**
Configuring these tools was the first hurdle. ESLint and Prettier have their own configurations, and aligning them with my project's needs required some detective work. I dove deep into `.eslintrc` and `.prettierrc` files, tweaking rules and settings until everything clicked.

**The VSCode Connection:**
With ESLint and Prettier on board, it was time to make VSCode dance to the same tune. I crafted a bespoke `settings.json` file, synchronizing VSCode with my project's preferences. IntelliSense, auto-formatting, and error highlighting became my coding companions.

**The Unexpected Plot Twists:**
As in any adventure, challenges emerged. Mysterious linting errors, conflicting configurations, and the infamous "Identifier 'textToHtml' has already been declared" bug – each hurdle was a lesson in problem-solving and resilience. Google became my best friend, and Stack Overflow my guiding light.

**The Sweet Taste of Success:**
After overcoming these challenges, the payoff was immense. My codebase became a haven of consistency, and the development experience, seamless. The satisfaction of seeing VSCode auto-fixing issues and Prettier sprinkling its magic on save was unparalleled.

**Closing Thoughts:**
In the end, the journey taught me not only about tooling but also about the importance of perseverance in the face of unexpected challenges. Configuring Prettier, ESLint, and VSCode is an investment that pays off in the long run, turning coding from a chore into a delightful experience.