teleren/devto huggingface dataset:
9 Key Rules for Using Git
Tags: git, github, development
Published: 2023-07-21 11:23:36


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


Here are some important rules to follow when using Git:

1. **Work on a feature branch:** This is important because it means you do all your work in a separate branch, not the main one. It lets you submit more than one pull request without any mix-ups. Plus, you can make changes without risking any instability in the master branch with unfinished code. 

2. **Always branch out from develop:** By doing this, you make sure that the code in the master branch can be used for releases almost always without any problems. (This might not be necessary for some projects.)


3. **Don't push directly into develop or master branch. Instead, make a Pull Request:** This lets your team know that you've finished a feature. It also makes it easy for your peers to review your code and provides a space to discuss the feature you're proposing.


4. **Update your local develop branch and do an interactive rebase before pushing your feature and making a Pull Request:** This merges in the requested branch (master or develop) and puts the commits you've made locally at the top of the history. This means the history will be neat and tidy.


5. **Solve any conflicts while rebasing and before making a Pull Request.** When you rebase your branch before a Pull Request, you're integrating changes from one branch into another. During this process, conflicts may arise if Git can't decide how to merge the changes. It's crucial to resolve these conflicts during the rebase, before creating your Pull Request. This way, you ensure a clean, conflict-free branch that can be smoothly merged into the main codebase. Resolving conflicts early avoids potential issues down the line and facilitates a faster, more efficient review process for your Pull Request.

6. **Delete your local and remote feature branches after they've been merged:** This stops your list of branches from getting cluttered with branches you're not using anymore. It also makes sure you only merge the branch back into master or develop once.


7. **Before making a Pull Request, check your feature branch to make sure it's working properly and passes all tests (including style checks):** This is because you're about to add your code to a stable branch. If your tests fail, there's a high chance the destination branch will fail too. Also, doing a style check before making a Pull Request helps keep everything readable and makes sure any formatting fixes are separate from the actual changes.


8. **Use .gitignore file:** This file already has a list of system files that you shouldn't include in your remote repository. It also excludes certain folders and files for most editors, as well as most common dependency folders.


9. **Protect your develop and master branch:** This keeps your ready-to-go branches safe from unexpected changes. 


That's it! By following these rules, you can make sure your Git workflow is smooth and efficient.
Virtualization in Blazor DataGrid Component
Tags: webdev, dotnet, csharp
Published: 2023-07-21 10:47:02

Learn how to implement virtualization in the Syncfusion Blazor DataGrid component. This video demonstrates how to use row virtualization and column virtualization. 

The DataGrid control is a high-performance grid component that helps display and manipulate large amounts of data in a tabular format. Its rich feature set includes functionalities like data binding, sorting, grouping, editing, filtering, swiping, dragging, resizing, loading more items, pull-to-refresh It is utilized to display and manipulate data in a tabular view. 

You can customize the style of its individual cells and rows. Its wide range of functionalities includes an adaptive UI layout for all devices, selection, and support for Excel, CSV, and PDF formats. It allows you to use a custom layout to display custom element values or content for each column by using the Grid Column Components of the Template component. DataGrid can display table data in a hierarchical structure that can be expanded or collapsed by clicking the expand or collapse button. 

_Product overview_: https://www.syncfusion.com/blazor-components/blazor-datagrid

_Tutorial video_: https://www.syncfusion.com/tutorial-videos

{% youtube GrxmYYQPJPE %}
Beaver Notes
Tags: productivity, javascript, programming
Published: 2023-07-21 10:45:21

# Embrace Productivity with Unrivaled Privacy and Customization 🚀


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

### Description
Welcome to Beaver Notes—an open-source sanctuary for productivity enthusiasts seeking a clutter-free, intuitive, and private note-taking experience. Our mission is to empower users with a note-taking app that respects their privacy and embraces individuality. Store your notes securely on your device with no third-party servers involved, giving you full control over your data. With markdown support, customizable themes, layouts, and settings, Beaver Notes ensures you can tailor your note-taking environment to your unique style and workflow. Command prompt functionality and note organization features further enhance productivity and streamline your creative process. Whether you're an idea enthusiast, a developer, or a student, Beaver Notes is the canvas where your thoughts take shape and flourish.

