Skip to the relevant sections if needed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For troubleshooting, two things to first try: | |
run `git config --global gpg.program gpg2`, to make sure git uses gpg2 and not gpg | |
run `echo "test" | gpg2 --clearsign`, to make sure gpg2 itself is working | |
If that all looks all right, one next thing to try: | |
run `brew install pinentry` to ensure you have a good tool installed for passphrase entry | |
If after that install and you re-try git commit and still get the "failed to sign the data" error: | |
run `gpgconf --kill gpg-agent` to kill any running agent that might be hung |
Last updated March 13, 2024
This Gist explains how to sign commits using gpg in a step-by-step fashion. Previously, krypt.co was heavily mentioned, but I've only recently learned they were acquired by Akamai and no longer update their previous free products. Those mentions have been removed.
Additionally, 1Password now supports signing Git commits with SSH keys and makes it pretty easy-plus you can easily configure Git Tower to use it for both signing and ssh.
For using a GUI-based GIT tool such as Tower or Github Desktop, follow the steps here for signing your commits with GPG.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
abstract class AnkoRecyclerViewAdapter<Model : Any, AnkoView : AnkoComponent<ViewGroup>, ViewHolder : RecyclerView.ViewHolder> : RecyclerView.Adapter<ViewHolder>() { | |
abstract val data: List<Model> // Data list | |
abstract val ankoView: AnkoView // Layout as AnkoComponent<ViewGroup> | |
abstract fun ViewHolder.setup(model: Model) // setup model from ViewHolder | |
abstract val onItemClickListenerUnit: (Model) -> Unit // Item Click Listener | |
override fun onBindViewHolder(holder: ViewHolder, position: Int) { | |
holder.setup(data[position]) | |
holder.itemView.setOnClickListener { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[{ | |
"name": "AC" | |
}, { | |
"name": "AC PROPULSION" | |
}, { | |
"name": "ACURA" | |
}, { | |
"name": "A.D. TRAMONTANA" | |
}, { | |
"name": "ALFA ROMEO" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Using WebView Accompanist library | |
// implementation "com.google.accompanist:accompanist-webview:<version>" | |
import android.graphics.Bitmap | |
import android.util.Log | |
import android.webkit.WebView | |
import androidx.compose.foundation.layout.* | |
import androidx.compose.foundation.text.BasicTextField | |
import androidx.compose.material.* | |
import androidx.compose.material.icons.Icons |