Skip to content

Instantly share code, notes, and snippets.

View OleksandrKucherenko's full-sized avatar

Oleksandr OleksandrKucherenko

View GitHub Profile
@sgergely
sgergely / gist:3793166
Created September 27, 2012 09:43
Midnight Commander Keyboard Shortcuts for Mac OSX
----- Esc -----
Quick change directory: Esc + c
Quick change directory history: Esc + c and then Esc + h
Quick change directory previous entry: Esc + c and then Esc + p
Command line history: Esc + h
Command line previous command: Esc + p
View change: Esc + t (each time you do this shortcut a new directory view will appear)
Print current working directory in command line: Esc + a
Switch between background command line and MC: Ctrl + o
Search/Go to directory in active panel: Esc + s / Ctrl + s then start typing directory name
@chrismccoy
chrismccoy / gitcheats.txt
Last active April 20, 2024 08:50
git cheats
# alias to edit commit messages without using rebase interactive
# example: git reword commithash message
reword = "!f() {\n GIT_SEQUENCE_EDITOR=\"sed -i 1s/^pick/reword/\" GIT_EDITOR=\"printf \\\"%s\\n\\\" \\\"$2\\\" >\" git rebase -i \"$1^\";\n git push -f;\n}; f"
# edit all commit messages
git rebase -i --root
# clone all your repos with gh cli tool
gh repo list --json name -q '.[].name' | xargs -n1 gh repo clone
@anthavio
anthavio / jstatd
Last active January 14, 2016 13:09
jstatd /etc/init.d script
#!/bin/sh
# chkconfig: 345 99 05
# description: Java jstatd utility
# Install
# /etc/init.d/jstatd
# chkconfig --add jstatd
# Optional variables:
# JAVA_HOME, JPS_BIN, JSTATD_BIN, JSTATD_PORT, POLICY_FILE
# JPS_APP_ID, JVM_START_LOG, START_TIMEOUT, STOP_TIMEOUT, TIME_STEP
@avbk
avbk / robo.md
Last active October 14, 2017 00:16
Testing with Robolectric within Android Studio

Testing with Robolectric within Android Studio

Prerequisites

0. Setup a project

Setup a new Android project with Android Studio. If you already have done this you can skip this step.

@OleksandrKucherenko
OleksandrKucherenko / JsonLoader.java
Last active March 23, 2018 06:20
Volley Library adaptation for Loader pattern.
import android.os.Handler;
import android.os.Message;
import android.support.v4.content.Loader;
import com.android.volley.NoConnectionError;
import com.android.volley.Response;
import com.android.volley.RetryPolicy;
import com.android.volley.TimeoutError;
import com.android.volley.VolleyError;
import com.android.volley.toolbox.JsonRequest;
@ishu3101
ishu3101 / gist_to_github_repo.md
Created November 24, 2015 08:35
Transfer a gist to a GitHub repository

Transfer a gist to a GitHub repository

clone the gist

git clone https://gist.github.com/ishu3101/6fb35afd237e42ef25f9

rename the directory

mv 6fb35afd237e42ef25f9 ConvertTo-Markdown

change the working directory to the newly renamed directory

cd ConvertTo-Markdown

@OleksandrKucherenko
OleksandrKucherenko / git-log-top10.sh
Created June 30, 2016 07:34
Get fancy git log, get last top 10 commits. (By parameter can be defined number of line to print)
#!/bin/bash
if [ -z "$1" ]; then
TOP=10
else
TOP=$1
fi
# display top 10 messages with line numbering
git --no-pager log --pretty=format:"%h%x09%Cblue%cr%Cgreen%x09%an%Creset%x09%s%Cred%d%Creset" -n $TOP --date=short | nl -w2 -s" "
@OleksandrKucherenko
OleksandrKucherenko / version-up.sh
Last active May 2, 2024 13:04
Calculate Next Suitable Version Tag for Your Git based project
#!/usr/bin/env bash
# shellcheck disable=SC2155
## Copyright (C) 2017, Oleksandr Kucherenko
## Last revisit: 2023-09-30
## Version: 2.0.2
## License: MIT
## Fix: 2023-10-01, prefix for initial INIT_VERSION was not applied
## Fix: 2023-10-01, correct extraction of latest tag that match version pattern
## Added: 2023-09-30, @mrares prefix modification implemented
Useful tricks for Android gradle files
- build time
- ci_job
- dependencies
- force a lang for a specific flavor
- gcm flavorish google-services.json
- git commit count
- git sha
- isIdeBuild