All your notes, scripts, config files and snippets deserve version control and tagging!
gist is a simple bash script for gist management.
It is lightweight(~700LOC) and dependency-free! Helps you to boost coding workflow.
| #!/bin/bash | |
| # only works atm if only one jdk package in downloads | |
| DOWNLOADS=$HOME/Downloads | |
| CURRENT_VERSION=$(java -version 2>&1) | |
| JDK=` ls $DOWNLOADS | grep "jdk"` | |
| STUDIO_URL=http://dl.google.com/android/studio/install/0.3.2/android-studio-bundle-132.893413-linux.tgz | |
| if [ "uname -m" == "i386" -o "uname -m" == "i686" ]; then | |
| ARCH=32 | |
| else |
See how a minor change to your commit message style can make a difference. Examples
Have a look at CLI util git-conventional-commits to ensure this conventions and generate changelogs
| import android.annotation.TargetApi | |
| import android.os.Build | |
| import android.security.keystore.KeyGenParameterSpec | |
| import android.security.keystore.KeyProperties | |
| import android.util.Base64 | |
| import timber.log.Timber | |
| import java.security.GeneralSecurityException | |
| import java.security.KeyStore | |
| import javax.crypto.Cipher | |
| import javax.crypto.KeyGenerator |
| #!/bin/bash | |
| # "Bash Strict Mode with logging" | |
| set -eux -o pipefail | |
| IFS=$'\n\t' | |
| case $(uname -p) in | |
| arm) | |
| ;; | |
| *) |
These commands generate and use private keys in unencrypted binary (not Base64 “PEM”) PKCS#8 format. The PKCS#8 format is used here because it is the most interoperable format when dealing with software that isn't based on OpenSSL.
OpenSSL has a variety of commands that can be used to operate on private
key files, some of which are specific to RSA (e.g. openssl rsa and
openssl genrsa) or which have other limitations. Here we always use
| import kotlinx.coroutines.CoroutineScope | |
| import kotlinx.coroutines.coroutineScope | |
| import kotlinx.coroutines.delay | |
| import kotlinx.coroutines.launch | |
| import java.lang.reflect.InvocationHandler | |
| import java.lang.reflect.InvocationTargetException | |
| import java.lang.reflect.Method | |
| import java.lang.reflect.Proxy | |
| import kotlin.coroutines.Continuation | |
| import kotlin.coroutines.cancellation.CancellationException |
| package com.example.domain.api | |
| import retrofit2.Call | |
| import retrofit2.Callback | |
| import retrofit2.Response | |
| import retrofit2.Retrofit | |
| import retrofit2.converter.gson.GsonConverterFactory | |
| open class RetrofitRepo<out S>(clazz: Class<S>) { | |
| val service: S = Api.service(clazz) |
| #!/bin/bash | |
| # http://redsymbol.net/articles/unofficial-bash-strict-mode/ | |
| set -euo pipefail | |
| IFS=$'\n\t' | |
| # inspired by | |
| # https://gist.github.com/codeinthehole/26b37efa67041e1307db | |
| # https://github.com/why-jay/osx-init/blob/master/install.sh | |
| # https://github.com/timsutton/osx-vm-templates/blob/master/scripts/xcode-cli-tools.sh |
About once a year, my machine gets pretty sluggish and it's time to start fresh. Here's the process I use to update it with everything I need.
TODO: Add info about dotfiles set up and zsh (possible settings file?)
- Save all dotfiles to a repo for easy transfer
- Back up all photos, music, apps, iTunes library, keychains, etc.