The History of New Year’s Resolutions
SMART criteria
Jerry Seinfeld's Productivity Secret
BUPA NEW YEAR RESOLUTION SURVEY
New Year Survey Conducted by YouGov
How Long Does it Actually Take to Form a New Habit? (Backed by Science)
The Guide to Habits
What Gets Measured Gets Done. Or Does It?
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
private val LocalStore: ProvidableCompositionLocal<Store<*>> = compositionLocalOf { error("Store not provided") } | |
@Composable | |
fun <STATE : State> StoreProvider(store: Store<STATE>, content: @Composable Store<STATE>.() -> Unit) { | |
CompositionLocalProvider(LocalStore provides store) { | |
store.content() | |
} | |
} | |
@Composable |
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
class WindowInsetsFrameLayout @JvmOverloads constructor( | |
context: Context, | |
attrs: AttributeSet? = null, | |
defStyleAttr: Int = 0 | |
) : FrameLayout(context, attrs, defStyleAttr) { | |
init { | |
setOnHierarchyChangeListener(object : OnHierarchyChangeListener { | |
override fun onChildViewAdded( | |
parent: View, |
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
class LineView @JvmOverloads constructor( | |
context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0 | |
) : View(context, attrs, defStyleAttr) { | |
companion object { | |
const val ORIENTATION_VERTICAL = 0 | |
const val ORIENTATION_HORIZONTAL = 1 | |
private const val DEFAULT_ORIENTATION = ORIENTATION_HORIZONTAL |
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
@DslMarker | |
annotation class HorizontalSelectorGroups | |
interface HorizontalSelectorHelper { | |
fun groups(block: GroupsBuilder.() -> Unit): List<Pair<Header, List<Item>>> = GroupsBuilder().apply(block).build() | |
@HorizontalSelectorGroups | |
class GroupsBuilder { | |
private val groups = mutableListOf<Group>() |
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
import android.graphics.* | |
import android.view.* | |
import android.view.MotionEvent.ACTION_DOWN | |
import androidx.recyclerview.widget.RecyclerView | |
class StickyHeaderItemDecoration( | |
parent: RecyclerView, | |
private val isHeader: (position: Int) -> Boolean | |
) : RecyclerView.ItemDecoration() { |
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
#!/bin/sh | |
if [ -z "$1" ]; then | |
echo Delete all Darktable rejected pictures | |
echo | |
echo "Usage:" | |
echo $0 [source] --onestar to delete also all pictures with one star rating | |
exit 1 | |
fi |
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
inline infix fun <reified T : Any> T?.reduce(other: T?): T? = when { | |
this == null && other == null -> null | |
this != null && other == null -> this | |
this == null && other != null -> other | |
else -> { | |
val nameToProperty = T::class.declaredMemberProperties.associateBy { property -> property.name } | |
val primaryConstructor = T::class.primaryConstructor!! | |
val args = primaryConstructor.parameters.associate { parameter -> | |
val property = nameToProperty[parameter.name]!! |
Arduino misconceptions 4: the Arduino is obsolete now the Raspberry Pi exists
10 Ways to Destroy An Arduino
Arduino vs. Raspberry Pi - Which is best?
Comparison of ESP8266 NodeMCU development boards
General-purpose input/output
DIY-Bitcoin-Ticker repository
10 Arduino IDE alternative to start programming