teleren/devto huggingface dataset:
How to create a Grafana Alert Rule.
Tags: devops, kubernetes, grafana
Published: 2022-10-24 20:35:22

Hello, I would like to show you how easy it is to create a User defined Grafana Alert. In this example I will use a simple PromQl to retrieve the current RAM allocation of a specific Job and evaluate it against a specific set of conditions for example I would like to know when the specific Job has allocated more than "X" GB of Ram or if these specific Job has stopped. 

So, Lets Dive in...

You can access the Official Documentation which include a really helpful [video](https://grafana.com/docs/grafana/latest/alerting/) to help you get started.

**Actual Steps:**

Step 1: Access Alerting Section by clicking Alert Icon is located in the Sidebar Section.
Step 2: Create a new Alert Rule as you can see from the following screenshot

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

Step 3: Select Prometheus as the preferred data source in the field metric paste the PromQL Query: container_memory_usage_bytes{pod="<pods-name>",container="<container-name>"}/1073741824 # Convert to GB


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

Step 4: Specify the conditions you want trigger the alert when the evaluation of the conditions are violating the defined threshold. 

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

Step 5: Specify the interval of the evaluation and the time Grafana needs to wait after an alert has breached the defined threshold.

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

Finally click the button Save and Exit button is located in the top right corner. Congratulations you have created the your first alert. 


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

Also you can find some useful PromQL queries from [here](https://promlabs.com/promql-cheat-sheet/) the official Prometheus Cheetsheet.


I hope you like the tutorial, if you do give a thumps up! and follow me in [Twitter](https://twitter.com/TVelmachos), also you can subscribe to my [Newsletter](https://dashboard.mailerlite.com/forms/167581/67759331736553243/share) in order to avoid missing any of the upcoming tutorials.


#### Media Attribution
I would like to thank [Clark Tibbs](https://unsplash.com/@clarktibbs) for designing the awesome [photo ](https://unsplash.com/photos/oqStl2L5oxI)I am using in my posts.
Typescript with React
Published: 2022-10-24 20:29:10

I didn't think typescript with JavaScript was too bad. But when I tried it with React, I had a really hard time getting used to it. From passing down props, to setting up state, and then returning HTML, I really struggled. 

**Props**
Whenever passing props into a component, the type of props has to be identified. This is more lines of code to write, but it is worth it, so you don't have to try to remember which properties were in the props. Or having to flip back and forth between the file passing the props and the file receiving them. The props can be identified by types or interfaces.

```react
type BlogProps = {
name: string;
}

export const Blog = ({name}: BlogProps): JSX.Element => <div>{name}</div>
```

**State**
Before typescript, setting up state was simply done inside the parenthesis of setState. And when doing so with primitive types, it's still the same, just through a string or number inside the parenthesis. But when setting up state with complex types, then the type has to be identified also. This can be done by writing the type before setting state, then passing that type between setState and the ().



```react
export const Blog = (): JSX.Element => {
const [name, setName] = useState('');
useEffect(() => setName('fede'), [])
return (<div>{name}</div>)
}
```

**Errors**
Typescript errors can seem to be a paragraph long. It's also a lot of new syntaxes to get used to. When installing `@types/react` we get the whole react types library. This means all the HTML elements. This is what's used to check if the element is being used right. And by used right, I mean using the attributes the element has right. This also means not trying to use attributes that don't exist in the element. Then there are the custom elements. The errors from these are usually from defining the right type for the props going in them. 

Typescript seems to be the solution to having to guess what type of value passes through a component. This means no more having to flip through files to see what kind of prop I'm getting anymore. It came at a cost of losing my mind learning it, but it was worth it.

_Sources_

- https://react-typescript-cheatsheet.netlify.app
-
🔁 Build & deliver static docs w. Quarkus/Reodcly on GitHub Pages 📘
Tags: github, quarkus, java, api
Published: 2022-10-24 20:29:06

## ❔ About

Today, **`CD` (Continuous Delivery)** of up-to-date documentation is a crucial step if you want to achieve things at scale.

APIs do not make exception : we deliver embedded swagger, but...

> _**more and more outside collaborators ask for offline documentation, or on API marketplaces.**_


And (hopefully) : 

> _**your outside contributors or clients are more numerous than you.**_

☝️ So you have to deliver them an optimal **`DX`** (Developer-Experience) that costs no work to your organization.

👉 We'll show you how we **deliver documentation** for : 

- 🤓 Human people
- 🤖 Third party CI services for integration purposes


## 💡 What we'll cover

What we'll show here is how we **deliver a static** [OpenAPI specification](https://swagger.io/specification/) (`html` and `yaml`), **as part of the release process**.

👉 With that, it makes it very easy to import your API into any API marketplace, see below on Google [`apigee`](https://cloud.google.com/apigee) :

[![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/47gqrwcw43x4v4oey08o.png)
](https://cloud.google.com/apigee/docs/api-platform/tutorials/create-api-proxy-openapi-spec)

## 🧰 Stack

- [GitHub Actions](https://github.com/features/actions)
- [GitHub Pages](https://github.blog/2022-08-10-github-pages-now-uses-actions-by-default/)
- [Quarkus](https://quarkus.io/about/)
- [Redocly](https://redocly.com/)

## 🍿 Demo

Enough talks, let's watch this very cool step by step and short (<`10'`) demo from @mbarre :

{% youtube VCphsrYfzak %}

## 🔖 Resources

- [Quarkiverse documentation](https://quarkiverse.github.io/quarkiverse-docs/index/index/index.html)
- [Quarkiverse Hub on GitHub](https://github.com/quarkiverse)

## 📆 Date to save

{% twitter 1583442985647329287 %}
5 Best Gnome Shell Extensions
Tags: linux, gnome, ubuntu, extensions
Published: 2022-10-24 20:24:23

My preferred desktop environment is Gnome, which I've been using since 2018.
I admit that extensions greatly improve the experience and were what initially drew me to GNOME.

I've brought my necessary extensions with me. I'm hoping you like it.

*I'm currently using ubuntu 20.04 LTS and GNOME 3.36.8*

### 1. Use Theme
  It's a fantastic addition for customization. Use Themes enabling us to modify the GNOME Shell theme, giving us the opportunity to fully customize our experience.

https://extensions.gnome.org/extension/19/user-themes

### 2. Dash to Dock
  This plugin takes the dash out of the overview and converts it into a dock so that apps can be launched more easily and windows and desktops can be switched between more quickly. There are placement possibilities on the side and bottom.

https://extensions.gnome.org/extension/307/dash-to-dock

### 3. Clipboard Indicator
  This useful application creates a little clipboard icon in the tray and, as a result, saves a history of the contents of the clipboard so you may quickly re-copy them in the future. You can instantly turn on/off a private mode as needed and define the memory cache size (for example, last 10 items or last 100 things).

https://extensions.gnome.org/extension/779/clipboard-indicator

### 4. ArcMenu
 
   Similar to the Start menu in Windows, Arc Menu is a more "conventional" app menu for GNOME Shell that can be accessed from the desktop. But this item is much more flexible than Windows' Start Menu.

https://extensions.gnome.org/extension/3628/arcmenu

### 5. Sound Input & Output Device Chooser

  Displays a list of sound input and output devices in the status menu below the volume slider (similar to the gnome sound settings).

https://extensions.gnome.org/extension/906/sound-output-device-chooser
How does the internet work
Published: 2022-10-24 20:02:36

Ever wondered what happens when you load a webpage using a URL? 

How does your favorite webpage load up in your browser within a fraction of a second after you search? 

How is this page loaded and you are able to read about "how the internet works"?

The web, sometimes referred to as the world wide web (www), is a collection of information that is accessed via the internet. The internet is a global network of networks, i.e., the infrastructure on which the web runs. Think of the internet as a road that connects towns and cities. The web contains the things you see on the road, like houses and shops. 

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

The web uses a client-server-based architecture. The client, in this context, is a browser that sends a request to the server for information. The server receives the request sent by the client, processes the request, and sends client data based on the request received. The data and the process are stored on the web server. The web browser and server communicate using HTTP/HTTPS, a web communication protocol.



## How exactly does it work?


When a user clicks or types in a URL or domain name in a browser, a request is sent to your ISP's (internet service provider) DNS, which checks and maps the domain name to its IP address. If the IP address is not found, the ISP will query an authoritative DNS for the IP address. This will send the IP address of the destination server to the browser. 
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/f4y9ebv3fy8plc5lpa7h.jpg)
The browser sends an HTTP/HTTPS request message to the server, asking it to send a copy of the website to the client. This message, and all other data sent between the client and the server, is sent across your internet connection using TCP/IP. The data is wrapped with specific information, including the server's IP address for your request. 

The server reads the request and, if the web page exists or is available, pulls information from the server and starts sending the website files to the browser as a series of tiny chunks or packets. 

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

The browser assembles the packet into a complete web page understandable by humans and displays it on the user's browser. 


## WRAPPING UP


It is important  we are aware that the web and the internet are not exactly same. The internet is the platform upon which the web sits on; it is the infastructure on top which the web is served. Now you are not unaware of all that happens behind the scenes. Feel free to surf the internet with more confidence.
How Does APISIX Ingress Support Thousands of Pod Replicas
Published: 2022-10-24 19:54:31

This article compares the differences between Endpoints and EndpointSlice, and introduces the way to enable EndpointSlice feature during APISIX Ingress installation.
[https://api7.ai/blog/apisix-ingress-support-thousands-pod-replicas](https://api7.ai/blog/apisix-ingress-support-thousands-pod-replicas)
My thoughts on learning coding
Tags: javascript, beginners, webdev
Published: 2022-10-24 19:48:34

Learning to code is something that has been a mainstay in my adult life. From young adults who want to get into a new career or adults who want to "learn something new".

Growing up around technology and the progress it has made in my lifetime has built an association that computers and technology is approachable but the systems that propagate up us end-users is a vast sea of numbers and texts that will either engulf you or spit you right out. 

And that's where I stood not knowing what would happen to me. As someone who has little to no knowledge of the back-end workings, I was worried that this transition in my professional life would land me right at where I started more confused and frustrated than before.

However after a few weeks of being in a coding bootcamp, there was a self realization that you have to be self serving. How dedicated, how curious you are will grow your inner-developer into the professional that you see yourself as. So while the progress can be slow, it can amount to something comprehensive, like rivers fueling the ocean.
Manage multiple git accounts
Tags: git, tutorial
Published: 2022-10-24 19:45:32


Hi! Do you have multiple git accounts or you just using one? I have multiple and everytime I reinstall my system I trying to find how I
configured it before... (i finally wrote this together here).

Im using multiple git config file rather than multiple host names (i don't like to have somethink like `git@github-work` or `git@github-personal`).

## How it's work?

First of all you need to create different folders for you personal and work projects (or more folders if you have more accounts). Into each folder
create new `.gitconfig` file which will looks like this one:

```bash
# ~/Work/.gitconfig.work
[user]
email = your@email
name = Your Name
 
[github]
user = "YourGithubName"
 
[core]
sshCommand = "ssh -i ~/.ssh/work.pub" # public key for your work profile
```

You will also need more SSH keys. I using 1Password so I copy only my public keys to the my `.ssh` folder.

### SSH with 1Password

If you want to use 1Passowrd you need to configure ssh. Add following to your `~/.ssh/config` file

```bash
Host *
	IdentityAgent ~/.1password/agent.sock
```

### SSH With SSH-AGENT

If you want to use more traditional way you will need to configure SSH-AGENT

```bash
eval "$(ssh-agent -s)" && \
ssh-add -K ~/.ssh/<personal_key> 
```

Then edit your `~/.ssh/config`

```bash
Host *
    AddKeysToAgent yes
    UseKeychain yes
    IdentityFile ~/.ssh/<created_key>
```

OK now you have create your keys and gitconfig files for you profiles. Now you need to tell git to use proper config based on git repository location. Edit `~/gitconfig` which will need to looks similar to this:

```bash
# ~/.gitconfig
 
[includeIf "gitdir:~/May/"] # include for all .git projects under May/ 
path = ~/May/.gitconfig.may
 
[includeIf "gitdir:~/Work/"] # include for all .git projects under Work/
path = ~/Work/.gitconfig.work
 
[core]
excludesfile = ~/.gitignore      # valid everywhere
```

You list all your configs with `git config --list` command.

## That's all

Good! You can now clone repositories from multiple accounts based on in which folder you clonning it.
Phalcon v5.0.5 Released
Tags: phalcon, phalcon5, release
Published: 2022-10-24 19:40:28

---
title: Phalcon v5.0.5 Released
published: true
date: 2022-10-24 19:32:19 UTC
tags: phalcon,phalcon5,release
canonical_url: 
---

Phalcon v5.0.5 has been released!

<!--more-->

This release contains bug fixes

A big thank you to our community for identifying these issues and helping fixing them.

## Changelog

### Fixed

- Fixed `Phalcon\Config\Config::setData` to pass the `insensitive` flag to child objects [#16171](https://github.com/phalcon/cphalcon/issues/16171)
- Fixed `Phalcon\Config\Adapter\Groupped::__construct` to pass the `insensitive` flag to child objects [#16171](https://github.com/phalcon/cphalcon/issues/16171)
- Fixed `Phalcon\Session\Manager::setName`, removing the regex check for the name for custom adapters to work with `create_sid()` [#16170](https://github.com/phalcon/cphalcon/issues/16170)
- Fixed `PdoResult::fetchAll` when passed class name in 2nd argument [#16177](https://github.com/phalcon/cphalcon/issues/16177)
- Fixed `Forms\Form::label` to accept an array as a default variable [#16180](https://github.com/phalcon/cphalcon/issues/16180)
# The difference between progressive and partial hydration
Tags: hydration, webdev, javascript
Published: 2022-10-24 19:08:18

TL;DR: Progressive Hydration is about the _WHEN_, Partial Hydration is about the _WHAT_

For some time I'm trying to understand the whole thing about rendering patterns. Hydration is a big part of it. The internet is full of articles and tutorials about hydration and how to implement it. But there are fewer about what it really is and how to distinguish between the different types of hydration.

This article won't go into depth because there is other great content out there. Some of the best was created by [ryansolid](https://twitter.com/RyanCarniato). However, I would like to give a quick note to someone who is trying to understand the whole thing about hydration.

## Hydration

Hydration is the process bringing a app which is rendered by the server into the same state as it was rendered by the client. This involves work to download javascript, attach eventlisteners to the correct DOM nodes and recover state on the client side. This work comes at cost. Bandwidth is needed to transfer the data within the javascript to your client. CPU time for parsing and running javascript. All of this may slow your app. In the worst case users needs to deal with the "uncanny valley" effect, where the app seems like it is ready, but hydration isn't finished yet, and therefore it's not yet interactive. 

To mitigate this issues there are several approaches to optimize hydration. I would like to explain two of them.

## Progressive hydration

The first is progressive hydration, which tries to reduce the amount of data which is sent to the client for bootstrapping your application. Instead of fully hydrating your app at once, only chunks of data are sent to the client and parts are hydrated. Those parts may be hydrated if a special event is triggered like clicking a button or if a component comes into the viewport. Your app is ~~building-up~~ hydrating up.

## Partial hydration

In comparison, partial hydration uses knowledge about the structure of your application. You as a developer or perhaps a smart compiler, knows which part of your application is always static or requires javascript. This knowledge can be used to determine which parts of your application need to be hydrated.

## Conclusion


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



If you look at it from an exaggerated point of view, you could take spacetime as an analogy. Progressive hydration is the _WHEN_, represented as time axis. Partial hydration is about _WHAT_ part in your application should be hydrated. Its like describing somewhats position onto the space axis. 


_Please note, that I do not think getting much range with this post and it was a quick type. Therefore, some parts could be improved. If something needs to be corrected let me know in the comments :)_
25+ Top Websites to Find Remote Tech Work Online in 2022
Tags: freelance, remote, career
Published: 2022-10-24 18:59:13

Remote work is gaining more traction every day as it allows so much flexibility and a better lifestyle for global talent. In contrast to how some thought leaders promote it, the overall picture is much more detailed than this.

For companies, it expands their talent pool to a global scale, rather than looking for candidates locally. Without remote hiring, if companies try searching for global talent, it comes with its own challenges like lacking expertise in different geographics (knowing which companies have the best talent in country X or which college graduates are better) or onboarding becomes very costly (relocation, cost of wrong hiring is extremely painful for both the company and the candidate). Remote hiring also allows companies to reduce costs while offering better compensation due to various tax obligations in different countries.

For candidates, it is a great advantage because they become available to work for a huge number of companies globally. This allows them to have better salaries, healthier work-life balance, and cost reduction due to not commuting.

Remote work is becoming more common, particularly for tech talent as managing tech work has better practices and scaling up (in some cases, scaling down) makes hiring remotely inevitable.

In this article, I’ve compiled 25+ websites to find remote tech work online:

Check the websites below to find your next remote tech job:

1- [Remoteng.com ](https://remoteng.com/)

2- [We Work Remotely](https://weworkremotely.com/)

3- [Remote OK](https://remoteok.com/)

4- [Remotebase](https://remotebase.com/) 

5- [Producthunt](https://www.producthunt.com/jobs?&) 

6- [Flexjobs](https://www.flexjobs.com/)

7- [Lemon.io](https://lemon.io/)

8- [YCombinator](https://www.ycombinator.com/jobs/role/all/remote/) 

9- [Upstack](https://upstackhq.com/)

10- [PowerToFly](https://powertofly.com/) 

11- [Remote Tech Jobs](https://www.remotetechjobs.com/)

12- [Upwork](https://www.upwork.com/)

13- [Fiver](https://www.fiverr.com/)

14- [Landing Jobs](https://landing.jobs/)

15- [Github](https://github.com/)

16- [Stackoverflow](https://stackoverflow.com/jobs/companies)

17- [Dice](https://www.dice.com/)

18- [Gun.io](https://gun.io/)

19- [Authentic Jobs](https://authenticjobs.com/)

20- [Arc Dev](https://arc.dev/)

21- [Angel.co](https://angel.co/jobs)

22- [JustRemote](https://justremote.co/)

23- [Remote.co](https://remote.co/remote-jobs/)

24- [Pangian](https://pangian.com/)

25- [Skip the Drive](https://www.skipthedrive.com/)

26- [Remotive](https://remotive.com/)

27- [Jobspresso](https://jobspresso.co/)
99% of Python Programmers don't know this feature
Tags: python
Published: 2022-10-24 18:22:05

Did you use or know about this feature before?

```python
text = "PYTHON"

print(f"{text}")
# PYTHON
print(f"{text:#<20}")
# PYTHON##############
print(f"{text:_>20}")
# ______________PYTHON
print(f"{text:.^20}")
# .......PYTHON.......
```