teleren/devto huggingface dataset:
System Design Resources: The Complete Set ⚡📦
Tags: designpatterns, architecture, webdev, career
Published: 2023-02-09 23:07:21

If you are planning to apply for a job as an Engineer you will need to pass System Design interview. Each interview covers High-level and Low-level production architecture.

This is The Complete Set of Resources for Systems Design interviews.

### Join Me

Follow me on [#TheEngineeringBolt](https://engineeringbolt.com), [Twitter](https://twitter.com/alexrashkov) and [Linkedin](https://www.linkedin.com/in/alexrashkov) for more Career, Leadership and Growth advice.

### ✅ Things you must know in System Design (x12)

👉 [System design basics](https://bit.ly/3SuUR0Y)
👉 [Horizontal and vertical scaling](https://bit.ly/3slq5xh)
👉 [Load balancing and Message queues](https://bit.ly/3sp0FP4)

**[Read More >](https://engineeringbolt.com/tech/system-design-resources-the-complete-set/#things-you-must-know-in-system-design)**

### ✅ System Design Case Studies (x17)

👉 [Design Netflix](https://bit.ly/3GrAUG1)
👉 [Design Reddit](https://bit.ly/3OgGJrL)
👉 [Design Messenger App](https://bit.ly/3DoAAXi)

**[Read More >](https://engineeringbolt.com/tech/system-design-resources-the-complete-set/#system-design-case-studies)**

### ✅ All solved case studies (x4)

👉 [Most Popular System Design Questions](https://bit.ly/3E9oH7K)
👉 [Complete System Design Basics Series](https://bit.ly/3rG1cfr)

**[Read More >](https://engineeringbolt.com/tech/system-design-resources-the-complete-set/#all-solved-case-studies)**

### Join Me

Follow me on [#TheEngineeringBolt](https://engineeringbolt.com), [Twitter](https://twitter.com/alexrashkov) and [Linkedin](https://www.linkedin.com/in/alexrashkov) for more Career, Leadership and Growth advice.

<a href="https://engineeringbolt.substack.com/embed" target="_blank" title="Subscribe to Engineering Bolt ⚡ Newsletter">![Subscribe to Engineering Bolt ⚡ Newsletter](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3u2srkrj6arwrs0nclfs.png)</a>
Day 692 : Steep Life
Tags: hiphop, code, coding, lifelongdev
Published: 2023-02-09 23:03:17

_liner notes_:
- Professional : Another day that time flew by. I got up early to catch a meeting that was set for folks in Europe and Asia. Went back to sleep right after. Got up in time for a couple of more meetings. Spent the rest of the day updating some Web Components.

- Personal : Last night, I went through a bunch of tracks and worked a little on my side project. Mostly cleaning up the response that comes back from authorizing a user. Finally watched "You People". It was pretty good. I enjoyed it.

![Looking from a field at some trees with one having no leaves at the base of a large mountain in Oahu, Hawaii](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n7lgvpvm7v698h7ge7so.jpg)

Going to go through more tracks and I think after this, I'll have enough for this upcoming show and a few in the future. I'll just need to put it together tomorrow. I think I'll need to add a store to my side project so that I can get the user object in different components. I think I can use stores to also run things like verifying the JWT and making sure the user is authorized before every call just to make sure they are who they say they are. Got some more research to do and play around with some stuff to test it out. So this is probably the last night I'll have this Chromebook because I'll be shipping it out to be repaired tomorrow. I should be able to continue on my side project on my old Chromebook in the mean time, hopefully. It's pretty old and was running slow. It's amazing how quickly devices can get slow. Steep Life. haha I probably just need to clear some old files off it. Maybe I'll watch some anime to end the night.

Have a great night!

peace piece
Dwane / conshus
https://dwane.io / https://HIPHOPandCODE.com
{% youtube V0Gl_f37uD4 %}
You're Invited to FutureStack São Paulo, Brazil by New Relic! - FREE Event
Tags: eventsinyourcity
Published: 2023-02-09 23:01:42

Hello, devs! 👋

FutureStack is coming to São Paulo, Brazil on March 8! 

At [FutureStack São Paulo, Brazil](https://newrelic.com/events/2023-03-08/futurestack-brazil?utm_source=devto&utm_medium=community&utm_campaign=amer-fy23-q4-futurestack%20san%20francisco), you’ll hear from our customers, participate in interactive sessions, and network with industry leaders. The event will cover a wide range of topics, including observability and much more.

Whether you’re a seasoned developer or just starting out in the field, this event is the perfect opportunity to learn about the latest technologies, connect with industry leaders, and explore new ideas.

**Deets:**
📍 Casa Bisutti, Rua Casa do Ator, nº 577, Vila Olímpia
🗓️ Wednesday, March 8, 2023
🕘 8:30am-5:30pm

[Register for São Paulo, Brazil today!](https://newrelic.com/events/2023-03-08/futurestack-brazil?utm_source=devto&utm_medium=community&utm_campaign=amer-fy23-q4-futurestack%20san%20francisco)

See you there,
Daniel
You're Invited to FutureStack San Francisco by New Relic! - FREE Event
Tags: eventsinyourcity, devops
Published: 2023-02-09 22:35:58

Hello, devs! :wave:

FutureStack is coming to San Francisco on March 15! 

At [FutureStack San Francisco](https://newrelic.com/events/2023-03-15/futurestack-san-francisco?utm_source=devto&utm_medium=community&utm_campaign=amer-fy23-q4-futurestack%20san%20francisco), you’ll hear from our customers, participate in interactive sessions, and network with industry leaders. The event will cover a wide range of topics, including observability and much more.

Whether you’re a seasoned developer or just starting out in the field, this event is the perfect opportunity to learn about the latest technologies, connect with industry leaders, and explore new ideas.

**Deets:**
📍 SPIN, 690 Folsom St #100, San Francisco, CA 94107
🗓️ Wednesday, March 15, 2023
🕘 9:00am-5:00pm

[Register for FutureStack San Francisco today!](https://newrelic.com/events/2023-03-15/futurestack-san-francisco?utm_source=devto&utm_medium=community&utm_campaign=amer-fy23-q4-futurestack%20san%20francisco)

See you there,
Daniel
index.html
Published: 2023-02-09 22:26:13

<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>Register</title>
		<link href="style.css" rel="stylesheet" type="text/css"> ="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.0/css/all.min.css" integrity="sha512-xh6O/CkQoPOWDdYTDqeRdPCVd1SpvCA9XXcUnZS2FmJNp1coAFzvtCN9BmamE+4aHK8yyUHUSCcJHgXloTyT2A==" crossorigin="anonymous" referrerpolicy="no-referrer">
	</head>
	<body>
		<div class="register">
			<h1>Register</h1>
			<form action="register.php" method="post" autocomplete="off">
				<label for="username">
					<i class="fas fa-user"></i>
				</label>
				<input type="text" name="username" placeholder="Username" id="username" required>
				<label for="password">
					<i class="fas fa-lock"></i>
				</label>
				<input type="password" name="password" placeholder="Password" id="password" required>
				<label for="email">
					<i class="fas fa-envelope"></i>
				</label>
				<input type="email" name="email" placeholder="Email" id="email" required>
				<input type="submit" value="Register">
			</form>
		</div>
	</body>
</html>
SRE book notes: Managing Critical State, Distributed Consensus for Reliability
Tags: sre, books, consensus, algorithms
Published: 2023-02-09 21:58:21

These are the notes from [Chapter 23: Managing Critical State: Distributed Consensus for Reliability](https://sre.google/sre-book/managing-critical-state/) from the book [Site Reliability Engineering, How Google Runs Production Systems](https://sre.google/sre-book/table-of-contents/).

This is a post of a series. The previous post can be seen here:

{% embed https://dev.to/bitmaybewise/sre-book-notes-addressing-cascading-failures-2omp %}

This post is rather short, as the chapter dives into many complex topics such as the [CAP theorem](https://en.wikipedia.org/wiki/CAP_theorem), and consensus algorithms such as [Raft](https://en.wikipedia.org/wiki/Raft_(algorithm)) and [Paxos](https://en.wikipedia.org/wiki/Paxos_(computer_science)), thus any attempt of summarizing them in a few sentences can be damned to failure. The chapter and the references are a must-read if you intend to manage state in a distributed manner.

---

> In fact, many distributed systems problems turn out to be different versions of distributed consensus, including master election, group membership, all kinds of distributed locking and leasing, reliable distributed queuing and messaging, and maintenance of any kind of critical shared state that must be viewed consistently across a group of processes. All of these problems should be solved only using distributed consensus algorithms that have been proven formally correct, and whose implementations have been tested extensively. Ad hoc means of solving these sorts of problems (such as heartbeats and gossip protocols) will always have reliability problems in practice.

---

> When making decisions about location of replicas, remember that the most important measure of performance is client perception

---

> Whenever you see leader election, critical shared state, or distributed locking, think about distributed consensus: any lesser approach is a ticking bomb waiting to explode in your systems.

---

If you liked this post, consider subscribing to my newsletter [Bit Maybe Wise](http://bitmaybewise.com/).

You can also follow me on [Twitter](https://twitter.com/bitmaybewise) and [Mastodon](https://mastodon.online/@bitmaybewise).

---

Photo by [Markus Spiske](https://unsplash.com/@markusspiske) on Unsplash
How create and upload content in Cloud Storage GCP?
Tags: cloud, tutorial, beginners, database
Published: 2023-02-09 21:46:44

#  🛢 Simple way to create a bucket in Cloud Storage from GCP.

---

## 🔗Related content  
### You can find repo related in:
🐱‍🏍[GitHub](https://github.com/xlmriosx/cloud-projects/tree/main/sdk-docker-image-from-gcp) 

### You can connect with me in:
🧬[LinkedIn](https://www.linkedin.com/in/xlmriosx/) 

--- 

### Resume 🧾

All this blog is using shell.

Using SDK's Google we will use tool to manage Cloud Storage. In this blog we will create a storage and upload content in it.

For more information and potential of this, click [here](https://cloud.google.com/cli?hl=es-419#section-5).

---

Pre-Conditions:
- You need have installed SDK. You can do that following next [steps](https://dev.to/xlmriosx/how-install-cloud-sdk-docker-image-in-gcp-4mep)
Note: I set alias to use SDK like msdk.
---

### 1st - Set a name to bucket ✍️

We assign to a variable the name that will have bucket.

I use following command:

```
BUCKET_NAME="xlmriosx_bucket"
```

---

### 2nd - Create bucket ✅

Using SDK installed with alias like msdk I use following command to create a bucket:

- With alias:
```
mdsk gsutil mb -p $PROJECT_NAME -c $BUCKET_TYPE -l $REGION gs://$BUCKET_NAME
```

- Without alias:
```
docker run --rm --volumes-from gcloud-config gcr.io/google.com/cloudsdktool/cloud-sdk gsutil mb -p $PROJECT_NAME -c $BUCKET_TYPE -l $REGION gs://$BUCKET_NAME
```

Where:
$PROJECT_NAME -> Is name of the project where you wnat instance a bucket.

$BUCKET_TYPE -> Is type of storage you want, like standard, nearline, coldline, archive.

$REGION -> Region where you want stay your storage bucket.

OUTPUT:
```
Creating gs://xlmriosx_bucket/...
```

---

### 3rd - Verify that your bucket was created ✅

We will list buckets to verify that our bucket was created:

- With alias:
```
docker run -ti --name gcloud-config gcr.io/google.com/cloudsdktool/cloud-sdk gcloud auth login
```

- Without alias:
```
msdk gsutil ls gs://$BUCKET_NAME
```

### 4th - Upload content in bucket ⬆️

We can copy content to bucket with the following command:

```
msdk gsutil cp $DATA gs://$BUCKET_NAME
```

OUTPUT:
```
Copying file:///$DATA
[Content-Type=X]...
- [1 files][    Y.0 B/    Y.0 B]
Operation completed over 1 objects/Y.0 B.
```

Where:
$DATA -> Directory or file that we want upload in the bucket.

---

### 5th - Say thanks, give like and share if this has been of help/interest 😁🖖

---
O que é JavaScript?
Published: 2023-01-06 18:55:11

O [que é Javascript](https://jedibit.com.br/o-que-e-javascript/), para que serve? O onde vive e o que come? Hahaha, brincadeiras a partes.

Javascript é a moda do momento

JavaScript é uma linguagem de programação que permite a você implementar itens complexos em páginas web.

Toda vez que uma página da web faz mais do que simplesmente mostrar a você informação estática — mostrando conteúdo que se atualiza em um intervalo de tempo, mapas interativos ou gráficos 2D/3D animados, etc.

Você pode apostar que o JavaScript provavelmente está envolvido. É a terceira camada do bolo das tecnologias padrões da web, duas das quais (HTML e CSS) nós falamos com muito mais detalhes em outras partes da Área de Aprendizado.
Mas para que serve?
JavaScript

```
<html>
    <head>
        <title></title>
        <script>
            function chamarAlerta() {
                alert('Eu sou um alert!');
            }
        </script>
    </head>
    <body>
        <button onclick="chamarAlerta()">Oi, me click</button>
    </body>
</html>
```

O núcleo da linguagem consiste em alguns benefícios comuns da programação que permite a você fazer coisas como:

    Armazenar conteúdo útil em variáveis. No exemplo acima, a propósito, nós pedimos que um novo nome seja inserido e armazenamos o nome em uma variável chamada nome.
    Operações com pedaços de texto (conhecidos como “strings” em programação). No exemplo acima, nós pegamos a string “Jogador 1: ” e concatenamos (juntamos) com a variável nome para criar o texto completo “Jogador 1: Chris”.
    Executar o código em resposta a determinados eventos que ocorrem em uma página da Web. Nós usamos o click (en-US) no nosso exemplo acima para que quando clicassem no botão, rodasse o código que mostra um alerta no navegador.
    E muito mais!

O que é ainda mais empolgante é a funcionalidade construída no topo do núcleo da linguagem JavaScript. As APIs (Application Programming Interfaces – Interface de Programação de Aplicativos) proveem a você superpoderes extras para usar no seu código JavaScript.
Fonte: [JediBit](https://jedibit.com.br/o-que-e-javascript/)
How to build 3 simple animation with framer motion
Tags: react, webdev, tutorial, framermotion
Published: 2023-02-09 21:39:38

Animations are an essential part of any user interface, and Framer Motion is a powerful library for creating animations in React. It provides a simple and performant way to add animations to your components. In this article, we will show you how to build three simple animations using Framer Motion for React.

## 1.  Fading in and out

The first animation we will create is a simple fade in and out animation. We will use the `animate` property and the `opacity` property to create this animation. First, we need to import the `motion.div` component from Framer Motion. We will use this component to wrap our div that we want to animate. Then, we can use the `animate` property to define the animation and the `opacity` property to define the initial and final states of the animation.

```javascript
import { motion } from 'framer-motion';

function FadeInOut() {
  return (
    <motion.div
      animate={{ opacity: [0, 1, 0] }}
      transition={{ duration: 2, loop: Infinity }}
    >
      <p>Fading in and out</p>
    </motion.div>
  );
}
```

In the example above, we are telling Framer Motion to animate the opacity of the wrapped div from 0 to 1 and back to 0. We also define a transition with a duration of 2 seconds and a loop that repeats infinitely.

## 2.  Move along a path

The second animation we will create is a simple animation that moves an element along a path. We will use the `motion.path` component to define the path, and the `animate` property to move the element along the path.

```javascript
import { motion } from 'framer-motion';

function MoveAlongPath() {
  return (
    <motion.path
      d="M10,10 L90,90"
      animate={{ pathLength: [0, 1] }}
      transition={{ duration: 2 }}
    >
      {(path) => (
        <motion.div
          animate={{ pathLength: [0, 1] }}
          style={{ path, position: 'absolute' }}
        >
          <p>Moving along a path</p>
        </motion.div>
      )}
    </motion.path>
  );
}
```

In this example, we defined a path using the `d` attribute and set the `pathLength` property to [0,1], which makes the element move along the path from start to end. We also defined a transition with a duration of 2 seconds. The component wrapped inside the path component uses the path prop and position absolute to move along the path

## 3.  Rotating

The third animation we will create is a simple rotation animation. We will use the `animate` property and the `rotate` property to create this animation.

```javascript
import { motion } from 'framer-motion';

function Rotating() {
  return (
    <motion.div
      animate={{ rotate: [0, 360] }}
      transition={{ duration: 2, loop: Infinity }}
    >
      <p>Rotating</p>
    </motion.div>
  );
}
```

In this example, we are telling Framer Motion to animate the rotation of the div from 0 to 360 degrees, and we also defined a transition with a duration of 2 seconds and a loop that repeats.

That's it ! See U next level !
10 Tips For Developers
Tags: coding, webdev, beginners
Published: 2023-02-09 21:35:55

Here are ten tips for developers to help improve their skills and productivity:

## 1. Continuously learn and improve:
 Technology is constantly evolving, and it's important to stay up to date with the latest tools and programming languages.

## 2. Write clean, maintainable code:
 Writing code that is easy to read, understand, and modify will make it easier for others to contribute to your projects and for you to pick up where you left off in the future.

## 3. Test your code thoroughly:
 Test your code thoroughly and make sure it works as expected, even in unexpected scenarios.

## 4. Collaborate with others:
 Working with other developers, whether in a team or through open-source projects, can help you learn new techniques and approaches.

## 5. Use version control:
 Use version control systems like Git to track changes to your code and collaborate with others.

## 6. Document your code:
 Write clear, concise documentation for your code to help others understand what it does and how it works.

## 7. Take breaks and prioritize self-care:
 Taking regular breaks and practicing self-care can help prevent burnout and improve overall productivity.

## 8. Automate repetitive tasks:
 Use tools and scripts to automate repetitive tasks and focus on more important work.

## 9. Seek feedback:
 Ask for feedback from other developers and be open to constructive criticism.

## 10. Give back to the community:
 Contribute to open-source projects, mentor others, or share your knowledge through writing or speaking to give back to the developer community.

Thanks For Reading 😊
why React StrictMode is important ?
Tags: react, javascript, beginners, programming
Published: 2023-02-09 21:30:45

## why we need StrictMode in react

In React, it is recommended to write components as **pure functions **because it helps ensure that the component's behavior is predictable and consistent. A pure function is a function that always returns the same output for a given set of inputs, and has no side effects. This makes it easier to test, debug, and reason about the component's behavior.

StrictMode is used to catch potential problems in your code that may cause unexpected behavior. By enabling StrictMode, React will perform additional checks and warnings on your components, such as re-rendering components or executing Effects an extra time, to help identify issues related to impure rendering or missing Effect cleanup.

In summary, writing pure components and using StrictMode helps ensure that your components behave as expected, making it easier to develop, test, and maintain your application.

## How to implement StrictMode ? 

```
import React from 'react';

function MyComponent() {
  return (
    <div>
      <h1>My Component</h1>
    </div>
  );
}

function App() {
  return (
    <React.StrictMode>
      <MyComponent />
    </React.StrictMode>
  );
}

export default App;

```

## **what strictMode do with component ?

**

- Enforcing an extra re-render of components to catch any bugs related to impure rendering.

- Re-executing Effects one additional time to catch bugs related to missing Effect cleanup.

- Performing checks for the usage of deprecated APIs to ensure that your code remains up-to-date.
Caching Best Practices
Published: 2023-02-09 21:13:14

**Lazy caching**
When an user request a data, the application will check if the data exists in cache(cache hit), if so, user receives cache data, but when the data do not exist in cache(cache miss), so the data its created for next requests.

**Write-through**
Following this, cache its set always a data is updated, ex:
if I update the user profile from my app, the cache will updated as well.
**Time-to-live**
Laravel 9 & Passport for creating a basic OAuth2 implementation
Tags: oauth2, laravel, passport, api
Published: 2023-02-09 21:07:38

Execute composer require laravel/passport
Execute php artisan migrate
Execute php artisan passport:install
Execute composer require laravel/breeze --dev
Execute php artisan breeze:install

Replace HasApiToken in Users with Sanctum/HasApiToken 
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2yalxuandmwsfx5iaws9.png)

Add api in auth array in the guard.php file
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/skl0pcd6xtkz1k7xzopb.png)

Execute php artisan passport:client
generate the client id, client name, callback, client secret

create an user through localhost:8000/register

Open Postman:
First Authorize user by sending a GET request, below image provided for reference:

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

Take the full url and search using the browser
Login then click Authorize
Now 404 not found page will be shown along with the code and state in url bar

Copy the code

Next process is to Generate the Bearer/Access token for accessing API's, take the below image for reference

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

Lastly for testing an API, the below example's been given:

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



Lastly, Passport's OAuth default routes:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nu701dd9sf30bgmzxwtx.png)
欧几里得定理 (Euclid's theorem): 无限素数(质数)的证明
Tags: math, blog, cn, primenumbers
Published: 2023-02-09 20:39:55

<h3>欧几里得定理 (Euclid's theorem): 无限素数的证明</h3>
质数定义为只能被1和它本身整除的正整数，质数有无穷多个的证明如下：

证明：假设质数有有限个，设它们为p1,p2,p3,...,pn，则它们的乘积N=p1p2p3...pn，由于N是一个正整数，则N+1也是一个正整数，而N+1不能被p1,p2,p3,...,pn整除，因此N+1必定是一个质数，这与假设矛盾，因此质数有无穷多个。

<a href="https://justyy.com/archives/7234" title="做题送美人 Python 题解: (两质数相乘等于 707829217)">素数</a>有无限个的证明被称为欧几里德定理。 欧几里得定理指出，如果你采用任何有限的素数集，那么你总能找到一个不在该集合中的素数。

为了证明这个定理，我们将使用<a href="https://justyy.com/archives/46296" title="P站上讲数学微积分的张旭老师">数学</a>上的反证法。 假设有一个有限的素数集，P = {p1, p2, p3, …, pn}。 我们假设这个集合包含所有素数。

现在，让我们考虑数字 N = p1 * p2 * p3 * … * pn + 1。这个数字大于集合 P 中的任何素数，因为它是集合中所有素数加一的乘积 .

现在，我们将证明 N 是质数或合数。 如果 N 是一个合数，那么它一定能被某个素数 q 整除，其中 q 不在集合 P 中。这意味着 q 是一个不在集合 P 中的素数，这与我们假设集合相矛盾 P 包含所有素数>。

因此，N一定是一个素数，也就是说存在一个不在集合P中的素数。这与我们假设集合P包含所有素数的假设相矛盾，从而证明素数有无穷多个数字。

<h3>视频教学: 和娃一起学习成长</h3>
<iframe width="560" height="315" src="https://www.youtube.com/embed/y0rpCeA9rcI" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>

节选自<a href="https://zhihua-lai.com/teaching/ch/?s=563&cat=" rel="noopener" target="_blank">第563天教娃编程</a>.

油管: https://youtu.be/y0rpCeA9rcI
B站: https://www.bilibili.com/video/BV1Nd4y1H7rz/
西瓜: https://www.ixigua.com/7197383365631148559

英文: <a href="https://helloacm.com/euclids-theorem-proof-of-unlimited-prime-numbers/" rel="noopener" target="_blank">Euclid’s theorem – Proof of Unlimited Prime Numbers</a>

博客: [https://justyy.com/archives/61199](https://justyy.com/archives/61199)