teleren/devto huggingface dataset:
A quick n' gentle intro into Service Meshes 🕸
Tags: microservices, servicemesh, beginners, kubernetes
Published: 2022-01-14 16:06:39

I recently started at Google as a DPE (developer programs engineer). Part of my job is to keep tabs on what happens in the open source world. 
I have been looking around the CNCF landscape recently, and after attending some virtual talks at the end of last year, I wanted to dedicate time to have a better understanding of the world of OSS (open source software).

This article is just a soft intro in service meshes. With security being such a hot topic last year, I believe that service meshes will be highlighted (it already is!) into being leveraged as a security tool.

_So, what is a service mesh?_
I think an important question to ask first is why did the need of service mesh ever happen?
Well, with the rise of microservices, all of the service-to-service communication needed to be monitored. Developers found that communication logic needed to be included in within their pods. That's more overhead for developers - they primarily want to focus on the business logic of their apps.

Enter the *service mesh*. To put it simply, a service mesh is a way to connect, manage, and monitor your services as they communicate with each other. This decouples the tools of communication from your apps (low coupling high cohesion mentality), and pushes this logic to the infrastructure layer.

So how does it work??
Each service that you have is configured to route traffic to a local proxy (installed as a _sidecar_). A proxy is a 'sidecar' that sits next to your business application container. It exposes primitives that manage communication logic (retry, encryption info, routing rules, etc). 
So to recap what we know so far, each service for your app has a proxy that sits right next to it. All these proxies together form the 'mesh' - hence the service mesh! 

