teleren/devto huggingface dataset:
Unmerging a git branch, keeping post-merge commits
Tags: git, unmerge, commit
Published: 2021-04-08 14:39:24

#### push your code Everyday to git?
After several commits on the merged master, the client wants the work done on the commit removed, but not the commits done after the merge.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bqkisad8nm82mlh3rb3y.png)


Say there are **three** branches master, branch-A and branch-B.

I work on branch-A, a friend on branch-B. Once things are finalized, we merge branch-A and branch-B with the master.

After several commits on the merged master, the client wants the work done on branch-B removed, but NOT the commits done By branch-A after the merge.

### How can we do it?



#### Basically, you git unmerge the commits :

Checkout to the master branch
```
git checkout origin master
```
View the commit history
```
git log
```

```
$ git log
commit ca82a6dff817ec66f44342007202690a93763949
Author: Sahil <sahil@gee-mail.com>
Date:   Mon Mar 17 21:52:11 2021 -0700

    Commit by Branch-A

commit 085bb3bcb608e1e8451d4b2432f8ecbe6306e7e7
Author: Sahil <sahil@gee-mail.com>
Date:   Sat Mar 15 16:40:33 2021 -0700

    Commit by Brach-B

commit a11bef06a3f659402fe7563abf99ad00de2209e6
Author: Sahil <sahil@gee-mail.com>
Date:   Sat Mar 15 10:31:28 2021 -0700

    Initial commit
```

The commit we need to unmerge is 
**commit 085bb3bcb608e1e8451d4b2432f8ecbe6306e7e7**
```
git revert <hashOfMergeCommit>
```
in our case
```
git revert 085bb3bcb608e1e8451d4b2432f8ecbe6306e7e7
```
If you need to reference numerous commits in the revert command, eg:
```
git revert <hashOfMergeCommit1> <hashOfMergeCommit2> <hashOfMergeCommit3>...
```

###Congratulations!
You've segregated the code you need, but don't stop there. Continue exploring and see what you can commit.
The Cloud Resume Challenge (series): Part 8 - HTTPS & ACM
Tags: devops, serverless, cloud, aws
Published: 2021-04-08 06:43:17

---
title: The Cloud Resume Challenge (series): Part 8 - HTTPS & ACM
published: true
tags: #devops #serverless #cloud #aws
---

This is the eighth episode in a series on the cloud resume challenge series. In the last video we setup Route53 and pointed it at our CloudFront distribution, but received a 403 error as our CloudFront distribution wasn't yet setup to allow our custom domain, and didn't have HTTPS setup. 

In this video we go through and add HTTPS for our CloudFront distribution so we can start to get rid of that 403 and have our CloudFront serve content from a custom domain. 

{% youtube K9KF1x9H74Y %}

