Skip to content

Instantly share code, notes, and snippets.

View max-makeichik's full-sized avatar

Max Makeichik max-makeichik

View GitHub Profile
@max-makeichik
max-makeichik / .bashrc
Created December 25, 2017 08:55
Git shortcuts
# create a file C:\Users\[user]\.bashrc
# add this content
# add your onw aliases or changes these ones as you like
# to make a dot (.bashrs) file in windows, create a file ".bashrs." (without extention) and save. windows will save it as ".bashrc"
alias cl='clear'
alias ls='ls -alh'
alias stat='git status'
alias aa='git add .'
alias cne='git commit --amend --no-edit'
@max-makeichik
max-makeichik / share-logs
Last active August 27, 2017 13:08
Write logs to a file and share it (add <uses-permission android:name="android.permission.READ_LOGS"/> permission to a manifest)
private void writeLogsToFileAndShare() {
try {
Process process = Runtime.getRuntime().exec("logcat -d");
BufferedReader bufferedReader = new BufferedReader(
new InputStreamReader(process.getInputStream()));
StringBuilder log = new StringBuilder();
String line;
while ((line = bufferedReader.readLine()) != null) {
log.append(line);