Skip to content

Instantly share code, notes, and snippets.

View morristech's full-sized avatar
🔴
"What I cannot create, I do not understand"

Wade morristech

🔴
"What I cannot create, I do not understand"
View GitHub Profile
@morristech
morristech / setup_android_studio.sh
Created July 4, 2022 11:44 — forked from bmc08gt/setup_android_studio.sh
Android Studio bash installation script
#!/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
@morristech
morristech / README.md
Created June 21, 2022 21:54 — forked from typebrook/README.md
A bash script for gist management #bash #gist

Conventional Commit Messages

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

Commit Formats

Default

@morristech
morristech / AndroidAESCipherHelper.kt
Created May 23, 2022 13:37 — forked from FrancescoJo/AndroidAESCipherHelper.kt
Android AES cipher helper with system generated key. No more static final String key in our class - an approach which is very vulnerable to reverse engineering attack. Available only API Level 23(M)+
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
@morristech
morristech / install-rust-aarch64-apple-darwin.sh
Created May 10, 2022 09:19 — forked from briansmith/install-rust-aarch64-apple-darwin.sh
Bootstrap a working native aarch64-apple-darwin Rust toolchain
#!/bin/bash
# "Bash Strict Mode with logging"
set -eux -o pipefail
IFS=$'\n\t'
case $(uname -p) in
arm)
;;
*)
@morristech
morristech / how-to-generate-and-use-private-keys-with-openssl-tool.md How to generate & use private keys using the OpenSSL command line tool

How to Generate & Use Private Keys using OpenSSL's Command Line Tool

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

@morristech
morristech / MockProxy.kt
Created May 2, 2022 05:49 — forked from rkam88/MockProxy.kt
A Java dynamic proxy that calls either the real or mocked implementation of an interface
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
@morristech
morristech / RetrofitRepo.kt
Created May 2, 2022 05:48 — forked from alwarren/RetrofitRepo.kt
Using generics with Retrofit repositories. A work in progress.
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
@morristech
morristech / _instructions.md
Created April 24, 2022 11:56 — forked from germanny/_instructions.md
Instructions for setting up OSX

Setup OSX with a Clean Install

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.