teleren/devto huggingface dataset:
GitLab vs GitHub
Tags: github, git
Published: 2021-02-22 09:25:25

Git is a version control system that allows developers to keep their code organized by keeping track of previous versions of their code. It also allows other developers to copy the code and make changes to it. Developers can take another developers code and change it and then submit the revised code back to its original creator, this is known as a pull request. The original creator can then decide whether or not to merge that code with their work.  
#GitHub
One of the ways to use git is through GitHub. GitHub is a repository hosting service and a git repository stores all the different versions of code. This allows users to access previous versions of their code and allow them to compare the code they made and the code that was altered by other developers. With GitHub multiple developers can work on the same code and resolve issues faster. Some of the features of GitHub are it can compare different versions of the code, users can create a private repository but only have a maximum of three developers, and GitHub allows users to point out specific areas of the project and create milestones for where the project should be. 
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3cqg11latidzvwfsndf5.png) 
#GitLab
GitLab is another git repository hosting service like GitHub, but provides a lot more features and ways for users to track what happens to their code. GitLab allows more than three developers to work on a private repository and it allows users to give and restrict permissions based on a developer's role. GitHub is also effective at tracking issues and developers can easily report any issues they find and can assign someone to correcting it. Developers can also create commit graphs and use reporting tools to monitor all the changes and work that is being done. GitHub does not have a built in deployment platform, but instead a developer would need to add another application for the code to be able to deploy. GitLab, however, does have built in and easy way to deploy code. GitHub and GitLab are very similar and provide the same things, but GitLab provides more than what GitHub has. 
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/olx4euvwucnmxi6pj9va.png)
 Personally I prefer to use GitLab. Even though GitHub was created first GitLab offers more. GitLab is more useful in planning, verifying, configuring, and monitoring. 
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s2wh2a05l7ueckridxib.png)Image Source: [GitHub](https://about.gitlab.com/devops-tools/github-vs-gitlab/) 
Here is a Video were I go into more detail:
[YouTube](https://youtu.be/Q6jxYMd8QYg)
Sources:
https://git-scm.com/
https://www.geeksforgeeks.org/difference-between-gitlab-and-github/
https://www.geeksforgeeks.org/bitbucket-vs-github-vs-gitlab/?ref=rp
https://about.gitlab.com/devops-tools/github-vs-gitlab/
Private chat with Socket.io, Redis on Node.js
Published: 2021-04-08 16:10:55

---
title: Private chat with Socket.io, Redis on Node.js
published: true
date: 2021-02-22 09:09:09 UTC
tags: 
canonical_url: https://boobo94.github.io//research/private-chat-example-socket-io/
---

Socket.io has a really good example how to implement a simple chat with private rooms (1:1)

1. [https://socket.io/get-started/private-messaging-part-1/](https://socket.io/get-started/private-messaging-part-1/)
2. [https://socket.io/get-started/private-messaging-part-2/](https://socket.io/get-started/private-messaging-part-2/)
3. [https://socket.io/get-started/private-messaging-part-3/](https://socket.io/get-started/private-messaging-part-3/)
4. [https://socket.io/get-started/private-messaging-part-4/](https://socket.io/get-started/private-messaging-part-4/)

Github repo[https://github.com/socketio/socket.io/tree/master/examples/private-messaging](https://github.com/socketio/socket.io/tree/master/examples/private-messaging)
So legen Sie einen Klingelton für Android fest
Tags: ringtone, ringtones, klingelton, mp3
Published: 2021-02-22 09:08:49

Android-Telefone verfügen bereits über einen Klingeltonschneider im System, sodass Sie den gewünschten Klingelton abschneiden können, ohne den Klingelton auf Ihrem Computer abschneiden und dann auf Ihr Telefon übertragen zu müssen. Sie können auch einen [Klingelton](https://klingeltonemp3.com/) für jede Telefonnummer auswählen, der ausschließlich als Klingelton zur Identifizierung verwendet wird. Alle Operationen werden einfach direkt am Telefon ausgeführt. Der folgende Artikel zeigt, wie Sie Klingeltöne unter Android schneiden.
## 1. Anweisungen zum Schneiden von Android-Klingeltönen

Schritt 1:

Tippen Sie im Musikalbum Ihres Android-Telefons auf das Lied, das Sie als Klingelton auswählen möchten. Klicken Sie dann in der Musikwiedergabeoberfläche unten auf das Scherensymbol. Wechseln Sie dann zur Benutzeroberfläche, um Segmente als Klingeltöne auszuschneiden. Abhängig vom Typ des Android-Telefons und der von Ihnen verwendeten Android-Version kann diese Benutzeroberfläche unterschiedlich sein.

Schritt 2:

Sie können das Musikstück finden, das Sie schneiden möchten, indem Sie den ersten und den letzten beiden Takt ziehen, um das Lied auszuwählen. Musik kann durch Drücken von Wiedergabe in der Vorschau angezeigt werden. Wenn Sie fertig sind, drücken Sie die Taste Als Klingelton festlegen.

Falls Ihr Telefon keinen direkt geschnittenen Klingelton auf dem Telefon hat, müssen wir den Klingelton von außen abschneiden und dann auf das Gerät übertragen. Wählen Sie dann in den Einstellungen einen Klingelton.

## 2. So ändern Sie den Klingelton unter Android
Schritt 1:

Gehen Sie zu Einstellungen und wählen Sie Sound & Vibration. Drücken Sie dann Klingelton, um einen Klingelton auszuwählen.

Schritt 2:

Klicken Sie auf, um einen Klingelton hinzuzufügen, und klicken Sie dann auf Weiter auf Klingelton auswählen auf dem Gerät, oder klicken Sie auf die Schaltfläche Hinzufügen. Jetzt müssen Sie zum Musikalbum auf Ihrem Telefon gehen und den Titel auswählen, den Sie als Klingelton festlegen möchten.

## 3. So legen Sie Klingeltöne für Kontakte unter Android fest
Bei einigen Android-Geräten können Sie bereits für jeden Kontakt einen eindeutigen Klingelton auswählen, den Sie leicht unterscheiden können.

Schritt 1:

Öffnen Sie die Kontakte auf Ihrem Telefon, tippen Sie auf den Kontakt, für den Sie Ihren eigenen Klingelton festlegen möchten, und tippen Sie anschließend auf Standardklingelton.

Schritt 2:

Jetzt wird die Benutzeroberfläche der verfügbaren Klingeltöne auf dem Telefon angezeigt. Wenn Sie einen neuen Klingelton auswählen möchten, drücken Sie Klingelton auswählen auf Ihrem Gerät. Anschließend öffnen Sie auch das Musikalbum im Gerät, um einen bestimmten Klingelton für diese Telefonnummer auszuwählen.
Create your first Laravel Project on Docker using Laravel Sail
Tags: laravel, sail, docker
Published: 2021-02-22 08:31:08

---
title: Create your first Laravel Project on Docker using Laravel Sail
published: true
description: Create your first Laravel project on docker using Laravel Sail, which is a light weight command line interface for interacting with Laravel's default docker configuration.
tags: laravel, sail, docker
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lok6gwd0yztgjqjamxmi.png
---

There are multiple ways to develop and run Laravel project on your system but here is the easiest way to create your Laravel project on docker using Laravel Sail which is a light weight command line interface for interacting with Laravel's docker configuration.

All you need to do is install docker on your system, you can use either Docker cli or Docker Desktop and rest of the thing are all taken care by Laravel Sail.

Before we start, if you want then you can also watch this tutorial.
{% youtube hcPQV3QymU8 %}

Let's Start! 

To install Docker Desktop, [Click here](https://www.docker.com/products/docker-desktop).

After Docker is installed and running, run the following command to create a new Laravel Project.

```bash
curl -s https://laravel.build/example-app | bash
```

After your project is created, go inside your application directory and start **Laravel Sail**.

```bash
cd example-app

./vendor/bin/sail up
```

Once done, You can access your application at [http://localhost](http://localhost).

You can execute all your commands like this:
```bash
./vendor/bin/sail php --version

./vendor/bin/sail node --version

./vendor/bin/sail php artisan list
```

You can also create an alias for sail if you don't want to type **vendor/bin/sail** repeatedly.

```bash
alias sail='bash vendor/bin/sail'

```

Then you can execute your commands like this:
```bash
sail php --version

sail node --version

sail php artisan list
```

To stop all your containers, you can type **Ctrl+C** or you can also use **sail down** command.

Hope you find this useful.
Magento 2 cache element on a page (block) by store id  
Published: 2021-02-22 08:25:12

Magento 2 has several ways to cache the block. 

Cacheable Block
In case, cache_lifetime of the block is set to a number greater than 0, the block is cacheable (for block cache).

When To Use
You should use the cacheable block in the following situations:

The block is frequently used. For example, the same block with the same content is shown on several pages.
The block is a cacheable part of the non-cacheable page.
How To Use
Take the following actions to use the cacheable block:

Setting cache_lifetime via layout XML:
```
<block class="MyBlock">
    <arguments>
        <argument name="cache_lifetime" xsi:type="number">3600</argument>
    </arguments>
</block>
```
Setting cache_lifetime via DI configuration:
```
<type name="MyBlock">
    <arguments>
        <argument name="data" xsi:type="array">
            <item name="cache_lifetime" xsi:type="number">3600</item>
        </argument>
    </arguments>
</type>
```
Setting cache_lifetime wondrously in imperative way:
```
$block->setCacheLifetime(3600);
// or
$block->setData('cache_lifetime', 3600);
```

Overriding retriever method (often used in core modules for some reasons):
```
class MyBlock extends AbstractBlock
{
    protected function getCacheLifetime()
    {
        return 3600;
    }
}
```

it will cache content globally for the entire Magento 2 store. 


You can add cache key to cache by Store ID:

```
<?php

namespace My\Something\Block\Name;

use Magento\Cms\Block\Block;
use Magento\Framework\View\Element\Context;
use Magento\Cms\Model\Template\FilterProvider;
use Magento\Store\Model\StoreManagerInterface;
use Magento\Cms\Model\BlockFactory;

class MyBlock extends Block
{
    /**
     * @var int
     */
    private $blockId;

    /**
     * @var Config
     */
    private $configProvider;

    public function __construct(
        Context $context,
        FilterProvider $filterProvider,
        StoreManagerInterface $storeManager,
        BlockFactory $blockFactory,
        array $data = []
    ) {
        parent::__construct($context, $filterProvider, $storeManager, $blockFactory, $data);
    }

    /**
     * Cache block by Store ID
     */
    public function getCacheKeyInfo()
    {
        return array_merge(parent::getCacheKeyInfo(), ['store' . $this->_storeManager->getStore()->getId()]);
    }
}
Styled-components with typescript
Tags: react, javascript, typescript, jsx
Published: 2021-02-22 08:15:41

# First lets discuss what is styled components and how it is useful :-

styled-components is the result of wondering how we could enhance CSS for styling React component systems. By focusing on a single use case we managed to optimize the experience for developers as well as the output for end users. 

The Motivation behind styled components were the following
1.Automatic critical CSS
2.No class name bugs
3.Easier deletion of CSS
4.Simple dynamic styling
5.Painless maintenance
6.Automatic vendor prefixing

# How we can use styled-component with typescript
consider this example
```jsx
const DIV = styled.div`
  color: red;
  font-size : 21px;
  margin-left : 1.5rem;
  &::before {
    content: "<div>";
    font-family: "La Belle Aurore", cursive;
    color: yellow;
    font-size: 18px;
    position:absolute;

  }
  &::after {
    content: "</div>";
    font-family: "La Belle Aurore", cursive;
    color: yellow;
    font-size: 18px;
    position:absolute;
  }
`;
```
So if you are not passing any props for dynamic styling then there is no difference.

Lets Consider you are using something like this

`jsx <DIV backgroound ="red" color = "yellow" />`

for using this type of component using styled components we need to have a interface for the props variables like this

```jsx
interface StyledDivProps {
    background: text;
    color : text,
}

const DIV = styled.div<StyledDivProps>`
  color: ${({ color })=> color };
  background-color: ${({ background })=> background };
  font-size : ${Constants.FONT_SIZE_H1};
  margin-left : 1.5rem;
  &::before {
    content: "<div>";
    font-family: "La Belle Aurore", cursive;
    color: green;
    font-size: 18px;
    position:absolute;

  }
  &::after {
    content: "</div>";
    font-family: "La Belle Aurore", cursive;
    color: green;
    font-size: 18px;
    position:absolute;
  }
`;

``` 

This is how you can use styled-components with typescript.
What are the changes in Forem code for displaying postviews on DEV?
Tags: meta, discuss
Published: 2021-02-22 08:13:06

I was wondering about the changes been made into the Forem codebase to display total postviews on the DEV dashboard page. I saw some changes in the behavior of update of postviews and tried to find out about and saw that a [PR](https://github.com/forem/forem/pull/12686) was merged to update the pageviews. I was just able to understand that some changes were made into the codebase but not able to understand what actually has happened there. 

I would like to know in simpler terms what are the changes been made and how will they affect the performance of the site?  Also, what is the new frequency of update of post/pageviews?

Is this change updated in all communities powered by Forem or just for DEV? 

Also for a beginner how can we think about making such changes(related to caching) in a project and how to assess that our project needs some changes?
Elixir Phoenix and VS Code Remote Containers for easy development
Tags: elixir, phoenix, vscode, productivity
Published: 2021-02-22 08:10:28

{% youtube TfY_fxS9syo %}

Demonstration on how you can easily get an Elixir Phoenix project up and running with minimal configuration using Visual Studio Code, Docker, and Remote Containers.

Elixir Phoenix Boilerplate - https://fullstackphoenix.com/boilerplates/new

Docker Desktop - https://www.docker.com/products/docker-desktop

Remote - Containers - https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers&WT.mc_id=AZ-MVP-5003399
Create your own apis from Google sheet
Tags: tutorial, api
Published: 2021-02-22 08:06:48

Hello !, friends

first we need a google sheet for making api fill with dummy data or take actual data , this google sheet will help to make create a api.  

after that we have to create on account for creating api link go to [sheet best](https://sheet.best/) after creating account we need a connection url of the google sheet for that we have to make google sheet public .
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nocp0d9gh3yt0hdocqgc.gif)

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9otk4n3wizs7nyo6c6on.gif)

After making it public go to  [sheet best](https://sheet.best/) and put google sheet link to the connection Url
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xskq853x0ifmh52d7j20.gif)

after all 
Click on the DETAILS button for the your new Connection.

Now Your custom api ready for use !.
6 دلیل برای یادگیری پایتون در سال 2020
Tags: python, programming, faceit
Published: 2021-02-22 07:55:08

چرا در سال 2020 باید پایتون را بیاموزیم
1- پایتون همه کاره است
همانطور که در بخش توضیح درباره پایتون اشاره کردیم، پایتون در زمینه‌های مختلفی کاربرد دارد که از جمله آن‌ها می‌توانیم به دیتا ماینینگ، علم داده، هوش مصنوعی، یادگیری ماشین، طراحی و توسعه‌ی وب، فریم ورک‌های وب، سیستم‌های تعبیه شده، اپلیکیشن‌های طراحی گرافیکی، بازی، توسعه‌ی شبکه، توسعه‌ی محصول، توسعه‌ی سریع نرم افزار، تست، اتوماسیون و... اشاره کنیم.

درواقع پایتون به عنوان یک جایگزین ساده و بهینه برای زبان‌های برنامه نویسی مانند جاوا، C و R به حساب می‌آید و حالا در بین برنامه‌ نویسان در حال رشد و افزایش محبوبیت است.

در این بین بد نیست اشاره کنیم که شرکت‌های بزرگ تکنولوژی مانند گوگل، نتفلیکس، فیس بوک، اینستاگرام، آمازون، اینتل، ناسا، اسپاتی‌فای و... هم از زبان برنامه نویسی پایتون استفاده می‌کنند.


2- پایتون به سرعت در حال رشد است
پایتون حالا در زمینه‌های مختلف و در شرکت‌های مختلف در حال استفاده است از این رو اصلاً عجیب نیست که این زبان به سرعت در حال پیشرفت باشد. از سوی دیگر با وجود ابزارهایی مانند Codecademy و Udemy و سایر ابزارهای آموزش آنلاین برنامه نویسی، یاد گرفتن پایتون به صورت آنلاین بسیار ساده شده است. بنا به گزارش Codecademy در سال 2018 با رشد 34 درصدی در افرادی که آموزش آنلاین پایتون را دریافت کرده بودند، مواجه بوده‌ایم. از سوی دیگر وب سایت Stack Overflow هم با توجه به میزان سوالات و بازدیدها، پایتون را به عنوان یکی از زبان‌های برنامه نویسی با سریع‌ترین رشد اعلام کرده است.

3- تقاضای زیاد شغلی
با توجه به رشد روز افزون زبان پایتون، جایگاه‌های شغلی برای این زبان برنامه نویسی هم رو به رشد است. به عبارتی گزارشاتی نشان می‌دهد که پایتون جز 10 زبان پرتقاضا در بین زبان‌های برنامه نویسی در سال 2019 بوده است. البته این آمار مربوط به آمریکاست اما پرطرفدار بودن و پرتقاضا بودن این زبان در سراسر جهان، کاملاً واضح است.

ادامه را در فیسیت بخوانید
https://faceit.ir/educational/6-reason-to-learn-python/
Clean Sentry On-Premise Database
Tags: devops, devjournal, docker, postgres
Published: 2021-02-22 07:50:41

So we track our error logs via Sentry on-premises which we hosted on our own. Recently it started to give error, the disk space is running out!!!

### WHY??
Apparently we needed to clear the database after certain time. Otherwise it will stack up all of the error logs. 

### Solution??
We log into our server. Sentry was running in docker. We went to the docker folder ran this 
`docker-compose exec worker bash `
After that from the worker bash we ran
`sentry cleanup --days 30`
basically this will clean up all the events data before 30 days.

After this we go inside of the database by running these 
- `docker-compose exec postgres bash`
- `psql -U postgres`
- `VACUUM FULL;`
Point to be noted, `VACUUM FULL;` will lock your db tables unless the full vacuum is being done.  

Voila! Database and hard driver storage cleaned up! :)
Validate your complex JSON API responses within seconds
Tags: testing, api, json, vrestng
Published: 2021-02-22 07:49:19

Watch our video #tutorial on how you may validate your complex JSON responses within few seconds using the #vREST NG Application.

In our future sessions, we will see more advanced approaches to validate your complex API responses like a piece of cake. So stay tuned to our video series.

Youtube Link: https://youtu.be/nAJ4dP8DSYQ

Youtube Playlist: https://youtube.com/playlist?list=PLmua155_WrDzt1AbB6iV5Lsw_Z7QrzZZ0

vREST NG is an enterprise-ready application for Automated API Testing. You can download and install the vREST NG application directly on Windows, OSX, and Linux via our website.

*Important Links:*
1. [vREST NG Website](https://ng.vrest.io/?utm_source=devto&utm_medium=devto-desc&utm_campaign=video)
2. [Contact Email](support@vrest.io)
3. [Community Chat](https://discord.gg/NtRa7kw)
4. [Book a Live Demo](https://meetings.hubspot.com/dheeraj-aggarwal)

Please do like and share if you found this video helpful and let the voice heard by the testing community. Also, let us know your feedback by commenting on this post.
NexGen Data Entry | Global BPO Company

Published: 2021-02-22 07:17:25

NexGen Data Entry is one of the highly recognized organization when it comes to outsourcing back-office or essential business documentation for the past years in USA & Europe. With our expert team and sophisticated technology, we guarantee to render quality-rich and accurate data entry, data analytics, data processing, data conversion, web search, scanning & indexing, software development, and mortgage & foreclosure services.

Email: support@nexgendataentry.com

Website: https://www.nexgendataentry.com/
Tor - The Onion Router 
Tags: privacy, anonymity, encryption, surveillance
Published: 2021-02-22 07:16:52

##What is Tor?
[Tor](https://www.torproject.org/) is a network of virtual tunnels that allows you to improve your privacy and security on the Internet.

>_Privarcy is a human right. We at Tor advance human rights and defend your privacy online through free software and open networks_

Tor works by sending your traffic through three random servers (also known as relays) in the Tor network. The last relay in the circuit **(the exit relay)** then sends the traffic out onto the public Internet.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fo0393t92yra0ad97vv9.png)

The image above illustrates a user browsing to different websites over Tor. The green middle computers represent relays in the Tor network, while the three keys represent the layers of encryption between the user and each relay.

It protects you by bouncing your communications around a distributed network of relays run by volunteers all around the world, it prevents somebody watching your Internet connection from learning what sites you visit and it prevents the sites you visit from learning your physical location.

This collection of volunteer relays is called the Tor network.

The way most people use Tor is with the Tor Browser, which is based on Firefox ESR and comes bundled with privacy enhancing & anti-fingerprinting features.

##So is Tor a VPN?
Nope. [Tor is NOT a VPN](https://matt.traudt.xyz/posts/you-want-tor-24tFBCJV/) and furthermore it is not recommended to use Tor and VPN together. 
These are fundamentally very different. In the case of VPN, you're just transferring your trust from your internet service provider (ISP) to the VPN provider.
The VPN provider can log any data while you use their network and anyone snooping on the VPN connection can also _easily gain knowledge of your activities._
**_While using Tor_**, your connection is made to the website by bouncing the connection through three different relays so the website you're connecting to can only see the IP address of the 'exit' relay

##Some more about Tor
The Tor Browser furthermore comes bundled with features like: a different circuit of every different domain, i.e. a new circuit for every website you're connecting to so as to mitigate cross-site tracking; 'Security Settings' with which you can also disable most of the harmful JavaScript.

_The noteworthy part is that the idea is **not to hide** that you're using the Tor network but to **anonymize your activities on the Tor network.**_

_Tor is an essential tool for privacy and anonymity on the internet. It is a tool used by millions of people all around the globe - from journalists to human rights activists to ordinary people_

##Challenges
Direct access to the Tor network may sometimes be blocked by your Internet Service Provider or by a government. Tor Browser includes some circumvention tools for getting around these blocks. These tools are called **pluggable transports**. 

I'll talk more about this in incoming blogs so stay tuned!