Skip to content

Instantly share code, notes, and snippets.

View chepsi's full-sized avatar

Evans Chepsiror chepsi

View GitHub Profile
E FATAL EXCEPTION: main
Process: ke.safaricom.mpesa.lifestyle.uat, PID: 17817
java.lang.RuntimeException: Unable to create application com.safaricom.mpesa.consumerapp.MPesaApplication: io.realm.exceptions.RealmMigrationNeededException: Migration is required due to the following errors:
- Class 'GsmProductsCatalogPackageRealm' has been added.
- Class 'GsmProductsCatalogProductRealm' has been added.
- Property 'ConsumerUserRealm.requiresNewPin' has been added.
@chepsi
chepsi / gist:2f83b85bbcab08bbc35feba158fd43b2
Created April 23, 2024 09:33
Android254 Canvas Logo.
@Composable
fun InstagramLogo() {
Canvas(
modifier = Modifier
.size(200.dp)
.clip(RoundedCornerShape(10.dp))
) {
val width = size.width
val height = size.height
drawRoundRect(brush = InstaGradient)
@chepsi
chepsi / gist:da5225f00882648cf8e26cb30d6809b2
Last active April 26, 2022 11:27
Deploy to Playstore
# This workflow deploys to production
name: Deploy to Production
# The workflow is triggered when a push is made to master
on:
push:
branches: [ main ]
jobs:
build:
@chepsi
chepsi / gist:67b72cd92500f3d37ea65bc3fec82777
Created April 11, 2022 11:39
Apply gradle settings to all submodules/feature-modules.
// Use this in project level gradle
subprojects {
apply from: rootProject.file('tools/jacoco/jacoco.gradle')
afterEvaluate { project ->
// use the line below if you want to apply the config to dynamic features only.
// if (project.plugins.hasPlugin("com.android.dynamic-feature")) {
if (project.hasProperty('android')) {
android.buildFeatures {
viewBinding true
@chepsi
chepsi / callback.kt
Created March 1, 2021 19:13
Network Callback
fun startNetworkCallback() {
val cm: ConnectivityManager =
application.getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager
val builder: NetworkRequest.Builder = NetworkRequest.Builder()
/**Check if version code is greater than API 24*/
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.N) {
cm.registerDefaultNetworkCallback(networkCallback)
} else {
cm.registerNetworkCallback(