teleren/devto huggingface dataset:
Git 🧞‍♂️ cheatsheet
Tags: wip, git, github, programming
Published: 2022-12-16 15:54:49

this is a work in progress, I'll keep this list updated... hopefully 😜

---

## Squash
(make the 2+ last commits merge in 1)
the last commits changes will move in the previous one

`git rebase -i HEAD~4` you will see only last 4 commits
`todo: example 1`
change in `f` any commits you may want to squash like this:
`todo: example 2`

## Move your local one step back 
( **see** changes made on last commit as not staged, this is amazing for review changes made on the last commit)
`git reset HEAD~1`
If you want to make apply this status use 
`git reset —hard`

## Edit last commit message
will open vi and allow you to edit the message
`git commit --amend`

## Reset to a specific commit
1. see in details list of changes
`git reflow`
2. move your local to a specific hash
`git reset [hash]`

## Somebody else code has been merged an now you have conflict with the code bases
( Apply changes made by somebody else and then add your changes, you may need to solve conflict )
`git rebase dev`

## Force checkout to a specific branch
`git reset --hard origin/feat/branch-to-force`

## Delete branch
`git branch -D feat/branch-to-delete`

## Rename branch
`git branch -m feat/new-name-branch`
---

## VI essentials commands
Vi start in command mode, 
- for edit mode press **I** key (exit edit mode with **ESC** key)
- for save and exit  **ESC** then `:wq`
- for exit without save  **ESC** then `:q`
Orbiting planets in solar systems Python | nano
Tags: python, tutorial, programming, webdev
Published: 2022-12-16 15:48:18

Simulation of Orbiting Planets in Solar Systems using Python (2D using turtle)
Python , an interpreted high-level general-purpose programming language that was created in 1991 by Guido Van Rossum.

Python is dynamically-typed language .. it supports multiple programming paradigms, including structured (particularly, procedural), object-oriented and functional programming.

In this quick tutorial, you will learn how create a single solar system simulation, as well as multiple solar system simulation.

This is the video if you want to watch:
{%youtube 44aSX8pbqxc%}
Is Microsoft's .net dying?
Tags: beginners, programming, tutorial, discuss
Published: 2022-12-16 15:48:00

.NET is a software framework developed by Microsoft that is used for building a wide range of applications, including web, mobile, desktop, and IoT (Internet of Things) applications. .NET has been around for over two decades and has a large and active community of developers and users.

It is important to note that the popularity and usage of different technologies can vary over time. While some technologies may decline in popularity, it does not necessarily mean that they are "dying".

As of 2021, .NET is still a widely used and popular technology for building a variety of applications. It has a strong ecosystem of tools and libraries, and it is constantly being updated and improved by Microsoft and the community.

Additionally, .NET has broad support across a range of platforms and operating systems, including Windows, Linux, and macOS, which makes it a flexible and versatile option for developing applications.

Overall, it is difficult to predict the future of any technology, but .NET remains a viable and popular choice for building a wide range of applications.

**On the other hand are there are any alternatives to .net?**

There are a number of alternatives to .NET that can be used for building a variety of applications, including web, mobile, desktop, and IoT (Internet of Things) applications. Some of the most popular alternatives include:

Java: Java is a widely used programming language that is known for its portability and scalability. It is a popular choice for building enterprise-level applications.

Python: Python is a high-level programming language that is known for its simplicity and readability. It is often used for web development, scientific computing, and artificial intelligence applications.

JavaScript: JavaScript is a popular programming language that is used for building web and mobile applications. It is often used in combination with other technologies, such as React and Angular, to build user interfaces and front-end functionality.

Go: Go is a programming language developed by Google that is known for its simplicity, concurrency support, and performance. It is often used for building web servers and other networked systems.

Ruby: Ruby is a high-level programming language that is known for its simplicity and flexibility. It is often used for building web applications and has a large and active community of developers.

Ultimately, the best alternative to .NET will depend on the specific requirements and goals of your project. It is important to carefully consider the trade-offs and benefits of different technologies before making a decisio
Amazing Rating Card Using HTML CSS JavaScript | Fronend mentor
Tags: css, javascript, beginners, tutorial
Published: 2022-12-16 15:45:55

{% youtube mNJJK6zYB5I %}

How to Make a Rating Card Using HTML CSS JavaScript

This video will show you how to build a rating card using html css javascript

