This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git checkout --orphan <new-local-branch-name> | |
git add . | |
it commit -m "init commit - with no git history" | |
optional push to `origin` : | |
git push -u origin main // this will track new-local-branch-name with origin/main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git branch -a | grep -v HEAD | perl -ne 'chomp($_); s|^\*?\s*||; if (m|(.+)/(.+)| && not $d{$2}) {print qq(git branch --track $2 $1/$2\n)} else {$d{$_}=1}' | csh -xfs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
There are two Modes: Insert and Command: | |
1. to go o Insert mode -> Press `i` | |
2. to switch back to Command mode -> pres `esc` | |
x - to delete the unwanted character | |
u - to undo the last the command and U to undo the whole line | |
CTRL-R to redo | |
A - to append text at the end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.support.v7.content.res.AppCompatResources; | |
THE_VIEW.setBackgroundDrawable(AppCompatResources.getDrawable(ctx, R.drawable.ic_report_review); | |
//with drwable left | |
THE_VIEW.setCompoundDrawablesWithIntrinsicBounds(AppCompatResources.getDrawable(ctx, R.drawable.ic_report_review), null, null, null); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private Runnable runnable; | |
private Handler handler; | |
private boolean condition; | |
runnable = () -> { | |
if (condition) { | |
handler.removeCallbacks(runnable); //stop handler | |
} else { | |
handler.postDelayed(runnable, 500); //check a condition every half a second (until condition is met) |