Skip to content

Instantly share code, notes, and snippets.

View ashley-figueira's full-sized avatar
🇵🇹

Ashley Figueira ashley-figueira

🇵🇹
View GitHub Profile
@andkulikov
andkulikov / LazyTimeGraph.kt
Last active July 27, 2023 08:53
Code from the "Thinking outside the Box: Custom Compose layouts" Droidcon London 2022 talk https://www.droidcon.com/2022/11/16/thinking-outside-the-box-custom-compose-layouts/
import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.foundation.clipScrollableContainer
import androidx.compose.foundation.gestures.Orientation
import androidx.compose.foundation.gestures.ScrollableState
import androidx.compose.foundation.gestures.scrollable
import androidx.compose.foundation.lazy.layout.LazyLayout
import androidx.compose.foundation.lazy.layout.LazyLayoutItemProvider
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
@tomaszpolanski
tomaszpolanski / logging.kt
Last active February 7, 2021 15:24
RxLogging
@file:Suppress("NOTHING_TO_INLINE")
import android.util.Log
import io.reactivex.*
inline fun <reified T> printEvent(tag: String, success: T?, error: Throwable?) =
when {
success == null && error == null -> Log.d(tag, "Complete") /* Only with Maybe */
success != null -> Log.d(tag, "Success $success")
error != null -> Log.d(tag, "Error $error")
@adhipg
adhipg / countries.sql
Created January 12, 2012 11:41
Sql dump of all the Countries, Country Codes, Phone codes.
CREATE TABLE IF NOT EXISTS `country` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`iso` char(2) NOT NULL,
`name` varchar(80) NOT NULL,
`nicename` varchar(80) NOT NULL,
`iso3` char(3) DEFAULT NULL,
`numcode` smallint(6) DEFAULT NULL,
`phonecode` int(5) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;