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
final MessageDigest md5 = MessageDigest.getInstance("MD5"); | |
final byte[] digest = md5.digest(text.getBytes()); | |
String hash = new String(digest); |
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
private Uri getResourceUri(Resources resources, int resourceID) { | |
return Uri.parse("android.resource://"+resources.getResourcePackageName(resourceID)+"/"+ | |
resources.getResourceTypeName(resourceID) + '/' | |
+ resources.getResourceEntryName(resourceID) ); | |
} |
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
package com.pantos27.someproject.recycler | |
import android.support.annotation.IdRes | |
import android.support.v7.widget.RecyclerView | |
import android.view.View | |
import android.view.ViewGroup | |
import android.widget.ImageView | |
import android.widget.TextView | |
import java.util.* |
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
Picasso.with( context ) | |
.load( your_path ) | |
.error( R.drawable.ic_error ) | |
.placeholder( R.drawable.progress_animation ) | |
.into( image_view ); |
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
package com.pantos27.gist | |
class KotlinView @JvmOverloads constructor( | |
context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0 | |
) : View(context, attrs, defStyleAttr){ | |
init{ | |
//init stuff | |
} | |
} |
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
package com.pantos27.gist | |
import android.os.Bundle | |
import androidx.fragment.app.DialogFragment | |
import androidx.fragment.app.FragmentManager | |
import android.view.LayoutInflater | |
import android.view.View | |
import android.view.ViewGroup | |
import android.view.Window | |
import android.widget.FrameLayout |
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
//https://www.intercom.com/help/en/articles/170-integrate-intercom-in-a-single-page-app | |
const Intercom = { | |
init: (appId) => { | |
console.log("Intercom", "init", appId); | |
const w = window; | |
const ic = w.Intercom; | |
w.intercomSettings = { | |
horizontal_padding: 24, | |
vertical_padding: 24, |
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
package com.example.grayscaleexperiment | |
import android.content.Context | |
import android.graphics.Canvas | |
import android.graphics.ColorMatrix | |
import android.graphics.ColorMatrixColorFilter | |
import android.graphics.Paint | |
import android.util.AttributeSet | |
import androidx.constraintlayout.widget.ConstraintLayout |
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
viewModel.viewState.observe(viewLifecycleOwner) { state -> | |
state takeIfSuccess { | |
// Here's the success state | |
} takeIfError { | |
// Here's the error state | |
} | |
} |
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: deploy-to-qa | |
on: | |
workflow_dispatch: | |
push: | |
tags: [ 'v*' ] | |
jobs: | |
update_qa: | |
runs-on: ubuntu-latest | |
steps: |