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 / 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.
@morristech
morristech / .vimrc
Created April 24, 2022 11:43 — forked from napcs/.vimrc
Set up Vim on Mac, Linux, or Windows. For Mac and Linux: sh <(curl -s https://gist.githubusercontent.com/napcs/532968/raw/vim.sh)
if has('win32') || has ('win64')
let $VIMHOME = $HOME."/Dropbox/dotfiles/.vim"
if !empty($CONEMUBUILD)
set term=xterm
set t_Co=256
let &t_AB="\e[48;5;%dm"
let &t_AF="\e[38;5;%dm"
endif
@morristech
morristech / build.gradle
Created April 22, 2022 07:16 — forked from medvedev/build.gradle
Gradle task that prints total dependencies size and (dependency+(size in kb)) list sorted by size desc
...
/* Tested with Gradle 6.3 */
tasks.register("depsize") {
description = 'Prints dependencies for "default" configuration'
doLast() {
listConfigurationDependencies(configurations.default)
}
}
@morristech
morristech / submit.md
Created April 12, 2022 07:00 — forked from tanaikech/submit.md
Examples of How to Derive a Signing Key for Signature Version 4 (AWS) for Google Apps Script

Examples of How to Derive a Signing Key for Signature Version 4 (AWS) for Google Apps Script

This is a sample script for "Examples of How to Derive a Signing Key for Signature Version 4" using Google Apps Script.

In order to use AWS SDKs, there are the sample scripts for the languages of Java, .NET (C#), Python, Ruby, JavaScript (Node.js). But the sample script of Google Apps Script is not prepared. I saw the question related to this at Stackoverflow. So I would like to also introduce the sample script here.

In the sample scripts, the input values are as follows.

key = 'wJalrXUtnFEMI/K7MDENG+bPxRfiCYEXAMPLEKEY'
@morristech
morristech / apksigner.sh
Created April 12, 2022 07:00 — forked from masablo/apksigner.sh
How to make a signed .apk file
https://nikkeidevs.slack.com/archives/D4Z8TJSJV/p1591077590002400
# 1. install Android Studio from https://developer.android.com/studio/?hl=ja
# 2. add PATH for the Android SDK
cat << 'EOS' >> ~/.zshrc
export ANDROID_HOME=$HOME/Library/Android/sdk
export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/tools/bin
export PATH=$PATH:$ANDROID_HOME/platform-tools
@morristech
morristech / gpg_git_signing.md
Created April 5, 2022 15:07 — forked from alopresto/gpg_git_signing.md
Steps to enable GPG signing of git commits.

If anyone is interested in setting up their system to automatically (or manually) sign their git commits with their GPG key, here are the steps:

  1. Generate and add your key to GitHub
  2. $ git config --global commit.gpgsign true ([OPTIONAL] every commit will now be signed)
  3. $ git config --global user.signingkey ABCDEF01 (where ABCDEF01 is the fingerprint of the key to use)
  4. $ git config --global alias.logs "log --show-signature" (now available as $ git logs)
  5. $ git config --global alias.cis "commit -S" (optional if global signing is false)
  6. $ echo "Some content" >> example.txt
  7. $ git add example.txt
  8. $ git cis -m "This commit is signed by a GPG key." (regular commit will work if global signing is enabled)
@morristech
morristech / 1-setup.md
Created February 28, 2022 21:40 — forked from troyfontaine/1-setup.md
Signing your Git Commits using GPG on MacOS Sierra/High Sierra

Methods of Signing with GPG

Last updated March 28, 2021

There are now two ways to approach this:

  1. Using gpg and generating keys
  2. Using Kryptonite by krypt.co

This Gist explains how to do this using gpg in a step-by-step fashion. Kryptonite is actually wickedly easy to use-but you will still need to follow the instructions

@morristech
morristech / laptop_setup_v2.md
Created February 22, 2022 18:30 — forked from TomasBeuzen/laptop_setup_v2.md
Steps taken when setting up my MacBook Air (M1)

New Mac Setup

This gist documents the setup of my Mac, primarily for personal use and data science.

Hardware/software details:

  • MacBook Air (M1, 2020)
  • Big Sur (11.2.2)

Installs

  • Install HomeBrew