teleren/devto huggingface dataset:
Rewriting History in Git
Tags: git, scm
Published: 2020-01-21 09:43:54

Sometimes, there may be situations where you or a colleague of yours is in a rush, perhaps something bad happened in production and a quick patch is needed, or, in the case of a few days ago, a couple of syntax errors brought a halt to a few monitoring services.

An esteemed colleague of mine found themselves in this situation recently, having made some changes to one of our Prometheus services, but unfortunately introduced a slight syntax error which brought it down. In the rush of getting a fix out, a couple of commit messages simply became `fix`, which was definitely not the standard format.

After making some changes to the repository this morning, to my horror, I noticed the commit messages, something I hold sacred.

```
* 2297d22 feat: example commit message (Adam K Dean, 10 minutes ago)
* 6feeed4 fix (Esteemed Colleague, 2 days ago)
* 87cad2f fix (Esteemed Colleague, 2 days ago)
* 5c86540 fix: remove trailing , (Esteemed Colleague, 2 days ago)
* cbe8235 chore: last release commit (Adam K Dean, 2 months ago)
```

But there is no need to worry. There are ways of fixing issues like this. If the repository is used by a lot of people, and is very busy, then this approach won't work, but for smaller, less visited repositories, such as misc system services rarely changed, we can safely rewrite history.

The first thing we want to do is backup the branch:

```
$ git checkout -b hold-this-for-me
```

Next we reset the branch back to the last acceptable commit:

```
$ git reset --hard cbe8235
```

Then, we go through the commits from oldest to newest, cherry picking them and amending their commit messages as necessary:

```
$ git cherry-pick 5c86540
$ git commit --amend -m "fix: remove trailing comma"
$ git cherry-pick 87cad2f
$ git commit --amend -m "fix: add missing bracket"
$ git cherry-pick 6feeed4
$ git commit --amend -m "fix: remove the bit that breaks everything"
$ git cherry-pick 2297d22
```

Notice that the last commit we cherry-pick was ours, so we don't need to amend it. Now we should have a tidier commit history:


```
* 8649516 feat: add nodeexporter deploy (Adam K Dean, 10 minutes ago)
* b6cac88 fix: remove the bit that breaks everything (Esteemed Colleague, 2 days ago)
* 8322e9a fix: add missing bracket (Esteemed Colleague, 2 days ago)
* 007bbe0 fix: remove trailing comma (Esteemed Colleague, 2 days ago)
* cbe8235 chore: last release commit (Adam K Dean, 2 months ago)
```

