Skip to content

Instantly share code, notes, and snippets.

View johnnylambada's full-sized avatar

John Lombardo johnnylambada

View GitHub Profile
class LoginActivity : AppCompatActivity() {
private val vm: LoginViewModel by viewModels()
private lateinit var binding: ActivityLoginBinding
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
binding = ActivityLoginBinding.inflate(layoutInflater)
setContentView(binding.root)
@johnnylambada
johnnylambada / AnkoRecyclerViewAdapter.kt
Created December 17, 2018 19:14 — forked from HarryTylenol/AnkoRecyclerViewAdapter.kt
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 {
@johnnylambada
johnnylambada / Alerts.java
Created November 17, 2015 02:57
An approach for dealing with Marshmallow permissions
package base.util;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
import app.R;
import retrofit.RetrofitError;
import retrofit.mime.TypedByteArray;
@johnnylambada
johnnylambada / README.md
Last active December 17, 2015 23:08
rails + heroku + postgress + devise

rails + heroku + postgress + devise

This is how I actually got all this stuff to work together. It'll attrophy over time but as of June 2013 it works. Maybe I'll keep it up to date.

-- john@lombardos.org

On the shoulders...

Generally, this document is a a mashup of the following tutorials and pages...

@johnnylambada
johnnylambada / heroku_django.md
Last active December 16, 2015 22:09
heroku + Django + tutorials

Django + Heroku + Django_tutorials + S3

This is how I actually got all this stuff to work together. It'll attrophy over time but as of May 2013 it works. Maybe I'll keep it up to date.

-- john@lombardos.org

On the shoulders...

Generally, this document is a a mashup of the following tutorials.