Today I Learned

How to Quick Solve a Git Conflict?

When you are in the conflct state simply type:

# git checkout --ours .
# git add .

to keep all your changes, or:

# git checkout --theirs .
# git add .

to do the opposite.

How to Back to Previously Checked Git Branch

Right after dealing with master you can easily back to your previous branch with:

$ git checkout master
$ git checkout -

Can't Compile Rust Code to asmjs/wasm

When following error brakes your compilation to asmjs/wasm:

 = note: shared:ERROR: fastcomp is not compatible with wasm object ...

Just update emstcripten, and install upstream compiler.

$ emsdk install latest-upstream
$ emsdk activate latest-upstream

Do Not Eclose Markdown Content Into <p> Tag

If you are using for example Gatsby like I do, don't enlose html from markdown into <p> tag. The content of <p> will be missing in some cases. Anyway<p> should not include any block elements such as <p>.

Instead of:

<p className="article-post" dangerouslySetInnerHTML={{ __html: html }} />

use:

<div className="article-post" dangerouslySetInnerHTML={{ __html: html }} />

How to Rotate Screen in QT5 QML?

QML Code:

import QtWebEngine 1.5
import QtQuick 2.10
import QtQuick.Layouts 1.3

Item {
  rotation: 90

  StackLayout {
    width: parent.height
    height: parent.width
    x: (parent.width - parent.height) / 2
    y: -(parent.width - parent.height) / 2
    Widget {}
    Widget {}
  }
}