Skip to content

Instantly share code, notes, and snippets.

View dekalo-stanislav's full-sized avatar
🏠
Working from home

Stanislav Dekalo dekalo-stanislav

🏠
Working from home
View GitHub Profile
@dekalo-stanislav
dekalo-stanislav / bintray.publish.attempt.sh
Created February 28, 2021 21:57
Bintray publishing scripts set
#!/usr/bin/env bash
# https://github.com/travis-ci/travis-ci/issues/8549
# Getting current framework version
ASSERTIONS_VERSION=$(egrep -o "assertionsSdkVersion.*=.*" assertions-sdk.gradle | egrep -o "'(.*)'" | tr -d "\'")
echo "Running SDK publishing script for $ASSERTIONS_VERSION version."
### Check if it is snapshot build
if [[ $ASSERTIONS_VERSION == *"SNAPSHOT"* ]]; then
echo "[SKIP] $ASSERTIONS_VERSION is development build and should not be published."
@dekalo-stanislav
dekalo-stanislav / karabiner.json
Last active January 24, 2019 21:05
Ubuntu like karabiner config for Mac OS
{
"global": {
"check_for_updates_on_startup": true,
"show_in_menu_bar": true,
"show_profile_name_in_menu_bar": false
},
"profiles": [
{
"complex_modifications": {
"parameters": {
@dekalo-stanislav
dekalo-stanislav / .bash_profile
Last active January 13, 2019 19:30
Ubuntu like bash profile for mac
[ -f /usr/local/etc/bash_completion ] && . /usr/local/etc/bash_completion
#PS1 section\
tgreen='\[$(tput setaf 2)\]'
tpurp='\[$(tput setaf 4)\]'
twhite='\[$(tput setaf 7)\]'
export PS1="${tgreen}\u@\h${twhite}:${tpurp}\w${twhite}$ "
package com.gfycat.common.recycler;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.RecyclerView.ViewHolder;
import android.view.ViewGroup;
import com.gfycat.common.utils.Assertions;
import com.gfycat.common.utils.Logging;
import java.util.Iterator;
@dekalo-stanislav
dekalo-stanislav / version.gradle
Created November 23, 2018 22:17
Gradle script for version generation for tag
ext {
/**
* Gets the version name from the latest Git tag
*/
getGitVersionName = { ->
def stdout = new ByteArrayOutputStream()
exec {
commandLine 'git', 'describe', '--tags', '--dirty'
standardOutput = stdout
}
@dekalo-stanislav
dekalo-stanislav / passwords.gradle
Last active November 19, 2018 21:30
Easy and secure way to provide release keystore and password to gradle
/**
* Here you may define you PC local way to obtain passwords.
*/
ext {
def localPropertiesFile = project.rootProject.file('local.properties');
Properties localProperties = new Properties()
if (localPropertiesFile.exists()) {
localProperties.load(localPropertiesFile.newDataInputStream())
}
@dekalo-stanislav
dekalo-stanislav / versioning.gradle
Created March 21, 2017 10:21
Semantic Versioning for android application
/**
* Will generate versionCode from versionName that follows Semantic Versioning
*/
ext {
/**
* Application version is located version variable.
* And should follow next policy:
* X1.X2.X3-type-flavor, where X - any digits and type is optional alphabetical suffix.
* X1 - major version
* X2 - minor version
@dekalo-stanislav
dekalo-stanislav / ToggleImageButton
Last active December 15, 2015 19:38 — forked from akshaydashrath/ToggleImageButton
A ToggleImageButton for Android
import android.content.Context;
import android.content.res.TypedArray;
import android.os.Bundle;
import android.os.Parcelable;
import android.util.AttributeSet;
import android.view.View;
import android.widget.Checkable;
import android.widget.ImageButton;
public class ToggleImageButton extends ImageButton implements Checkable {