Skip to content

Instantly share code, notes, and snippets.

@dnnyg33
dnnyg33 / Epoxy Model template
Last active May 26, 2020 18:18
A file template for creating an epoxy model
package ${PACKAGE_NAME}
import android.view.View
import com.airbnb.epoxy.EpoxyHolder
import com.airbnb.epoxy.EpoxyModelWithHolder
class ${NAME} : EpoxyModelWithHolder<${NAME}.ViewHolder>() {
inner class ViewHolder : KotlinEpoxyHolder() {
val title: TextView by bind(R.id.title)
}
@dnnyg33
dnnyg33 / Kotlin View Template
Last active March 23, 2020 18:17
File template for Kotlin Custom view
import android.content.Context
import android.util.AttributeSet
import android.view.LayoutInflater
import android.widget.FrameLayout
import com.tengentllc.scripturegames.R
class ${NAME}(context: Context, attrs: AttributeSet?) : FrameLayout(context, attrs) {
constructor(context: Context) : this(context, null)
init {
@dnnyg33
dnnyg33 / Abstract EpoxyModel
Last active March 23, 2020 18:12
File template for abstract EpoxyModel with KotlinEpoxyHolder
package ${PACKAGE_NAME}
import android.view.View
import com.airbnb.epoxy.EpoxyHolder
import com.airbnb.epoxy.EpoxyModelClass
import com.airbnb.epoxy.EpoxyModelWithHolder
@EpoxyModelClass(layout= R.layout.${LAYOUT_NAME})
abstract class ${NAME}EpoxyModel : EpoxyModelWithHolder<${NAME}EpoxyModel.ViewHolder>() {
@dnnyg33
dnnyg33 / KotlinEpoxyHolder
Last active March 15, 2020 02:15
EpoxyKotlinHolder with context
import android.content.Context
import android.view.View
import com.airbnb.epoxy.EpoxyHolder
import kotlin.properties.ReadOnlyProperty
import kotlin.reflect.KProperty
/**
* A pattern for easier view binding with an [EpoxyHolder]
*
* See [com.airbnb.epoxy.kotlinsample.models.ItemEpoxyHolder] for a usage example.
@dnnyg33
dnnyg33 / pedals.ino
Last active February 18, 2021 11:05
Midi Organ pedalboard arduino sketch
boolean C1 = 1;
boolean CS1 = 1;
boolean D1 = 1;
boolean DS1 = 1;
boolean E1 = 1;
boolean F1 = 1;
boolean FS1 = 1;
boolean G1 = 1;
boolean GS1 = 1;
boolean An1 = 1;//has a lowercase n (stands for note), because it wouldn't compile as A0.
@dnnyg33
dnnyg33 / biblesql.py
Last active March 27, 2017 18:37
convert sql bible file to json
import sqlite3
import json
import argparse
parser = argparse.ArgumentParser(description='Convert bible sql to json')
parser.add_argument('-f', '--file', type=str, help='Full path to input Bible sql file to read', required=True)
parser.add_argument('-o', '--oldTestament', dest='old', action='store_true', help='Output the Old testament')
parser.add_argument('-n', '--newTestament', dest='old', action='store_false', help='Output the New testament')
args = parser.parse_args()
conn = sqlite3.connect(args.file)
@dnnyg33
dnnyg33 / getSuggestedPeople
Last active March 28, 2016 20:22
Sample trees call
{
"suggestedPeople": [{
"Gid": "36178063915:1030:67889983",
"GivenName": "John",
"Surname": "Doe",
"media": {
"namespace": "60905",
"id": "28970e85-bbf3-47c6-be4f-06bcce71a9e9",
"type": "ANCESTRY_MEDIA_ID "
}