This is a high level description of service meshes, please let me know if you have any questions!! I plan to do a deeper dive in the components of the service mesh soon😎 Stay tuned!
twitter: [@christineskim_](https://twitter.com/christineskim_)
_Some useful reads_
[Istio - About](https://istio.io/latest/about/service-mesh/)
The [Istio Architecture diagram](https://istio.io/latest/docs/ops/deployment/architecture/) is a great infographic for how it looks.
Resolving "rb_check_safe_obj will be removed in Ruby 3.0" warning
Tags: ruby, rails, rbchecksafeobj
Published: 2022-01-14 15:57:51

---
title: Resolving "rb_check_safe_obj will be removed in Ruby 3.0" warning
published: true
description: 
tags: Ruby, Rails, rbchecksafeobj
---

**TL;DR** Paste this in an initializer or very early in require chain.

```rb
# Problem on Ruby 2.7
# > BigDecimal(1).to_s("F")
# (pry):1: warning: rb_check_safe_obj will be removed in Ruby 3.0
# This monkeypatch silences it.
# TODO: remove when on Ruby 3+
module BigDecimalFormatWarningSuppressor
  # NOTE: this API comes from ActiveSupport::NumericWithFormat, the last ancestor prepended to
  # BigDecimal.
  def to_s(format = nil, options = nil)
    original_verbosity = $VERBOSE
    $VERBOSE = nil
    v = super
    $VERBOSE = original_verbosity
    v
  end
end

BigDecimal.prepend(BigDecimalFormatWarningSuppressor)
```

## Discussion
Not sure what the deal is with BigDecimal's string formatting, but we can see in `#to_s`'s [source](https://apidock.com/ruby/v2_6_3/BigDecimal/to_s) that it does indeed call `rb_check_safe_obj` function and it apparently is whiny.  

Setting `$VERBOSE` to `nil` is the same as running with `RUBYOPT=-W0`.
Download Any YouTube Video With 5 Lines Of Code In Python
Tags: beginners, programming, python, tutorial
Published: 2022-01-14 15:54:13

So am going to teach you how to download any YouTube video you like with 5 lines of python. seems impossible right? Don't worry it possible and achieving anything in tech is **Possible**.

## Let Start Coding
There are few steps for us to take in achieving this.

**First open your code editor(VScode or Atom)** 

- create a file and name it anything you like `app.py` with py as your extension.
- Then you need to install `pytube` by running this code in your terminal.
```
pip install pytube
```

**Once the installation is done, then we need to import `YouTube` from pytube**.
```
from pytube import YouTube
```

**Then we need to create and call the path in which the video will be downloaded.**
```
DOWNLOAD_FOLDER = "./"
```
_for me I use the current folder as my DOWNLOAD_FOLDER Path._

**Then we need to get the link of the video we want to download from YouTube Site.**
```
video_url = "https://www.youtube.com/watch?v=x7X9w_GIm1s"
```
_The video_url is a YouTube video [Python in 100 Seconds](https://www.youtube.com/watch?v=x7X9w_GIm1s)_

**Then we need to create a youtube object and assign the video_url to it.**
```
video_obj = YouTube(video_url)
```

**Then we need to create a media stream and know there are streaming technique adopted by YouTube.**
```
stream = video_obj.streams.get_highest_resolution()
```

**Then we need to use the download method to save the file**
```
stream.download(DOWNLOAD_FOLDER)
```

## Your Code Should Be Like This

```
from pytube import YouTube
DOWNLOAD_FOLDER = "./"
video_url = "https://www.youtube.com/watch?v=x7X9w_GIm1s"
video_obj = YouTube(video_url)
stream = video_obj.streams.get_highest_resolution()
stream.download(DOWNLOAD_FOLDER)
```
Then one more thing, you could add a print statement to know when is done, by writing this one line of code.
```
print("Download Complete")
```
Then click the `Run button` on your **code editor** and watch how your video get downloaded into your folder. **Hurray you made it!!!**

- Want to read the pytube doc, here is the link [pytube doc](https://pytube.io/en/latest/user/install.html)

Thanks for reading. 
follow me on twitter 
[@Eworld_Tech](https://twitter.com/Eworld_Tech)
Logitech k380 Review: A multi-device Bluetooth Keyboard (Great choice for travel)
Tags: productivity
Published: 2022-01-14 15:53:15

A good keyboard can set your mood any day! I was looking for a new keyboard to carry here and there, and I found this beauty! This Logitech keyboard looks super cool when I first look at it. However, it was pretty expensive because I had never brought a keyboard for more than 10$ before. It cost me around 30$.

## Build
I’ll suggest going through Logitech official website page for the details about it – https://www.logitech.com/en-my/products/keyboards/k380-multi-device.920-009579.html

{% instagram CYru8Yuh7ob %}

## Impact on my life

- **Three device connectivity:** This is one of the main reasons I wanted to buy it. It’s super easy to connect with multiple devices at the same time. I can use it with my desktop; also with my laptop. Easy to switch. Take really low time to reconnect. 
- **Windows & Mac support:** Another fantastic feature of this keyboard. You can use just it with mac or windows, and it has specific keys for both! If you have a desktop & a MacBook, this can be an excellent choice!
- **Compact size:** It’s a small, compact size keyboard. I like a big keyboard, but it’s fun to type and has enough space.
- **Easy to travel with:** If you are traveling and thinking about getting a keyboard with you, this is one of the best. I’ve taken this one to multiple places, and the experience was great!
- **Buttons are comfortable:** It has round keys. If you are coming from square keys, it can be a slight issue at the start. But somehow, it’s super comfortable. My typing speed is impressive with it. I got around 90+ words per min with this one!

## What I’m missing in it
- **Numberpad:** I’m more into big keyboards, so I miss the number pad here. But as a travel one, this is nothing serious!
- **Battery:** It uses an AAA battery, so I can’t see how much charge it has like other devices. This is sad because I don’t know when it will die. So I’ve to keep the battery on storage, but when I travel, maybe there can be some point I’ll not find the battery because I don’t carry the battery with me.


Getting a proper keyboard is needed. Otherwise, this can affect you in multiple ways. So spend a little bit of time choosing the proper one. Proper one can help you do different stuff efficiently, and if you want to try this model, go ahead and feel free to try it. It’s a fantastic keyboard for sure!


{% instagram CMcHe33JCJZ %}
JSON for Beginners in Plain English
Tags: javascript, webdev, beginners
Published: 2022-01-14 15:45:56

![JSON](https://images.unsplash.com/photo-1516637090014-cb1ab78511f5?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1170&q=80)

**JSON** is used for data transfer between client and server by software applications.

### History
- Before **JSON** was introduced **XML(Extensible Markup Language)** was the only preferred way to transfer data between client and server.
- Later in early 2000, **JSON** got birth and replaced XML as a data format

### What is JSON?
- **JSON** stands for **J**avaScript **O**bject **N**otation
- **JSON** is lightweight, while being human- and machine-readable.
- The collection of data contains a key-value pair where the key must be a **string**, and the value can be any of the following:
![value.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1642173391108/LvLB2PqQY.png)
Image: json.org

Important rules to keep in mind:
- In **JSON** key values must be enclosed by double quotes
- Key and the value must be separated by a colon `:` 
- Each pair must be separated by comma `,`

Here's how JSON looks like
```json
{
    "name": "SnowBit",
    "favouriteLang": "JS"
}
```

That's it for now 
***
Thank you for reading, have a nice day!

![Have a nice day.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1642086620246/trLPKY6le.png)
- Follow me on Twitter - [@codewithsnowbit](https://twitter.com/codewithsnowbit)
- Subscribe me on YouTube - [Code With SnowBit](https://www.youtube.com/channel/UCNTKqF1vhFYX_v0ERnUa1RQ?view_as=subscriber&sub_confirmation=1)
Google Sign in using Supabase, NextJS
Tags: webdev, beginners, tutorial, react
Published: 2022-01-14 15:36:00

Supabase is really an awesome opensource 👌 alternative to Google's Firebase. Its really really simple to setup the database, authentication flow, uploading/downloading stuffs to/from the server. In this tutorial let's create a really simple authentication system that uses Google's oAuth to authenticate users and is **persistent **also incase you close the browser also.🤩

For this tutorial we'll use NextJS for frontend (you can choose react/remix as you prefer), tailwind for little styling as it makes CSS styling superrrrr fast. ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8rpmtk0gtbdtjaov7u0o.gif)


_Just a simple login page for demo:_
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hz3w2hjpjg7nnjhe0fya.jpg)


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

Setup your Google Cloud Project using the official tutorial from the Supabase team by going to this _[link](https://supabase.com/docs/guides/auth/auth-google):_

Fork this _[Repo](https://github.com/rajesh6161/SupabaseOAuth)_ and integrate in your own project easily plus you can easily customize it with no breaking changes.🤩

Hope it helps you! ✌️ and if you have any issues please let me know in the comments.
_https://github.com/rajesh6161/SupabaseOAuth_
What resources help you to learn a new API?
Tags: api, learning, twitter, discuss
Published: 2022-01-14 15:28:07

In my day job, when I'm not learning things by reading and sharing here on DEV, I'm a [developer advocate at Twitter](https://dev.to/andypiper/my-developer-advocacy-origin-story-395k). I've been doing this for quite a long time now, and I recognise that while I'm always learning for myself, I don't always stop to _think about how other people learn_.

I know that personally, I learn best from getting started guides, example code that makes sense, and the ability to "play with" an API using some kind of explorer or [command line](https://dev.to/twitterdev/how-to-use-twurl-to-quickly-test-the-twitter-api-4n48). I do not usually get so much from videos (but I love to take part in making them!).

How do _YOU_ learn to use new APIs?

The more specific question / broader background...

In November, we [launched Twitter API v2](https://blog.twitter.com/developer/en_us/topics/tools/2021/build-whats-next-with-the-new-twitter-developer-platform), which is a whole new way to access Twitter data, based on the OpenAPI specification, and with a more modern experience than v1.1 (which is around 11 years old - pretty rare for an API to last that long without major changes). We've hosted some [Twitch streams](https://twitch.tv/twitterdev) and [Twitter Spaces](https://twitter.com/twitterdev) to talk about it. 

We have [documentation](https://developer.twitter.com/en/docs/twitter-api/getting-started/about-twitter-api), a [Postman Collection](https://documenter.getpostman.com/view/9956214/T1LMiT5U), and [sample code](https://github.com/twitterdev/Twitter-API-v2-sample-code).

{% github twitterdev/Twitter-API-v2-sample-code %}

If you had the chance to request an educational resource about the Twitter API, what would you ask for? Tutorials, videos, Twitch, code? Any particular topic you want to know more about? Should we provide code in different languages - which ones, and why? Let me know in the discussion below, or [follow me on Twitter](https://twitter.com/andypiper) and Tweet me a suggestion!
Liman MYS'de LDAP organizasyon birimi yetkilerinin düzenlenmesi
Tags: liman, yetki, ldap, ou
Published: 2022-01-14 15:16:08

Liman MYS'nin kurumsal sürümünde yer alan "Domain eklentisi"nde bildiğimiz üzere domain LDAP şemasını görebildiğimiz bir ağaç yapımız var. Bu yazımızda ağaç yapısı üzerinde **kullanıcı bazlı yetki düzenlemesi** yapmayı göstereceğiz.

Öncelikli olarak Domain Eklentisi'ni LDAP üzerinde izin yönetimi yetkisine sahip olan kullanıcı olarak **administrator** bilgileriyle giriş yapıyoruz. Bu ayarlar LDAP üzerinde izin yönetimi yetkisine sahip herhangi bir kullanıcı ile de yapılabilir.

Eklentiyi eğer ilk defa açıyorsak zaten giriş ekranında **Eklenti Ayarları** sayfası açılır ve bizden bir domain kullanıcı adı ve parolası ile doğrulama yapmamızı ister. Fakat eklentiye daha önce giriş yapıldıysa sağ üst köşedeki **Eklenti Ayarları** butonu ile bu ekrana gidebiliriz.

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


Gelen ekranda **Kullanıcı Adı** kısmına domaindeki kullanıcı adımızı, Parola **kısımlarına** da şifremizi yazarak **Kaydet** dediğimizde domain eklentisine bu kullanıcının yetkileriyle giriş yapmış olacağız. Bu ekranı unutmayalım çünkü yazının ilerleyen kısımlarında tekrar değineceğiz. İlk olarak **administrator veya yetkili bir kullanıcı ile giriş yaptığımıza emin olalım**.

![2](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5obndl5a2c01zp7gswq6.png)


Tekrar eklentiye gelecek olursak, **belli bir organizasyon birimi (OU) üzerinde kullanıcı bazlı yetki düzenlemesi** yapacağımızdan istediğimiz bir OU üzerine gelerek sağ tıklıyoruz ve **Yetkileri Düzenle** diyoruz.

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


Önümüze gelen **İzinler** ekranında **Kullanıcı veya Grup** kısmındaki **Ekle** butonuna tıklayarak yetkilerini düzenlemek istediğimiz kullanıcı adını aratıyoruz. Kullanıcımıza tıklayarak **Ekle** butonuna basıyoruz.* Ardından gelen ekranda default olarak seçtiğimiz kullanıcının **Okuma (Read)** izni gözüküyor. Biz bunu **REDDET** konumuna getiriyoruz ve alt taraftaki Uygula butonuna tıklayarak seçimlerimizi kaydediyoruz.

**Aynı şekilde İzinler kısmından silmek istediğimiz bir kullanıcı veya grup olduğunda Kullanıcılar veya Grup kısmından seçerek Sil diyebiliriz.*

![4](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yf8p18bsgzc8gxudrfsn.png)



--------------------------------------------------------



![5](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ftbe2ch4b1p0634r2wjo.png)

Şimdi ise sıra geldi bu kullanıcının elinden aldığımız okuma yetkisini test etmeye. Şimdi ise yazının ilk kısımlarında gösterdiğimiz **Eklenti Ayarları** sayfasına giderek bu sefer yetkileriyle oynadığımız kullanıcının bilgileriyle giriş yapıyoruz. **Kaydet** butonuna tıkladığımızda gelen ağaç yapısında az önce okuma yetkisini kaldırdığımız birimi **göremedik**. Bu vesileyle de yetki düzenlemesini başarıyla sağlayabildiğimizi görmüş oluyoruz.

![6](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hla0jdbm7i92oz3oxbp2.png)
Ways to use map() function
Published: 2022-01-14 15:01:34

**to return more than one value**

```
let desig
    let reqId
    const searchRow = data.map(opts => {
      desig = opts.value.split(' - ')[0]
      reqId = opts.value.split(' - ')[1]
    })
    console.log("desig", desig)
    console.log("reqId", reqId)
```
**to return one value**

```
const objectIds = jobIds.map(id => id._id)
console.log("objectIds", objectIds)
```
**to return arrays**

```
const corporateOptions = result.map(opt => {
        opt.Candidate.map(desig => {
          
          desigArray.push(desig.cDesig)
        })
        opt.Jobdata.map(reqid => {
          reqIdArray.push(reqid.reqId)
        })
      })
```
**to return object arrays**

```
 let result = []
        filterIntreviews.map((ob) => {
          let createObj = {
            id: ob.id,
            cName: ob.cName,
            reqId: ob.reqId,
            desig: ob.desig
          }
          result.push(createObj)
         })

        console.log("result", result)
```
**To create an array from array object**

```
counterArray [
  { counter: 1 },
  { counter: 2 },
  { counter: 3 }
]
const counters = counterArray.map(ct => ct.counter)
console.log(counters)
output will be => [1, 2, 3]
```
Temporal Dead Zone
Tags: javascript
Published: 2022-01-14 14:53:15

_Hello Everyone, So today I'll talk about the** Temporal dead Zone** in JavaScript._

**Temporal Dead Zone(TDZ)** is basically refers to the duration between a variable declaration and it's initialization. TDZ occurs when we use **const** and **let** for declaring our variables.

Let's look into some of the examples that explains this concept.

This concept of **TDZ** in JavaScript comes from the concept of hoisting let & const variables.
Like var, let & const are also hoisted but in a different way.

```
Hoisting example for var:
console.log(a); //undefined no error
var a = 10; 
```
> Here in the above examples explains the concept that no matter your variable after declaration is being initialized or not, it will get a value of undefined during execution if you haven't assigned that variable.

```
Hoisting example for let variables:
console.log(b); 
let b = 20;
```
> Here in the above example you'll get a reference error, this is because a let variable is being allocated memory in separate space [unlike var variable that is being allocated memory in the global object (i.e; the window object)] which we can't access until we assign some value to that variable. That means let variables can't be accessed until assigned some value to it.

Same goes with the const variables also if you try to access them before initialization it will throw a reference error.

So, the basic idea is let and const variables remains in TDZ until it gets some value assigned to it, once the initialization is done TDZ ends for that specific variable.

Tip: To avoid TDZ always try move all your declaration and initialization part to the top of your program so that before the main logic the execution hits the initialization part.

So, that's it for this time. I hope I made the points clear.
Thank you!!!

_Happy Reading!!!_
Syllables in English words
Published: 2022-01-14 14:48:38

Today, Sankranthi is a day off from work. Long weekends put me in a relaxed mode. But my professional and hobby pursuits make me more relaxed not by staying away from them but by engaging with them. Hence programming and literature today also.

The interest of the day was syllables, the zeroth step towards English poetry, the first step being rhymes and meters. Starting from zero is not weird, computers start indexing from zero.

Poked around the web and made notes. The following screenshots show today's research.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/59mrwp9vys0mpcbytwbp.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/v0miz4o2bwoqkog838tb.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rfciqc5d0dzz4s2vmz8t.png)
Tutorial to Build Full Stack TikTok Clone
Tags: flutter, firebase, tiktok, dart
Published: 2022-01-14 14:31:59

I made a tutorial to build Full Stack Tiktok Clone with Flutter, Firebase & GetX.
Link: https://youtu.be/4E4V9F3cbp4

Features:
- Authentication with Email & Password
- Uploading Videos with Caption
- Compressing Videos
- Generating Thumbnails Out of Video
- Displaying Videos with Caption
- Liking on Posts
- Commenting on Posts
- Liking the Comments
- Searching Users
- Following Users
- Displaying Followers, Following, Likes & Posts of User
- TikTok Like UI
The algorithms of the tech giants soon accessible by China?
Tags: news
Published: 2022-01-14 14:30:06

China wants to bring a draft regulation into force on _1 March_.

This draft regulation aims to **limit the algorithms** of its giants, and to **control the recommendations** that these algorithms can make. This law will also aim to **give users control over the recommendations** that will be made on different sites such as :

- Social networks
- E-commerce sites
- And so on...

They will even be able to simply delete the recommendations made by the algorithms of the tech giants.

China is not the only one to want to have a say in the algorithms of its giants, as their European counterparts also want to implement this regulation with the [Digital Act Service](https://en.wikipedia.org/wiki/Digital_Services_Act) in order to better control the algorithms of the major platforms.

This could also be detrimental to the tech giants who wish to keep their algorithms secret, and they will probably look for a way to circumvent the new regulation to avoid their business model being really affected.

Source : [CNBC](https://www.cnbc.com/2022/01/07/china-to-regulate-tech-giants-algorithms-in-unprecedented-move.html)


<a href="https://www.buymeacoffee.com/tykok"><img src="https://img.buymeacoffee.com/button-api/?text=Buy me a sushi&emoji=🍣&slug=tykok&button_colour=5F7FFF&font_colour=ffffff&font_family=Cookie&outline_colour=000000&coffee_colour=FFDD00" /></a>
python functools total ordering
Tags: python
Published: 2022-01-14 14:24:17

---
canonical_url: https://waylonwalker.com/python-functools-total-ordering/
cover_image: https://images.waylonwalker.com/python-functools-total-ordering.png
published: true
tags:
- python
title: python functools total ordering
---

`functools.total_ordering` makes adding all of six of the rich comparison operators to your custom classes much easier, and more likely that you remember all of them.


> From the Docs: The class must define one of \_\_lt\_\_(), \_\_le\_\_(), \_\_gt\_\_(), or \_\_ge\_\(). In addition, the class should supply an \_\_eq\_\_() method.



[Total Ordering Docs](https://docs.python.org/3/library/functools.html#functools.total_ordering)

Here is an example using the Enum I was working on the other day.

``` python
from enum import Enum, auto from functools import total_ordering


@total_ordering
class LifeCycle(Enum):

    configure = auto()
    glob = auto()
    load = auto()
    pre_render = auto()
    render = auto()
    post_render = auto()
    save = auto()

    def __lt__(self, other):
        try:
            return self.value < other.value
        except AttributeError:
            return self.value < other

    def __eq__(self, other):
        try:
            return self.value == other.value
        except AttributeError:
            return self.value == other

```