Shotgun Surgery
TellDontAsk
Smalltalk by Example: The Developer's Guide
GetterEradicator
Anemic domain model
Don't repeat yourself
Single responsibility principle
Law of Demeter
The Clean Code Talks - Don't Look For Things!
With Great Power Comes Great Responsibility
Waiting In Line To See Star Wars: 1977-2000
Fascinating facts about how we spend the days of our lives
Why Does the Other Line Always Move Faster?: The Myths and Misery, Secrets and Psychology of Waiting in Line
Taming of the Queue
New Research on the Theory of Waiting Lines (Queues), Including the Psychology of Queuing
Why the Java Stack class is bad
How Long People Waited to Be First in Line to Buy Apple Products
[iPhone X: Thousands of Apple
This file contains hidden or 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 BindableAdapter<TYPE : MultiType>(private val list: MutableList<TYPE>) : RecyclerView.Adapter<BindableViewHolder<TYPE>>() { | |
override fun onBindViewHolder( | |
holder: BindableViewHolder<TYPE>, | |
position: Int | |
) = holder.bind(list[position]) | |
override fun getItemViewType(position: Int): Int = list[position].type | |
override fun getItemCount(): Int = list.size | |
} |
This file contains hidden or 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
val world = "World" | |
val spannedText = SpannableString("Hello $world!") | |
spannedText | |
.spanWith(world) { | |
what = BackgroundColorSpan(Color.RED) | |
flags = Spanned.SPAN_EXCLUSIVE_EXCLUSIVE | |
} | |
.spanWith(world) { | |
what = StyleSpan(Typeface.BOLD) | |
flags = Spanned.SPAN_EXCLUSIVE_EXCLUSIVE |
This file contains hidden or 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
# ALIAS | |
# ============= | |
alias ..='cd ..' | |
case `uname` in | |
Darwin) | |
alias flushdns='sudo dscacheutil -flushcache;sudo killall -HUP mDNSResponder;say cache flushed' | |
alias ls='ls -GpF' # Mac OSX specific | |
alias ll='ls -alGpF' # Mac OSX specific | |
;; |
This file contains hidden or 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
@RunWith(Parameterized::class) | |
class KotlinTest(val paramOne: Int, val paramTwo: String) { | |
companion object { | |
@JvmStatic | |
@Parameterized.Parameters | |
fun data() : Collection<Array<Any>> { | |
return listOf( | |
arrayOf(1, "I"), // First test: (paramOne = 1, paramTwo = "I") | |
arrayOf(1999, "MCMXCIX") // Second test: (paramOne = 1999, paramTwo = "MCMXCIX") |