If you’ve not heard of the [cloud resume challenge](https://cloudresumechallenge.dev/), it’s a free challenge that you can take to build a resume using AWS.

It’s a great starting point for beginners or those new to the cloud. But… it’s definitely not for the faint of heart!

The challenge is tough and requires you to learn lots of different aspects of the cloud from CDN's to CI pipelines. The best way to learn any technology is by getting hands-on and using it in anger.

The point of this YouTube series is to provide some extra structure and guidance to the challenge for those daring to attempt it!

But it's not about giving you all the answers, just some prompts, and some ideas to push you in the right direction.

So... if you're thinking of getting into the cloud, do you dare take on the cloud resume challenge? 😁
3 Free And Open Public APIs
Published: 2021-04-08 14:37:22

Now I am gonna tell you 3 public APIs that don't need any API keys.

## 1.BORED API 🥱
 [The Bored API](https://www.boredapi.com/) helps you find things to do when you're bored! There are fields like the number of participants, activity type, and more that help you narrow down your results.

## 2. SHRTCODE - URL SHORTENER 🔗
[SHRTCODE](https://app.shrtco.de/) is a simple, secure, and friendly API that lets you convert long URLs to short ones.

## 3. LYRICS.OVH

[LYRCIS.OVH](https://lyrics.ovh/) is a lyrics API that doesn't need any API keys !!. It is Completely Free To Use.
Stop making these mistakes if you want to succeed
Published: 2021-04-08 14:34:11

>What programming languages should I learn?

>Which frameworks are the best?

>Udemy is having a sale, which courses should I get?

>There's so many blogs and articles about programming that I feel like I'm drowning in things to read.

Stop it. Stop that right now.

Adam Smith had it right hundreds of years ago when he wrote in his _Wealth of Nations_ that wealthy nations will tend to have a labor force that specializes. When people specialize, they can get really good at that one thing, which will make them in very high demand for the thing that they've spent their lives mastering. 

This is why the specialized surgeon tends to earn more than the general practitioner physician. This is why top athletes focus their efforts on one sport. Even Michael Jordan, when he attempted to switch to baseball, went right back to basketball.

Have goals, turn goals into plans, and then put on your blinders.

There's a time to brainstorm, to think, and to compare options to one another.

Sure, decide if you want to learn python or Javascript. Figure out if you'll run Windows, Mac OS, or Linux. Check out that blog for a moment to see if it's worth subscribing to.

But once you've decided what you want to learn, or what you want to accomplish, you need to focus, and that means shutting out all the rest. Have a plan, or a curriculum of courses, books, whatever, and stick to it until it's done. Be slow when deciding to change your plans, don't just do it on a whim, don't just get swept up by marketing (sales on courses, or catchy headlines).

You don't need to read every article post, don't worry, you're not missing anything, and they're not going anywhere. Getting good at your craft and practicing the fundamentals is more important then the shiny new whatever-it-is that the blog is writing about. 

You don't need to constantly be on x or y forum just to "check in", "see how others are doing", or "report your status/progress". You can if it's intentional for your own personal online social media presence, but intentional is the important bit.

_**TL;DR: This is a reminder to stop getting distracted, stop having FOMO for things that won't make you a better dev, and to get to it, and do the work you need to do.**_
Updating 2 tables with one form Ruby on rails and MySQL database.
Published: 2021-04-08 13:59:59

Let's create 2 models that are related to each other...

parent model : Product with name attribute.

child model: Imaged with URL attribute.

rails g model Image url:string 

rails g scaffold Product name:string references Image



Next set-up MySQL database from this link: 

https://www.ionos.com/digitalguide/server/know-how/use-mysql-with-ruby-on-rails/

after setting up the db...


user the product controller to update both the 2 models.

like this: 

class ProductsController < ApplicationController
  before_action :set_product, only: %i[ show edit update destroy ]

  # GET /products or /products.json
  def index
    @products = Product.all
    
  end

  # GET /products/1 or /products/1.json
  def show
  end

  # GET /products/new
  def new
    @product = Product.new
    @image=@product.build_image
  end

  # GET /products/1/edit
  def edit
  end

  # POST /products or /products.json
  def create
    @product = Product.new(product_params)
    puts(product_params) 
    respond_to do |format|
      if @product.save
        format.html { redirect_to @product, notice: "Product was successfully created." }
        format.json { render :show, status: :created, location: @product }
      else
        format.html { render :new, status: :unprocessable_entity }
        format.json { render json: @product.errors, status: :unprocessable_entity }
      end
    end
  end

  # PATCH/PUT /products/1 or /products/1.json
  def update
    respond_to do |format|
      if @product.update(product_params)
        format.html { redirect_to @product, notice: "Product was successfully updated." }
        format.json { render :show, status: :ok, location: @product }
      else
        format.html { render :edit, status: :unprocessable_entity }
        format.json { render json: @product.errors, status: :unprocessable_entity }
      end
    end
  end

  # DELETE /products/1 or /products/1.json
  def destroy
    @product.destroy
    respond_to do |format|
      format.html { redirect_to products_url, notice: "Product was successfully destroyed." }
      format.json { head :no_content }
    end
  end

  private
    # Use callbacks to share common setup or constraints between actions.
    def set_product
      @product = Product.find(params[:id])
    end

    # Only allow a list of trusted parameters through.
    def product_params
      params.require(:product).permit(:name,
      image_attributes:[:url, :alt]
      )
    end
end
Python vs Golang
Tags: python, go, webdev
Published: 2021-04-08 13:59:23

![Python vs Golang](https://exceed-team.com/images/1461/python-vs-golang.webp)

**Python and Golang (Go)** were originally created for different purposes. That is why comparing these languages from the position of " which is better” is inadequate. Your choice of these two programming languages is based on the goal that you are pursuing. To do this, you should compare what these languages are capable of.

###Using Python
Python is a high-level programming language. Python is easy to use because of its syntax and simple code. There are a huge number of libraries and frameworks based on Python. It is used when you need a unique solution and easy scaling of the project.

How to use Python:

-Artificial Intelligence (AI)
-Robotics
-Machine Learning
-Face Recognition
-Enterprise Applications
-Database
-Websites
-Games
-Graphical user interface
-System programming

Python is often used by beginners or junior developers who are just learning about data science. Python has large libraries, including machine learning.

###Using Golang (Go)

Go is a procedural functional language. It is designed to increase the speed of the code. It is not designed to work with servers and is able to force the algorithm to perform its steps not linearly, but not in order.

Example of using Golang (Go):

-Everything can be developed on it, except for those cases where machine learning is necessary

It will take a very long time to list how many things were created on Golang (Go). But here is a brief list of companies and services that chose Golang (Go):

-Google
-intel
-Microsoft
-Disney
-Facebook
-BBC

And many others. It is worth noting that a number of applications and functions in the listed companies are created in Python. For example, the AI algorithms that push content and collect statistics are created in Python. But after the massive updates of 2017-2018, the apps listed and many other firms chose the faster-running Golang (Go).

**Conclusion**

Golang (Go) helps you scale your business, make your applications more user-friendly, and more responsive to changing algorithms. Python is slower, but its speed is compensated by a large library base and the ability to implement machine learning.

-If you are going to develop machine learning in your project, then choose Python.
-If the speed of the server part is important for you and the ability to write almost everything, then we recommend giving preference to Golang.

However, you may need to learn a completely different programming language. To do this, we recommend reading this [blog](https://exceed-team.com/tech/python-vs-golang) to briefly and easily understand the key features of programming languages and choose the most suitable one for yourself.
The Power of Laser Focus | Podcast
Published: 2021-04-08 13:51:13

{% spotify spotify:episode:3U5tzYumGyoNglfD0YscCs %}

## What is HTML All The Things

HTML All The Things is a [web development podcast](https://podcast.htmlallthethings.com/) and [discord community](https://discord.com/invite/jweMCx9) which was started by Matt and Mike, developers based in Ontario, Canada. 

The podcast speaks to web development topics as well as running a small business, self employment and time management. You can join them for both their successes and their struggles as they try to manage expanding their Web Development business without stretching themselves too thin. 

## What's This One About?

In this episode Matt and Mike discuss how laser focus can help drive you and your projects to the finish line quickly, but with the huge caveat that it's hard to figure out exactly what to laser focus on. Unless you're one of the lucky ones, that knew exactly what they were going to do for a career from high school onward, then the road to your passions and eventually the thing that you're going to laser focus on is a difficult one. While difficult, it is more than worth it as you'll be focusing on exactly what you want to be doing and not something that drives you crazy, or makes you bored on the daily.

## Show Notes

2:10 - Introduction

3:10 - Laser focused people

6:36 - Education system failures

15:20 - The struggles of attaining laser focus

25:55 - Deciding what to be focused on

29:30 - Figuring out what sticks

36:25 - Laser focus and passion


##Key Takeaways

* Laser focus allows you to focus on one thing and nothing else, pushing forward on a single goal at full speed without distractions or splitting your time across different goals
* All the options and opportunities in tech just make laser focusing more difficult and can make you stall out on your career, burning out before you even start
* Doing nothing because of being overwhelmed is the worst thing you can do to yourself, finding something to laser focus on by trying many things to see what sticks
* Finding your passion and using it to drive you laser focus can help keep you motivated 

##Social Links

You can find us on all the podcast platforms out there as well as

[Instagram (@htmlallthethings)](https://www.instagram.com/htmlallthethings/)
[Twitter (@htmleverything)](https://twitter.com/htmleverything)
[Facebook (Html All The Things)](https://www.facebook.com/htmlallthethings)
Build a Netflix Landing Page Clone with HTML, CSS & JS
Tags: html, css, javascript, beginners
Published: 2021-04-08 13:48:30

Build a Netflix Landing Page Clone with HTML, CSS & JS.

This will sharpen your HTML , CSS Grids, and JavaScript skills.

All the images files are taken from real netflix website.

Source Code  <h2 style="color:green;">https://codepen.io/Bilal1909/pen/zYNBWoa</h2>
Things I Wish I Knew When I Started Programming
Tags: career, programming, beginners
Published: 2021-04-08 13:47:13

This time I am doing things a bit differently. I have created a video on "Things I Wish I Knew When I Started Programming" instead of writing a blog. 
Hope you all like it and below are the main 3 points:

[![Problem Solving Technique](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/h2ov0fhemi54fipnms2e.png)](https://youtu.be/hVWB-t78FGE "Things I Wish I Knew When I Started Programming")

#1 Been a perfectionist is not the way to go
#2 Knowing tech is not everything
#3 Things change fast
How to remove the falsy value attribute from object
Tags: javascript, es6, object, falsyelement
Published: 2021-04-08 13:47:00

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

Sometimes we want to remove null, empty, undefined, false value attribute from an object. we can do this using the below method.

```
const removeFalsyElement = object => {
  const newObject = {};
  Object.keys(object).forEach(key => {
    if (object[key]) {
      newObject[key] = object[key];
    }
  });
  return newObject;
};
```
assume my object like this
```
const myObject = {
  withValue: "have some value",
  withNumber: 1234,
  nullValue: null,
  undefinedValue: undefined,
  emptyValue: "",
  falseValue: false
};
```
and want to return those attribute which has actual value.
usage
```
console.log(removeFalsyElement(myObject));
// output: Object { withValue: "have some value", withNumber: 1234 }
```
How the terms AI, Machine Learning and Operations Research differs from each other and relates to each other
Tags: ai, machinelearning, operations, algorithms
Published: 2021-04-08 13:47:00

AI is a section or subset of Artificial Intelligence, as you may be knowing. Be that as it may, Operations Research is completely totally different from the two advances. It is the way toward improving the activities of an actual organization, group, or association. What essentially Operations Research does is that it relates every one of the factors that go into making tasks smooth and thinks about them to make the conditions of different factors, which when controlled, will create the ideal outcomes. 

Though AI is tied in with emulating the human mind, its neuro associations, and the practices and dynamic capacities, to perform human-situated undertakings, effectively with no type of human mediation. AI is a sub-area of AI, that centers around preparing a PC or machine from a particular arrangement of datasets, that at that point prepares the model to play out the errands appointed to them effectively and figure out how to improve them en route. 

The connection between them could be the subjects engaged with it, Operations Research should be possible just with insights, then again, AI, and Machine Learning both require Probability and Statistics. In the event that you wish to dominate AI, or Machine Learning look at the [Artificial Intelligence course](https://intellipaat.com/artificial-intelligence-deep-learning-course-with-tensorflow/)
Cradle Animation On Hover Efffect Using HTML And CSS | CSS Animation

Tags: html, css, javascript, beginners
Published: 2021-04-08 13:41:45

Cradle Animation On Hover Efffect Using HTML And CSS | CSS Animation

Source Code https://codepen.io/Bilal1909/pen/XWNLpdq

Demo 
{% codepen https://codepen.io/Bilal1909/pen/XWNLpdq %}
Designing a high-quality Ansible module
Tags: ansible, automation, ansiblecollections, ansiblemodules
Published: 2021-04-08 13:32:20

Trying to get developers to agree on a single definition of a good API is mission impossible. But this does not mean that we should stop trying ;) Here are three things that we learned about the Ansible module's API design while developing Ansible Collections for more than a year. 

1. **Each module should address a relatively well-defined use case** that will guide the development process. Just wrapping an underlying API is not the best option because they are often too low-level for end users. 

2. **The module's API should describe the operation's result**, not the procedure itself. Such APIs drastically reduce the need for conditional processing in Ansible playbooks and make it easier to reason about the managed system's state. 

3. **If the Ansible module talks to a remote service, it should have its connection options separated** from the rest of the parameters that describe the task's result. Alternatively, the module can use a custom Ansible connection plugin and ignore connection options entirely.
How hexadecimal notation works for CSS colors
Tags: css, design, webdev
Published: 2021-04-08 13:30:01

Hexadecimal notation are colors that start with a "#". For example, `#ff0000` is red and `#ff00ff` is pink. But how do I know which colors they are? Read on to find out.

## How hecadecimal works

Each color starts with a `#`. Then there are three pairs of numbers, where each pair is the red, green and blue component of a color. 

Visually, that looks like this:

|     | red | green | blue |
|-----|-----|-------|------|
|`#`    | `00`  | `00`    | `00`   |


These numbers are in hexadecimal (16 steps), so they don't count from 0 to 9 like we do, but from 0 to F. To make up for the missing numbers after 9, they go to "A", "B" all the way to "F". It doesn't matter if you use lower case or uppercase.

Because there's a pair of numbers it means there are 255 steps, from `00`, to `02`, `03`, all the way to `FF`. 


## How does that make colors?

The color `#ff0000` has as much red as possible (`ff`), no green (`00`) and no blue (also `00`). In other words, it's fully red. 

The color `#ffff00` is likewise as much red as possible, as much green as possible and no blue. Red and green together make yellow. 

Lastly, `#ffffff` is all red, all green and all blue or in other words, full white (and `#000000` is full black).

When all the colors are the same it means not one color is more visible than the other, making the result grey. `#111111`, `#666666` and `#9a9a9a` are all shades of grey. Likewise, when the numbers are close together, they are desaturated (closer to gray)

In hexadecimal notation, `88` is the middle point . Anything above that is light, anything below it is dark.


## Color notation variations

In CSS there are three variations on the hexadecimal notation. 

You can add a fourth pair of numbers, which correspond to the Alpha of a color, the transparency. So `#ff000088` would be fully red at half transparency. 

There is also the short notation, which has just three numbers. In it `#f00` is the same as `#ff0000`. The single numbers are automatically expanded by browsers. 

Likewise this three number notation can also get a fourth number that encodes the transparency. `#f008` is fully red at half transparency.


## "Reading" a color

When I read a color, I find it most useful to ignore each second number in a pair since it doesn't have a drastic effect. 

So for example the color`#e5e7b1` would be: 

* `E` for red, which is not fully red (that would be `F`) but very close to it. 
* Same for green which also has an `E`
* The blue component is a `B`, so it has a bit less blue. 

The result of this is then a light yellow.

And fo another color, `#123456`:

* `12` for red, so basically no red 
* `34` for green, so a little bit of green
* `45` for blue, so a bit more of blue

All are way below 88 though, so this would be a dark, somewhat desaturated (since the colors are close to each other) blue. 

_This was adapted from an explanation I gave to someone not able to see colors but that still wanted to understand how they worked. I hope this is useful to other people as well!_
Declutter your Downloads folder with Python 😎
Published: 2021-04-08 13:27:41

## Introduction

We download tons of files daily from the internet.

If you are a Windows user, they most probably land up in your Desktop folder by default, making it look like a mess.

For Unix users, it's generally the `~/Downloads` folder.

Having all the files in one folder makes it hard to navigate. It takes more time to reach the desired file. And **it simply looks bad**.

One great way of organizing files is by their mime type. That is, all the images go to one folder, all the pdfs to another, and so on.

So I made a simple tool, that can declutter your downloads folder.

## dirganize

- [PyPI](https://pypi.org/project/dirganize/)


## How to install?

Make sure you have [python](https://www.python.org/) and [pip](https://pip.pypa.io/en/stable/installing/) installed in your system.

The package `dirganize` is published to the Python Package Index. So, why wait, you can easily install it with a single `pip` command.

```shell
❯ pip install dirganize
```

## How to use ?

Navigate into the directory, which you want to organize, and run the `dirganize` command.

```shell
❯ cd Downloads
❯ dirganize
Creating mapping  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 0:00:00
Moving files  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 0:00:00

```

And that's it. Your folder is organized. 

Run the `ls` command (or `dir` for Windows) before and after executing `dirganize` to see the magic.

![alt text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o5969yyq6a44jychm812.png)
 
## Your rules

Your folder. Your rules.

Want to change the rules? I mean the rules that govern which file goes to which folder. 

Then simply, put a `.dirganize.yml` file inside the folder to override the default configuration.


A yaml file is basically converted to a python dictionary by `dirganize`. The default dictionary is overwritten by the user-defined configuration (when available).



I am [Aahnik Daw](https://aahnik.dev) and you can follow me on [GitHub](https://github.com/aahnik) and [dev.to](https://dev.to/aahnik) to stay updated with my latest repos and articles.