[Beaver Notes GitHub Repository](https://github.com/Daniele-rolli/Beaver-Notes)

Beaver Notes is licensed under the [MIT License](https://github.com/Daniele-rolli/Beaver-Notes/blob/main/LICENSE).

### Building a Private Haven for Productive Note-Takers 

In a world where privacy is becoming increasingly scarce, Beaver Notes was born out of the need for a note-taking app that prioritizes user confidentiality. The vision was clear—to create a sanctuary where individuals could take notes with peace of mind, knowing their data remains secure and never leaves their Mac or PC. Inspired by the power of open-source development, I embarked on a journey to craft a note-taking app that not only meets the highest standards of privacy but also empowers users with customization options to suit their unique personalities and workflows. Beaver Notes is the product of this vision—a thriving community-driven app built with passion and commitment to privacy and productivity.

### Unleashing the Power of Electron and Open-Source Collaboration 🚀

Building Beaver Notes was a transformative experience that involved harnessing the power of Electron—a framework that enabled the creation of a versatile and cross-platform app for both Mac and Windows users. The app's user interface was meticulously crafted using a blend of HTML, CSS, and JavaScript, all working harmoniously to provide an intuitive and engaging experience. Embracing the principles of open-source collaboration, I invited the community to contribute their ideas, feedback, and expertise, elevating Beaver Notes to new heights. The journey has been a continuous learning process, from mastering Electron development to refining UI/UX design and fostering a vibrant and supportive community.

### Delve into the World of Beaver Notes 🌐

- [Visit Beaver Notes Website](https://www.beavernotes.com)
- [Explore Beaver Notes GitHub Repository](https://github.com/Daniele-rolli/Beaver-Notes)
- [Discover Documentation and Contribution Guidelines
](https://github.com/Daniele-rolli/Beaver-Notes/wiki)
Mail for own domains
Published: 2023-07-21 10:42:21

I often need to setup mail for multiple domains which do not send mail very rarely and have to receive very few emails. 

I used to setup Postfix+Dovecot+Webmail myself, but it's painful. 
Some VPS providers will even block sending emails, so I'd need to use 3rd party relay (Mailgun). While this works (https://beesbuzz.biz/blog/9902-Setting-up-Postfix-Mailgun-for-multiple-outgoing-domains), it's still a lot of trouble.

And then I've found migadu.com. 

For now looking very promising.
Comment fonctionne la propriété box-sizing dans CSS
Tags: css, webdev
Published: 2023-07-21 10:31:26

La propriété CSS `box-sizing` définit la façon dont la hauteur et la largeur totale d'un élément est calculée (avec le modèle de boîte CSS).

En CSS, la largeur et la hauteur affectées à un élément s'appliquent par défaut à la boîte de contenu (content box) de l'élément. Si l'élément possède une bordure (border) ou du remplissage (padding), celui-ci est ajouté à la largeur et/ou à la hauteur de la boîte affichée à l'écran. Cela signifie qu'il faut ajuster les valeurs de hauteur et de largeur afin qu'elles permettent d'ajouter n'importe quelle bordure ou n'importe quel remplissage qui serait ajouté par la suite.

La propriété `box-sizing` peut être utilisée afin d'ajuster ce comportement :

`content-box` est la valeur par défaut et correspond au comportement par défaut décrit ci-avant. Si on définit un élément avec une largeur de 100 pixels, la boîte de contenu de cet élément mesurera 100 pixels de large et la largeur de la bordure et/ou du remplissage sera alors ajoutée pour constituer la largeur finalement affichée

`border-box` indique au navigateur de prendre en compte la bordure et le remplissage dans la valeur définie pour la largeur et la hauteur. Autrement dit, si on définit un élément avec une largeur de 100 pixels, ces 100 pixels inclueront la bordure et le remplissage éventuellement ajoutés et c'est le contenu de la boîte qui sera compressé pour absorber cette largeur supplémentaire. Cela permet généralement de simplifier le dimensionnement des éléments

**Note :** Il est souvent utile de définir `box-sizing` à `border-box` aux éléments de mise en page. Cela facilite grandement la gestion de la taille des éléments et élimine généralement un certain nombre d'écueils que vous pouvez rencontrer lors de la mise en page de votre contenu. D'autre part, lors de l'utilisation de la `position: relative` ou `position: absolute`, l'utilisation de `box-sizing: content-box` permet aux valeurs de positionnement d'être relatives au contenu, et indépendantes des changements de taille des bordures et de la taille de la marge interne, ce qui est parfois souhaitable.
Create our first 3D scene using Three.js
Tags: threejs, webgl, learning
Published: 2023-07-21 10:31:19

As Lao Tzu said, 
> “The journey of a thousand miles begins with one step”. 

Created my first 3D scene using threejs. I also added the ability to rotate and zoom the 3D object. I mostly followed the [official threejs doc](https://threejs.org/docs/index.html#manual/en/introduction/Creating-a-scene).

Demo:
(Drag to rotate and Scroll to zoom)
{% embed https://codesandbox.io/embed/scene-with-orbit-control-6f3sz6?fontsize=14&hidenavigation=1&theme=dark %}

## Things I Learned
### Scene, Camera and Renderer
Threejs requires three things to display content: **scene**, **camera** and **renderer**. 

**Scene** - Allows you to set up what and where to be rendered.
**Camera** - A viewport through which we observe the 3D scene. There are many types of camera in Three.js like PerspectiveCamera, OrthographicCamera, CubeCamera, etc. Perspective Camera is the most widely used which shows the objects in more realistic perspective view.
**Renderer** - Renderer is responsible for showing the 3D objects on a web browser. Mostly used WebGLRenderer.

### BoxGeometry, MeshBasicMaterial and Mesh
**BoxGeometry** - Geometry defines the shape and structure of 3D objects in a scene. There are several types of predefined geometries in threejs such as, BoxGeometry, SphereGeometry, CircleGeometry, ConeGeometry, CylinderGeometry, etc. BoxGeometry is used to create a cube.

**MeshBasicMaterial** - A material for drawing geometries in a simple shaded(flat or wireframe) way. This material is not affected by lights.

**Mesh** - An object that takes a geometry and applies a material to it.

### Threejs Addons: OrbitControls
**OrbitControls Addon** allows the camera to move around a target. This addon enable us to rotate and zoom our object by dragging and scrolling.

That's a good start for now. Feel free to play around in codesandbox. Stay tuned.
How to find and remove Unused Dependencies in Your project with Depcheck
Tags: javascript, typescript, webdev, tutorial
Published: 2023-07-21 10:25:22

Depcheck is a tool for analyzing the dependencies in a project.

It can help you see how each dependency is used, which dependencies are useless, and which dependencies are missing from your `package.json` file.

To use it, you can install it globally with `npm install -g depcheck` or simply use `npx depcheck` if you have npx installed.

**Depcheck**: https://www.npmjs.com/package/depcheck
List the data counted in mysql COUNT() GROUB BY GROUP_CONCAT()
Tags: mysql, query, database
Published: 2023-07-21 10:22:25

We all know the regular group by and count

```
SELECT errors, COUNT(id) AS count AS ids 
FROM table GROUP BY errors;
```

What if you want to see the ids that made up the count you have?
**GROUP_CONCAT()** will do that for you!

```
SELECT errors, COUNT(id) AS count, GROUP_CONCAT(id) AS ids 
FROM table GROUP BY errors;
```
| errors | count | ids     | 
|--------|-------|---------|
| error1 | 4     | 2,3,4,5 |
| error2 | 2     | 1,6     |
| error3 | 1     | 8       |
Selenium Training in Chennai
Published: 2023-07-21 09:55:27

Discover the power of automation with our [Selenium Training In Chennai](http://infycletechnologies.com/selenium-training-in-chennai/)! Are you ready to embark on mastering one of the most sought-after skills in the software testing industry? Look no further! Infycle Technologies brings you a comprehensive and hands-on Selenium course designed to equip students with the essential knowledge and skills to excel in test automation. To know more, call us at +91-750263363 or +91-7504633633.
Allow your website to be embedded within iFrame (update your CSP header)
Tags: iframe, http, csp
Published: 2023-07-21 09:50:10

I needed my website to be embedded on one other domain, it should be pretty straightforward, _right_?

```
<iframe src="https://yoursite.com"></iframe>
```

Almost. 

Wait, what is this?

![Refused to display 'http://localhost:3000/' in a frame because it set 'X-Frame-Options' to 'sameorigin](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7jfz815w7cxsoxqv8csq.png)


> Refused to display 'http://localhost:3000/' in a frame because it set 'X-Frame-Options' to 'sameorigin'.

Okay, so I need to update [X-Frame-Options](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options) then? 

Not really.

X-Frame-Options has only two possible directives: DENY or SAMEORIGIN, none of which allow you to do what you want.

What you need is [Content-Security-Policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy) HTTP header, it has a frame-ancestors directive which is what you need.

To make it work, set you headers to desired domain

In node.js:
```
res.setHeader('Content-Security-Policy', 'frame-ancestors https://www.google.com/;');
```

In ruby on rails:
```
response.headers["Content-Security-Policy"] = "frame-ancestors https://www.google.com/;"
```

With CSP header, you're good to go!
Don t use arrow functions... (if you don t need to)
Tags: javascript, programming, tutorial, coding
Published: 2023-07-21 09:37:43

**We can love them or hate them, but [arrow functions](https://www.w3schools.com/Js/js_arrow_function.asp) often allow to write more compact code. Sometimes there are good reasons to use them, if you need to deal with "this" in your code. But often, they tend to be harder to read.**

**So, when or when not should you use arrow functions?**

We can write Javascript functions multiple ways:
```JS
hello = function() { // conventional function
  return "Hello World!"
}
const hello = () => { // "arrow"-function
  return "Hello World!"
}
// arrow-function with implicit return
const hello = () => "Hello World!" 
```
Especially the last version has some nice options to shorten expressions, if you combine arrow functions with the [ternary operator](https://stackoverflow.com/questions/6259982/how-do-you-use-the-conditional-operator-in-javascript):
```JS
// conventional function
function getcolor(flag) 
{
    if (flag)
        return = "green"
    else
        return = "red"
}

// Arrow-function
const getcolor = (flag) => flag ? "green" : "red"
```
even the brackets () around (flag) are not necessary, but it is a good convention to place them to mark the (argument) of the arrow function. Here we possibly get the best from using Arrow functions. Code is shorter and pretty clear. ***But: be carful not to exaggerate this!***

```JS
const decode = c => 
   (Array.isArray(c)) ? c.map(el => (el>0 ? el : -el)) : (c > 0 ? c : -c)
```
This is working code, but what does it do? Hard to say... I often spent hours just to figure out, what a single line of code does. *This is pure waste of time!*

### Keep it clear and simple

I want to encourage you to write readable code! Computer just do what the code tells them to do, but programmers are responsible to maintain the code. Writing readable code will save you time and make your live easier.

##### Are arrow functions really more compact?

For short functions, that simply return a value, the arrow syntax provides an option, to write more compact code. But the next example shows, that arrows => are not always shorter: 

```JS
  function f(a,b) { ... }
  const f = (a,b) => { ... }  
```
The function operator shows immediately: **Here we define a function.** This is not alwas and immediately clear with the arrow operator, specially if you use deeply nested functions inside. 

Even if it saves some bytes, for the sake of readability, you should prefer the good old "function()" where possible!


---

*Remember: One day of debugging can save you 5 seconds of writing more readable code...*
What was your win this week?
Tags: discuss, weeklyretro
Published: 2023-07-21 09:30:00

---
title: What was your win this week?
published: true
description: Looking back on this past week, what was something you were proud of accomplishing?
tags: discuss, weeklyretro
published_at: 2023-07-21 09:30
---

Heyo 😀

Hope everybody is having a great weekend!

Looking back on this past week, what was something you were proud of accomplishing?

All wins count — big or small 🎉

Examples of 'wins' include:

- Starting a new project
- Fixing a tricky bug
- Hanging with a friend 🙌

---

![Patrick and Spongebob saying "woo-hoo" and celebrating together](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u6ln29jxvj8yqpqbtoga.gif)
Unreal Engine Games in 2023
Published: 2023-07-21 09:28:49


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/546zmz1cno4s0evc0r40.jpg)Unreal Engine is a versatile and flexible game development engine that can be used to build various types of games from different genres. Let me explain Some of the common types of games developed using Unreal Engine include

**First-Person Shooters (FPS)
**Unreal Engine's powerful rendering capabilities and physics system make it a popular choice for developing FPS games. Many epic FPS games have been built using Unreal Engine.

**Action/Adventure Games
**Its character-driven story, exploration, and combat mechanics, such as Star Trek: Resurgence, System Shock, and Red Fall have been developed with Unreal Engine.

**Role-Playing Games (RPGs)
**Unreal Engine provides the gaming tools to build vast open worlds, dynamic environments, and complex gaming systems for RPGs.

**Survival and Battle Royale Games
**The massive success of Fortnite, a battle royale game developed with Unreal Engine, has shown the engine's capacity for creating large-scale multiplayer survival games with huge player bases.

**Virtual Reality (VR) Games
**VR games are the most popular and have created a huge impact on the gaming industry in recent times. Unreal Engine offers robust support for VR development, making it a perfect choice for creating immersive VR experiences.

**Horror Games
**The engine's ability to create realistic environments, lighting effects, and immersive soundscapes, creepy music has made it a go-to choice for horror game developers.

**Educational Games
**Unreal engines have been utilized to develop educational games that offer interactive learning experiences and training simulations. These games are designed for kids and students to create more learnsssssssssssszing knowledge.

**Mobile Games
**Unreal Engine also supports mobile game development, allowing developers to create unique, high-quality, and visually appealing games for iOS and Android platforms.

We have seen through the common types of games developed using Unreal Engine. These are only specific game genres of the Unreal engine.  Apart from these genres, you can build your game from different genres. If you’re interested in game development, then the Unreal Engine is one of the best choices. Just research and pick the right Unreal engine game development company and build your epic game with your unique flavour.
Dubai-luxury.villas
Published: 2023-07-21 09:24:39

Are you looking for a premium sea view villa or townhouse in Dubai with state-of-the-art furniture and designer renovation? Do you want to get the highest quality housing with upscale amenities and live near the beach? In this case, you have a really great choice. You can visit [https://dubai-luxury.villas/](https://dubai-luxury.villas/)  to pick up the right one. 
It is not only the official online-resource of various villas, townhouses and off-plan properties in the most prestigious communities of Dubai, but also a company with highly-qualified managers who can find the most unique property in the emirate. They will tell you which property to choose in which community, answer any questions and provide legal assistance and after-sales support. You can be sure of a successful transaction because you will be dealing only with professionals.
Turn to Dubai-luxury.villas to find the right townhouse near the warm sea.
The core of FTTR
Tags: fttr, network, transmission, webdev
Published: 2023-07-21 09:08:10

fttr, network, connection, signal, transmission, optical fiber, broadband

FTTR (Fiber to the Room) is an advanced network connection technology that transmits the Internet connection directly to each room through optical fiber, providing users with a high-speed and stable network connection.In the traditional network architecture, users need to receive network signals from the computer room downstairs through cables or wireless signal receivers, and then distribute the signals to each room through indoor wiring.FTTR technology transmits network signals directly to each room through optical fiber, providing a more stable and high-speed network experience.

The core of FTTR technology is to install an optical fiber terminal interface (ONT) in each room to connect the optical fiber directly to the user equipment.ONT is a conversion device that converts optical signals transmitted by optical fibers into electrical signals for use by user equipment.Through the high-bandwidth transmission of optical fiber, users can enjoy high-bandwidth services such as high-definition video, online games, and fast downloads at the same time.

**Ebyte Electronic Technology Co., Ltd. specializes in the development and production of wireless data transmission modules with various functions in various frequency bands. The products have been widely used in the Internet of Things, consumer electronics, industrial control, medical care, security alarm, field collection, smart home, highway, property management, water and electricity meter reading, power monitoring, environmental monitoring and other application scenarios. If you have any needs, please contact email:

> service-es-@cdebyte.com
 Or visit the website:[https://www.es-ebyte.com/](https://www.es-ebyte.com/)**