[Source code](https://www.patreon.com/posts/source-code-card-75999504?utm_medium=clipboard_copy&utm_source=copyLink&utm_campaign=postshare_creator&utm_content=join_link)


⏱️ Timestamps
-----------------------------
0:00 - Demo
1:05 - File structure
1:42 - Project initial
7:30 - Rating card
24:01 - Media queries
ReactJs vs NextJs : All you need to know!
Tags: react, webdev, javascript, beginners
Published: 2022-12-16 15:44:28

ReactJS and NextJS are both JavaScript libraries that are used for building web applications. However, they have different purposes and are typically used in different stages of the development process.

ReactJS is a JavaScript library for building user interfaces. It is focused on the view layer of an application and can be used with a variety of different technologies on the back-end. React allows developers to create reusable UI components and efficiently update the user interface as data changes.

On the other hand, NextJS is a framework built on top of React that makes it easier to build server-rendered React applications. It provides a set of tools and features for optimizing the performance of React applications and simplifying the development process.

NextJS is particularly useful for building server-rendered React applications because it handles server-side rendering, automatic code splitting, and optimization of performance. It also has built-in support for optimizing the performance of React applications by minimizing the number of server requests and minimizing the size of the JavaScript bundle that is sent to the client.

**TL;DR** : _In summary, ReactJS is a library for building user interfaces, while NextJS is a framework built on top of React that makes it easier to build server-rendered React applications and optimize their performance. Both can be used together to build powerful and efficient web applications._
What was your win this week?
Tags: discuss, weeklyretro
Published: 2022-12-16 15:36:52

Hey everybody! 👋

Hope y'all all enjoy your weekends!

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
- Baking some tasty treats 🍪

---

![a bunch of flamingos walking around together, the word "weekend?" appears again and again above different flamingos heads](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2xh4cb8y2ch7kz5pabqi.gif)
Usando Action Text em Rails 7
Tags: rails, actiontext
Published: 2022-12-16 15:33:03

Hoje, nós vamos aprender a integrar um editor WYSIWYG com rapidez e facilidade na nossa aplicação Rails.

**Observação**: Será necessário instalar alguns software de terceiro para processamento de imagem.

- [libvips] (https://github.com/libvips/libvips) v8.6+ e/ou [ImageMagick] (https://imagemagick.org/index.php) para analise e transformação de imagem.

## O que é Action Text?

Action Text nos dá a capacidade de criar conteúdo de rich text. Ele usa o editor [Trix] (https://trix-editor.org/) para lidar com tudo, desde a formatação a links, citações, listas, imagens incorporadas. O conteúdo rich text gerado pelo editor Trix é salvo em seu próprio model `RichText` associado a qualquer model Active Record existente no aplicativo. E também, quaisquer anexos incorporadas são armazenadas automaticamente usando o Active Storage e associadas ao model `RichText`.

Bem, chega de papo e vamos construir nossa aplicação.

## Criando uma aplicação

A aplicação que vou criar é um simples blog.

```bash
rails new blog
cd blog
```

Agora, vamos instalar o Action Text

## Instalando o Action Text

Para instalar, é bem simples, basta executar o comando abaixo.

```bash
rails action_text:install
```

Pronto, com isso, o Action Text está instalado.

Vamos criar o model e controller.

Eu vou usar o scaffold, para nos livrar do trabalho.

```bash
rails g scaffold Publicacao titulo conteudo:rich_text
railos db:migrate
```

Perceba que eu criei o `conteudo` do tipo `rich_text`, com isso, o action text está associado com o model `Publicacao`.

Beleza, mas se eu tiver um model criado, o que eu faço?

É bem simples, basta colocar o código `has_rich_text :nome_do_atributo` no seu model.

Por exemplo, vamos abrir o arquivo `app/models/publicacao.rb`

```ruby
class Publicacao < ApplicationRecord
  has_rich_text :conteudo
end
```

Perceba que o generator colocou para gente, não tem muito segredo em fazer isso.

Antes de rodar o servidor, vamos observar o arquivo view, para saber como que colocar o editor no form.

Abra o arquivo `app/views/publicacaos/_form.html.erb` e foque em uma parte do código.

```erb
...
  <div>
    <%= form.label :conteudo, style: "display: block" %>
    <%= form.rich_text_area :conteudo %>
  </div>
...
```

Então, para usar o editor Trix, basta colocar o `rich_text_area :nome_do_atributo`.

Então, vamos ver essa coisa funcionando, rode o servidor e vá para `localhost:3000/publicacaos/new`.

E verá um editor WYSIWYG, então divirta-se brincando com ele, coloque imagem, use a formatação, etc.

Bem, nós acabamos por aqui.

Então é isso, tchau!
CodeNewbie Podcast S22E6: Technical Writing with Philip Kiely
Tags: codenewbie, podcast, writing
Published: 2022-12-16 15:30:06

In S22E6 of the CodeNewbie Podcast, @saronyitbarek talks about technical writing with [Philip Kiely](https://twitter.com/philip_kiely), a technical writer, programmer, and creator.

Check it out to learn about how Philip first got into technical writing while studying abroad in Budapest, what technical writing is, what technical content platforms are out there, and why new developers should publish content early in their careers.

{% embed https://community.codenewbie.org/codenewbiepodcast/s22e6-technical-writing-philip-kiely %}

Philip Kiely is s a writer, programmer, and creator. He is the author of Writing for Software Developers and Life-Changing Email. To learn more about his work, [check out his website](https://philipkiely.com).


- [Listen on Apple Podcasts](https://podcasts.apple.com/us/podcast/s22-e6-technical-writing-philip-kiely/id919219256?i=1000590335389)

- [Listen on Spotify](https://open.spotify.com/episode/5HJHx1bXZPYGvmkcj95xfn?si=5e0d824c783049e6)

Or, listen wherever you normally get your podcasts!

***

**Make sure to subscribe to the CodeNewbie podcast if you haven't yet!**

Happy coding! We hope you enjoy this season of the CodeNewbie Podcast 💜
Project & Product Management roles paying $100K+ - RevampedCP
Tags: webdev
Published: 2022-12-16 15:17:41

####   Original Tweet From  [@RevampedCP](https://twitter.com/RevampedCP)
{% embed https://twitter.com/RevampedCP/status/1603458653301907457 %}



#### Senior Project Manager
🏙 Company: [@DocuSign](https://twitter.com/DocuSign) 
💰 Salary: $105K - $154K 
🔗 Link to apply:https://careers.docusign.com/jobs/20878?lang=en-us&iis=Job+board&iisn=LinkedIn 


#### Senior Project Manager
🏙️ Company: [@Adobe](https://twitter.com/Adobe) 
💰Salary: $122K - $159K 
🔗 Link to apply: https://careers.adobe.com/us/en/job/ADOBUSR135029EXTERNALENUS/Senior-Project-Manager

AdSpace Here!!

#### Senior Project Manager
🏙️ Company: [@blackbaud](https://twitter.com/blackbaud) 
💰 Salary: $125K+ 
🔗 Link: https://careers.blackbaud.com/us/en/job/BLBBUSR0010297EXTERNALENUS/Senior-Project-Manager

#### Sr. Product Marketing Manager – Developer Audience
🏙️ Company: [@Microsoft](https://twitter.com/Microsoft) 
💰 Salary: 150K+ 
🔗 Link: https://careers.microsoft.com/us/en/job/1420173/Sr-Product-Marketing-Manager-Developer-Audience

AdSpace Here!!

#### Senior Manager, Product Marketing
🏙️ Company: @yelp
💰 Salary: $135K - $200K 
🔗 Link: https://www.yelp.careers/us/en/job/YELPUS0FC622F791B244529D0F3501211331C9EXTERNALENUS/Senior-Manager-Product-Marketing-at-Yelp-for-Restaurants

#### Senior Product Marketing Manager
🏙️ Company: [@RobinhoodApp](https://twitter.com/RobinhoodApp) 
💰 Salary: $129K+ 
🔗 Link: https://boards.greenhouse.io/robinhood/jobs/4663426


AdSpace Here!!

🏙️ Company: [@FanDuel](https://twitter.com/FanDuel) 
💰 Salary: $126K - $145K 
🔗 Link: https://boards.greenhouse.io/fanduel/jobs/4731015?gh_src=ba823b7b1us


#### Product Manager, Payments
🏙️ Company: [@ezCater](https://twitter.com/ezCater) 
💰 Salary: $107K - $142K 
🔗 Link: https://jobs.lever.co/ezcater/086cdd5a-f185-4bcf-af30-954779497830?lever-source=LinkedInJobs


AdSpace Here!!

#### Product Manager I, E-Commerce
🏙️ Company: [@Google](https://twitter.com/Google) 
💰 Salary: $110K - $166K 
🔗 Link: https://careers.google.com/jobs/results/87763153368031942-product-manager-i-e-commerce/


####  Principal Product Manager, Veteran Affairs
🏙️ Company: [@AdHocTeam](https://twitter.com/AdHocTeam) 
💰 Salary: $128K - $169K 
🔗 Link:  https://boards.greenhouse.io/adhocexternal/jobs/6534013002 


AdSpace Here!!


####  Senior Product Manager
🏙️ Company: [@Newsela](https://twitter.com/Newsela) 
💰 Salary: $140K - $175K 
🔗 Link: https://boards.greenhouse.io/newsela/jobs/4691068?gh_src=080f75f71us&source=LinkedIn



Click [Here](https://www.knowledge-twitter.com/?utm_source=dev.to)  For More Posts Like This [https://www.knowledge-twitter.com](https://www.knowledge-twitter.com/?utm_source=dev.to)
Strict object type using Proxy in JavaScript
Tags: javascript, proxy, oop, webdev
Published: 2022-12-16 15:12:08

Javascript object field can be overwrited by any data types. Can we strict it? yes of course we can strict it with the help of `Proxy`.

**Example**

We have employee object which has some related keys
```javascript
const employee = {
 name: "hidayt rahman",
 salary: 12000,
 isActive: true,
}
```
We can overwrite the value with any data types.
for example we can set salary with string value and JS will not complain any error because this is how it works.

```javascript
employee.salary = "12000" // it will overwrite number with string value
```

Sadly, This is not weird for javascript, but its buggy if we are not using Typescript, So here is the solution in JS itself using [Proxy](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy)


lets create a target object where we will be using `set` to configure the object keys according to the requirements.

We will restrict data type for `salary` and `name` field that will only accept valid data type.

- Name will only accept string
- Salary will not accept non integer data

```javascript

const target = {
    set(target, prop, value) {

        if (prop in target) {
            if (prop === 'name' && typeof value !== 'string') {
                throw new Error(`Type '${typeof value}' is not assignable to type 'string' for '${prop}' field.`);
               
            }

            if (prop === 'salary' && typeof value !== 'number') {
                throw new Error(`Type '${typeof value}' is not assignable to type 'number' for '${prop}' field.`);
               
            }

             return target[prop] = value;

        } else {
            throw new Error(`'${prop}' is not a valid prop`)
        }
    }

}

const strictedEmployee = new Proxy(employee, target);

```
Now if we use the `strictedEmployee` proxy object and set salary with non numeric data type, it will throw an error.

```javascript
strictedEmployee.salary = "2000";
```


![Uncaught Error: Type 'string' is not assignable to type 'number' for 'salary' field](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hliu6x7htc20je3untjf.png)


> _Uncaught Error: Type 'string' is not assignable to type 'number' for 'salary' field._
CHAR VA BOOL HAQIDA MA'LUMOT.
Published: 2022-12-16 14:45:37


  Char sozi  ` character`sozini qisqartmasi.
Char biror bir soni yokida belgini, harfni bittali `''` ichiga begilab qoyishimiz mumkin.Undan ortiq belgilarni saqlab qo'ya olmimiz.Faqatgina bir dona belgi saqlash mumkin.

```cpp
 int a =10;
  float b =10.5;
  double c =10.2536488;
  string d = "ikkichilar";

  // char => character (belgi);

  char belgi = 65;
  int son = 'A';
  //int son = 3;
  
 cout << belgi << " " << son;


  return 0;
}
```
Butun son bilan belgini o'rnini o'zgartishimiz ham mumkin. Misol uchun

```cpp
int a = 65;
char b = 'z';

cout<< char (a);
cout << endl << int (b);
  
  return 0;
}
```
Bool bu `boolean`sozini qisqartmasi.True-False ya'ni tori yoki notog'riligini bilishimiz mumkin.True 1 ga teng.False esa 0 ga teng.

```
// bool => boolean
  bool a = true;
  cout << (10 < 5);
 return 0;
  }
```
Sonlarni yahlitlash uchun niz yangi bir kutubxona chaqaramiz.Bu kutubxonani nomi `<cmath>`buni ichidan bizga kerakak bo'ladi `round`.

```cpp
#include <iostream>
#include <cmath>
using namespace std;
int main5 (){
 float a;
  cin>>a;
  cout << round(a);
  return 0;
}
```
ASCIIjadvalida katta harflarA~Zva kichik harflara~zketma-ket joylashtirilgan. Ushbu hususiyatdan foydalanib bitta kichik harf qabul qiling va katta harfga convert qilib chop etishni o'rganamiz.

```cpp
 char c = 97-32;


 cout << c ;

  return 0;
}
```

```cpp
#include <iostream>
#include <cmath>
using namespace std;
int main7 (){
  char a;
  cin >> a;
 

 cout << char (a - 32) ;

  return 0;
}
```

@dawroun
CHAR HAQIDA MA'LUMOT.
Published: 2022-12-16 14:43:15

 CHar 1ta belgini o'z ichiga oladi.char so'zi =>character qisqatrmasiga o'zgaradi.
  

```cpp
char belgi = 65;
  int son = 'A';
  //int son = 3;

  cout << belgi << " " << son;
   return 0;

}
```



** .CHar da biz faqatgina 1ta belgi saqlashimiz kerak undan ortiq belgilarni o'zidan saqlab qolmaydi.SHuning uchun biz faqatgina 1ta belgi ishtirok etadigon belgini yozishimiz kerak .(a),yoki 1ta hohlagan belgimizni qoysak boladi.ikkita belgi qatnashsa char uni qabul qilmaydi!!!**

          

```CPP
int son;
        cin >> son;
        char a = char(son);
        cout << son << endl;
        cout << a;
```
  
YAXLIT masalalarni ishlash uchun biz # include <cmath> kutubxonasiga murojat qilamiza!  
      

```cpp
  int main(){
float  a;
cin >> a;
  
  cout << round (a); 

return 0;
}

```
  Bool ya'ni boolean so'zining qisqartirmasi. true-false ya'ni 
 to'ri yoki noto'g'riligini bilishimiz mumkin.
     


**True 1 ga teng.**


**False o ga teng.**

char orqali son o'rnini o'zgartirish.
  

```cpp
 //bool => boolean
  bool a= true
  cout << (10 < 5 ):
return 0;
}

```

@dawroun
The Role of Developers in Society
Tags: programming
Published: 2022-12-16 14:40:00

As technology continues to advance, the vital role of developers in society cannot be overstated. From creating and building software and applications, to tackling global challenges and shaping the world, developers truly deserve a round of applause. So go ahead, developers - take a well-deserved bow.

One of the key roles of developers in society is the ability to create and develop solutions to global challenges. For example, developers can use their skills and expertise to create technologies that address issues such as climate change, inequality, and health care.

Developers have the power to design renewable energy technologies like solar panels and wind turbines, helping to combat climate change and reduce greenhouse gas emissions. And that's not all - you can also create technologies that promote social justice, such as online platforms for education, health care, and financial inclusion. These platforms can help to address issues of inequality and poverty, making the world a better place one line of code at a time. 

Another important role of developers in society is the ability to drive innovation and progress. Developers are at the forefront of technological innovation, and they are constantly pushing the boundaries of what is possible with technology.

For example, developers are creating and developing new and exciting technologies, such as artificial intelligence, blockchain, and quantum computing, that have the potential to transform and disrupt various industries and sectors. By driving innovation and progress, developers are helping to shape the future and create a better world for everyone.

Additionally, developers are also playing a crucial role in shaping and influencing public policy and government decisions. As technology continues to play an increasingly important role in society, developers are becoming more involved in policy discussions and decision-making processes.

For example, developers are participating in policy debates and discussions on issues such as data privacy, surveillance, and bias, and they are advocating for policies that support the development and use of technology in a responsible and ethical manner. By engaging in policy discussions and decision-making processes, developers are helping to ensure that technology is used in a way that benefits society as a whole.

Overall, the role of developers in society is becoming increasingly important and influential. Developers are not just creating and building software and applications, but they are also shaping the world and addressing global challenges in a variety of ways. By creating solutions to global challenges, driving innovation and progress, and shaping public policy, developers are playing a crucial role in creating a better future for everyone.
How are you preparing for the new year?
Tags: discuss
Published: 2022-12-16 14:38:48

---
title: How are you preparing for the new year? 
published: true
description: How are you setting yourself up for a fantastic start to 2023?
tags: discuss
# cover_image: https://direct_url_to_image.jpg
# Use a ratio of 100:42 for best results.
# published_at: 2022-12-16 14:31 +0000
---

Here is a somewhat sanitized version of what I shared with my team:

* Unsubscribe from noisy GitHub repos or ones you aren't interested in anymore.
* Create a 2023 brag sheet!
* Leave Slack channels that are abandoned or not useful.
* Sort email and schedule new meetings.

If you are like, but Amara... I only have the brain cycles for 1 thing, commit to making (and maintaining!) a brag sheet.

Mine includes quotes, links, screenshots, and short descriptions of things I do throughout the year. This is a great resource for performance reviews! 

Maybe you are a manager like me, so I also include sections to brag on my reports, peers, and even my managers. It never hurts to give someone else some kudos or notice their brag-worthy work.

How are you finishing out the year? Or will you do some of this new year prep in the first week of 2023?