Skip to content

Instantly share code, notes, and snippets.

@stevdza-san
stevdza-san / WebBrowser.kt
Created June 22, 2022 10:16
Web Browser Application using Jetpack Compose
// 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
@pimatco
pimatco / carbrands.json
Created April 17, 2018 14:13
All Car Brands in the world in JSON
[{
"name": "AC"
}, {
"name": "AC PROPULSION"
}, {
"name": "ACURA"
}, {
"name": "A.D. TRAMONTANA"
}, {
"name": "ALFA ROMEO"
@HarryTylenol
HarryTylenol / AnkoRecyclerViewAdapter.kt
Last active April 11, 2022 21:29
Make RecyclerView with Anko Like Pro
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 {
@troyfontaine
troyfontaine / 1-setup.md
Last active June 8, 2024 22:21
Signing your Git Commits on MacOS

Methods of Signing Git Commits on MacOS

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.

@cezaraugusto
cezaraugusto / gpg_fix.txt
Last active November 3, 2023 17:03
fixing `gpg failed to sign data` error on macOS
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
@lopspower
lopspower / README.md
Last active June 12, 2024 11:01
Hexadecimal color code for transparency

Hexadecimal color code for transparency

Twitter

How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

Download This sample on Google Play Store