We can now proceed to push this upstream. Just bear in mind, because we've rewritten history, we're going to have to forcefully push this branch. Before doing this, you should fully understand the consequences of rewriting history, which in the case of this repository and its subsequent deployment, is fine. For further reading, see [rewriting history](https://git-scm.com/book/en/v2/Git-Tools-Rewriting-History) over at git-scm.

So, let's push this upstream, _forcefully_.

```
$ git push --force
```

Finally, if everything works as expected, clean up the backup branch.

```
$ git branch -D hold-this
```
Virtualenv(pipenv) in Docker?
Tags: help, python, docker
Published: 2020-01-21 09:37:01

#Is it necessary to use Virtualenv in Docker?
I am currently developing a fullstack project using _Django Restframework_ and _React_. 

I have already made a working __Dockerfile__ and a __docker-compose.yml__ for both _React_ and _Django_ but none of my colleagues are using __Docker__ instead they are only using _pipenv_.

I am thinking of implementing __pipenv__ inside a __Docker__ but is it necessary? and also which one is the best?

##Thank you...
DEVTO❤☎ youve made it onto my 'speeddial'
Tags: seinfeld
Published: 2020-01-21 09:30:42

DEVTO❤☎ congratulations youve made it onto my speeddial !

PS all unicode chars shamelessly cut and pasted from https://www.compart.com/en/unicode

PPS if anyone needs a link to the seinfeld episode reference please comment below
what is the politest way to 'acknowledge' someone elses SMN and BMN accounts ?
Tags: discuss, smn, bmn
Published: 2020-01-21 09:11:10

by 'acknowledge' i mean in a positive way not in a spooky way ! 

my preferred method is to like the person then like their content AND if i have time and really like then i fav a post + fork a repo + retweet a tweet as appropriate !

BTW i try to never link to anyone i have never met in the real world on linkedin
The Best Way to build reactive sub-forms with Angular
Tags: angular, forms, frontend
Published: 2020-01-21 10:01:07

---
title: The Best Way to build reactive sub-forms with Angular
published: true
date: 2020-01-21 09:01:01 UTC
tags: angularjs,angular,forms,frontend
cover_image: https://cdn-images-1.medium.com/max/1024/1*pTLog2cWsWPONjClyNsmUg.png
canonical_url: https://medium.com/@tomastrajan/angular-reactive-sub-forms-type-safe-without-duplication-dbd24225e1e8
---


> In this article we’re going to explore various approaches how to implement reactive sub-forms and discuss their trade-offs. At the end you will be able to make informed decision based on the particular use case to deliver best possible experience for your users and great developer experience for your colleagues!

Forms represent one of the most important parts of almost all frontend applications. From a single input field to a multi step wizards, forms enable dialog with the users by providing them with a way to submit many different kinds of data!

When developing Angular application, we will rarely end up with just a single form. It is much more common to implement many different forms for the individual features based on user requirements.

> It is quite usual that some of the forms (or their parts) will feel repetitive as we keep re-implementing them over and over again!

### An Example

Let’s say we’re implementing a customer form. There will most likely be a part of that customer form which will hold address data. We will use Angular reactive forms and a nested FormGroup to describe address object with properties (and inputs) for stuff like street, city or zip code.

[Read the full story...](https://medium.com/@tomastrajan/angular-reactive-sub-forms-type-safe-without-duplication-dbd24225e1e8)
Empower your Project with Project Management Software
Tags: projectmanagement, projectmanagementsoftware
Published: 2020-01-21 08:42:50

Get to know the necessity of project management and also learn the importance of project management software in empowering your project and executing it successfully.

Read in detail:  https://bit.ly/36bX5dC

#importanceofprojectmanagementsoftware #projectmanagement #projectmanagementsoftware
TGTBT "click and plant trees" and "send SMS from your phone for free"
Published: 2020-01-21 08:40:29

you know those too good to be true TGTBT ads and youtube video ads that say "X is the best thing since sliced bread" well sorry im sceptical i dont beleive them !

but i am also WEAK and after seeing them for the 100th time i succumb and click AND it turns out that sometimes they are TRUE !

here are two ads that really are TGTBT
* [ecosia](https://www.ecosia.org/) REALLY do plant trees every 1000 clicks
* [mightytext](https://mightytext.net/web8/) REALLY does send an SMS from your pc via your phone

BTW this month ecosia will be planting extra trees in australia !
EasyJet thấy cải thiện nửa đầu về nhu cầu mạnh mẽ cho các chuyến bay
Published: 2020-01-21 08:29:47

LONDON (Reuters) - Hãng hàng không giá rẻ easyJet ( EZJ.L ) của Anh cho biết hiệu suất nửa đầu năm sẽ cải thiện so với năm ngoái vì nhu cầu mạnh mẽ cho các chuyến bay đã giúp hãng nâng cấp dự báo doanh thu trên mỗi ghế.Xem thêm: https://traveltop.vn/

EasyJet hôm thứ ba cho biết họ hiện dự kiến ​​doanh thu nửa đầu mỗi ghế sẽ tăng từ một đến hai chữ số cao, so với dự báo trước đó cho nó tăng từ thấp đến trung bình một chữ số.

Báo cáo trong ba tháng tính đến ngày 31 tháng 12, hãng hàng không cũng cho biết khoản lỗ trước thuế nửa đầu năm sẽ thu hẹp so với năm ngoái, do nhu cầu du lịch mạnh mẽ trong thời kỳ mùa đông yên tĩnh hơn. Nó có xu hướng kiếm phần lớn lợi nhuận trong mùa hè.
HELP ! is there a "DEVTO anonymous" i can join ?
Tags: devto, addiction, webdev
Published: 2020-01-21 08:23:22

HELP ! is there a "DEVTO anonymous" i can join ? its not even 9am and I already have 15 DEVTO tabs open - I NEED TO DO SOME WORK PLEASE STOP DISTRACTING ME

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/ypcmw2eix6kof8vvjkos.png)
Best sources to learn programming👨‍💻💻😄
Tags: programming, python, web, html
Published: 2020-01-21 08:19:27

### Best apps to learn programming - 

1. Programming Hub
2. Encode: Learn to code
3. Mimo: Learn to code
4. Enki: Learn Data Science
5. CodeGym

### Best websites to learn programming - 

1. Codeacademy
2. Coursera
3. Treehouse
4. Freecodecamp
5. W3Schools
Am drowned! 😭 can someone explain what prisma and apollo is like am 12!
Tags: help
Published: 2020-01-21 08:18:39

Hi everyone, I've been following graphql lately and i don't yet fully understand the difference between prisma, graphql and apollo grapghql, ive gone through their docs but the whole concept seems overwhelming i would want the community to explain how they differ from each other and what they tend to fix, Thanks
MobX vs Redux comparison
Tags: react, javascript, reactnative, webdev
Published: 2020-01-21 08:18:25

Not many people know that MobX and Redux started around the same time, provide state management for your library, but achieve it in different ways.

I try to compare the two libraries and how they work, as well as their advantages and disadvantages.

* What MobX is
* What Redux is
* How they compare
* Where you might use them
* What you should learn depending on your situation

{% youtube UeRUT5H6XPI%}
Avoid npm build errors by tracking your Node version with nvm
Tags: npm, nvm, node, javascript
Published: 2020-01-25 06:33:19

---
title: Avoid npm build errors by tracking your Node version with nvm
published: true
date: 2020-01-21 08:15:00 UTC
tags: npm, nvm, node, javascript
canonical_url: https://chriscolborne.com/avoid-npm-build-errors-with-nvm/
cover_image: https://www.modernjsforphpdevs.com/static/featured-image-06e77ad613019d9036337b2cc5f2e997-c7352.jpg
---

You know the feeling. You get a spare moment jump in and do some updates on an old app. But you try to get it running and the dreaded npm errors come up.

Oftentimes, the issue is that you’ve updated Node since you last ran it. Many issues with dependencies and npm can been easily solved by switching Node versions.

Easy, so just go back to the version of node you used when you originally developed it. But how do you know which version to jump to? Just guess and check?

Perhaps you can leave a note in your README saying “This works in Node version X.” And sure, that’s certainly one way of solving it.

But using `nvm`, we can track the version, as well as automate the switch back, and that’s what we’ll talk about today.

`nvm` is [Node Version Manager](https://nvm.sh). It primarily allows you to switch between isolated Node environments for different versions. If you’ve used rvm/rbenv in Ruby, it’s similar to that.

For our purposes today however, the killer feature is the `.nvmrc` file. `.nvmrc` is a file you commit with your project which contains a single line with the version of Node to use for this project.

In a project with an `.nvmrc` file, you can type `nvm use` and it will automatically switch back to the version you’ve stated. If you’re really keen, you can (and I’d say you should) also set up your shell to [automatically `nvm use`](https://github.com/nvm-sh/nvm/blob/master/README.md#deeper-shell-integration) when it encounters an `.nvmrc` file.

So start using `nvm` and `.nvmrc` in your projects and next time you’re returning to an old project, you’re just an `nvm use` away from being back up and running quick smart.
Reading Snippets [37 => Validation]
Tags: html, beginners
Published: 2020-01-21 07:49:55


HTML validation can be carried out on sites such as https://validator.w3.org/#validate_by_upload . While it may seem like a somewhat arduous task at first, one must be cognizant of the fact that there are several benefits that come with it:


💻 Less load on servers

💻 Faster loading

💻 Browser compatibility 

💻 Website Accessibility
Why mobile application testing services are important?
Tags: mobileapplicationtesting
Published: 2020-01-21 07:36:17

Among the different methods, versatile test systems have for quite some time been utilized for testing mobile applications. The mobile simulator is a programming application that is worked to work simply as a genuine condition or gadget. There are various advantages of utilizing test systems for testing portable applications. Above all, these test systems are anything but difficult to actualize and end up being a practical alternative for testing versatile applications. 

A large portion of the test systems are allowed to download and there is no compelling reason to buy any test system on the web. Applications can be introduced rapidly on these test systems and testing should be possible on different test systems adequately. At the same time, the testing doesn't get hindered with moderate system issues and the procedure just shows signs of improvement. 

Besides, the analyzers can get full access to the neighborhood stockpiling on a test system. This empowers them to comprehend the conduct of an application in the neighborhood stockpiling condition. Along these lines, applications can be viably tried with Mobile Simulators. It gives the simplicity of establishment and lifts quicker time-to-showcase. 

Testing with mobile emulators to check the fundamental application usefulness in the element improvement process. These emulators give splendid alternatives to organize sidestep, a pseudo-live condition, and test scripting dialects.

Key Factors to Consider in <a href="https://www.testingxperts.com/services/mobile-testing/">Mobile Application Testing</a> 

Choice of Mobile Devices – In a gadget testing approach, it is imperative to choose the most reasonable gadgets for testing according to the inclinations of the objective gathering and the utilization designs. 

Test systems or Real gadgets – Simulators help in giving a genuine domain to testing and gadgets help to difficult test the applications. 

Cloud Testing – By utilizing the cloud, you are in a superior situation to arrive at quicker to the market and cut down the testing costs. 

System – It is imperative to test the applications under shifting system conditions, to make them utilitarian across testing system situations. 

Execution – Automated testing can be actualized to check the exhibition of an application and confirm its conduct by applying load/stress. 

Manual/Automated – Both sorts of testing are fundamental to test portable applications and check them for any disappointment courses or bugs.
Meet "gh" - the Official GitHub CLI
Tags: git, github
Published: 2020-01-21 07:34:50

`gh` is a new CLI that enables you to work seamlessly with GitHub on the command line.

As of the date of writing this post, the tool is still in its early stages of development.

### Installation

```
brew install github/gh/gh
```

### Features

With `gh`, you can create, view, and checkout pull-requests. You can also create and view issues. Let's view its options:

```sh
$ gh pr create --help
Create a pull request

Usage:
  gh pr create [flags]

Flags:
  -B, --base string    The branch into which you want your code merged
  -b, --body string    Supply a body. Will prompt for one otherwise.
  -d, --draft          Mark pull request as a draft
  -t, --title string   Supply a title. Will prompt for one otherwise.
  -w, --web            Open the web browser to create a pull request

Global Flags:
      --help              Show help for command
  -R, --repo OWNER/REPO   Select another repository using the OWNER/REPO format
```

Now let's create a simple PR:

```sh
$ gh pr create --base master

Creating pull request for test_branch into master in MarounMaroun/git_examples
```

We'll now be prompted to enter the PR title:

```sh
$ gh pr create --base master

Creating pull request for test_branch into master in MarounMaroun/git_examples

? Title My first PR from CLI!
```

Continuing with the prompt, we'll be asked to enter the PR's description, and finally a validation window:


```sh
? Submit?  [Use arrows to move, type to filter]
> Yes
  Edit
  Cancel
```

After hitting "Yes", the PR will be created for us:

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/6v83xz373brt7gw2ijye.png)

Feel free to explore the command:

```sh
gh --help
gh pr --help
gh pr create --help
gh issue view --help
# and so on...
```
Differences of Dates in D
Tags: dlang, calendar, tutorial, dates
Published: 2020-01-21 07:23:03

Navigate the calendar is difficult, especially as you move back to ancient times.

Epoch, Julian, Gregorian, leap year, leap second, timezone, dates and time are complicated though assistance can be found in libraries and operating systems, but ultimately can't be ignored in many applications. 

Timezone is the most common struggle. I won't be touching on best practices or how reporting my be affected. I will go over the tools D provides for comparing dates and the two types of dates. 

```dlang 
import std.datetime;
assert(DateTime(2015, 12, 31, 23, 59, 59) + seconds(1) ==
       DateTime(2016, 1, 1, 0, 0, 0));
```

The first type is timezone free and good at navigating dates and time. 

```dlang 
import std.datetime;
assert(DateTime(2016, 1, 1, 0, 0, 0)
     - DateTime(2015, 12, 31, 23, 59, 59) 
     == dur!"seconds"(1));
```

Performing operations on dates produces and utilizes a `Duration`. While you can subtract dates, semantics for adding are not defined and the compiler will reject

```dlang
// does not compile 
auto fail = DateTime(2015, 12, 31, 23, 59, 59)
            + DateTime(2016, 1, 1, 0, 0, 0);
```

--------

SysTime is the other object, includes timezone and operates basically the same. 
```dlang
import std.datetime;
assert(SysTime(DateTime(2016, 1, 1, 0, 0, 0)) 
     - SysTime(DateTime(2015, 12, 31, 23, 59, 59)) 
    == dur!"seconds"(1));
```

-----------

```dlang 
auto dt = SysTime(DateTime(2015, 12, 31, 23, 59, 59));

dt += dur!"seconds"(1);
assert(dt == SysTime(DateTime(2016, 1, 1, 0, 0, 0)));
    
dt += dur!"days"(44);
assert(dt == SysTime(DateTime(2016, 2, 14, 0, 0, 0)));
```

Creating a `Duration` with `dur` allows for manipulating the timeline. I'm not showing all operations, D provides operator overloads which allows all the normal operations with addition, subtraction, less than, greater than.
Coding Bootcamp - Backend #1 - Asynchronous code
Tags: javascript, node, sql, postgres
Published: 2020-01-21 07:20:34

A quick recap, After the first 3 week block I'm comfortable using the command line, Git, GitHub, HTML, CSS, and JavaScript. I've been taught concepts such as closure, recursion, functional programming, and using classes in OOP. I've also done more katas than I can remember and made some really basic websites in my spare time outside of classes.

...
.org vs .com – Which Domain Extension is Better for Your Website?
Tags: webdev
Published: 2020-01-21 07:02:27

After .com, .org is the 2nd most popular domain extension on the internet. However, they are both top-level domains but used for different purposes. If you have planned to start your website, whether business, personal blog, portfolio, nonprofit, etc., you may be wondering which domain extension to choose or if there is any difference between domain extensions, let’s say .org vs .com.

Choosing the right domain name as well as the extension is very important, as it has an impact on your business’s reputation and credibility. In this article, we will share the difference between .com vs .org domain extensions.

What is a Domain Extension?
A domain extension is the last part of a domain name. For example, in the domain “WPMyWeb.com,” “WPMyWeb” is the domain, and “.com” is the extension.

While registering a domain name, you need to choose an extension that suits the purpose of your website, for example, “.com” for commercial websites, “.net” for network-related websites, “.edu” for education-related websites.

Once selected, you need to register your domain along with an extension as soon as possible before someone else buys it.

There are over 1,000 extensions available, but we recommend you to go with popular TLDs such as .com, .net, .edu, .org, .co, .org, etc. You can also choose country-specific TLDs like .us – for United States, .co.uk – United Kingdom, .it – Italy, .jp – Japan, etc.

Now, let’s compare the difference between .org vs .com to see which domain extension is better for your website.

.Com and .Org is the most popular domain name extensions on the internet.

Nearly 46.7% of the total websites are registered with the .com domain extension, where around 5.2% of the total websites are registered with the .org extension.

What does .com mean?
.com stands for “commercial” is the most popular top-level domain extension on the internet. It is primarily used for commercial websites like businesses, personal blogs, eCommerce stores, portfolios, or any kind of website that makes money.

What does .org mean?
.org stands for “organization” which is another top-level domain extension that is mostly used for non-profit organizations, such as Wikipedia.org.

However, nowadays, many businesses register both domain extensions to make sure nobody can hurt their brand name.

Read the full article here: https://www.wpmyweb.com/beginners-guide/org-vs-com.html
Meet New Challenges
Tags: php, opensource
Published: 2020-01-21 06:55:08

Recently I've started my API-Driven PHP Framework. I'm working on it to use in my open source or side projects. If you would like to meet new challenges, learning some new stuff, meet other developers, etc.. You can contribute on [espressoPHP](https://github.com/espressoPHP/framework#todo) and you are very welcomed :)
Destructuring Props in React
Tags: react
Published: 2020-01-21 06:50:38

JavaScript ES6 introduced destructuring, which allows you to extract values from arrays, or properties from objects. Destructuring allows for fewer lines of code which improves readability (and helps developers be ~~lazy~~ efficient).
___
Speaking of being efficient, check this out: {% medium https://medium.com/@hasibulc91/visual-studio-code-shortcuts-6f0122109532 %}
___

Here is an example of a state object that might be passed down as props.

```js
state = {
    displayArray: [],
    clicked: false,
    searchKey: ""
  }
```

In the past, I would have written the following to access the props:
```js
let displayArray = props.displayArray
let clicked = props.clicked
let searchKey = props.searchKey
```


However, I can easily write those three lines as one line because I am accessing properties from the same object. In this case, the `props` object.

*Destructured:*
```js
let { displayArray, clicked, searchKey } = props;
```
___

Another Example:
```js
<Card>
    <img src={this.state.front ? this.props.pokemon.sprites.front : this.props.pokemon.sprites.back} alt=" "/>
    <div className="header">{this.props.pokemon.name}</div>
</Card>
```
Or
```js
let name = this.props.pokemon.name
let sprites = this.props.pokemon.sprites

<Card>
    <img src={this.state.front ? sprites.front : sprites.back} alt=" "/>
    <div className="header">{name}</div>
</Card>
```


*Destructured:*
```js
let { name, sprites } = this.props.pokemon;

<Card>
    <img src={this.state.front ? sprites.front : sprites.back} alt=" "/>
    <div className="header">{name}</div>
</Card>
```


___
**_Sources:_**
1. [Learn the basics of destructuring props in React](https://www.freecodecamp.org/news/the-basics-of-destructuring-props-in-react-a196696f5477/)
2. [Prefer destructuring from arrays and objects (prefer-destructuring)](https://eslint.org/docs/rules/prefer-destructuring#further-reading)