Skip to content

Instantly share code, notes, and snippets.

Avatar

Hamza Fetuga biodunalfet

View GitHub Profile
View MainFragmentViewModel.kt
package com.hf.fichaya.ui.main
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
import com.hf.fichaya.data.di.DIContainer
import com.hf.fichaya.data.local.LocalDataSource
import com.hf.fichaya.data.remote.response.UserData
class MainFragmentViewModel(
val local: LocalDataSource = DIContainer.localDataSource
View dna_sequencing.py
"""A cell's genetic composition determines what it does or the structure it has. An activated gene produces
a messenger RNA which in turn is converted to a peptide in the ribosomal complex. The nucleotide sequence on the gene
can allow us to predict the sequence of amino acid in peptides that is obtained from that gene.
The Template or antisense is the strand that gets transcribed i.e complimentary to mRNA
while the coding and sense refer to the strand that is NOT transcribed i.e similar to mRNA"""
"""This program help to determine the amino acid sequence in a gene whether the user has mRNA, sense DNA
or antisense DNA sequence. Moreover, it can also help in determining the portion of the gene that proteins are obtained
"""
@biodunalfet
biodunalfet / README-Template.md
Last active Mar 10, 2020 — forked from PurpleBooth/README-Template.md
A template to make good README.md
View README-Template.md

Owners

Upseller

This module helps coordinate upsell flows on different pages across the app

The Problem

To upsell a feature on a certain page, one has to be aware of all the other features that are also being tried to be "upsold" on that same page and their timing and implementation logic behind it. In order to reduce this complexity and to prevent the user from being in states where multiple features are being shown to the users at the same time, this module was created

Solution

The upseller module encapsulates the timing and implementation logic into UpSells. Each UpSell contains the following properties and functions:

View rxrx.kt
override fun requestStatement(startDate: String?, endDate: String?, statementType: String, cardLastFourDigits : String?): Single<GenericResponse> {
return localDataStore.getAccessToken().zipWith(localDataStore.getUserData(), BiFunction { t1: String, t2: DataUserData ->
Pair(t1, t2)
}).flatMap {
remoteDataSource.requestStatement(startDate, endDate, statementType, cardLastFourDigits, it.first).map { entity ->
mapper.customMapFromEntity(entity, it.second.EmailAddress)
}
}
}
@biodunalfet
biodunalfet / test_spec.java
Created Jul 24, 2019
Specification for unit test
View test_spec.java
package com.flutterwave.raveandroid.validators;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.*;
View upc.kt
// https://www.codewars.com/kata/568e111353952f6c82000014
fun main(args: Array<String>) {
// print(Character.getNumericValue('5'))
print(UPC("614141000030"))
}
fun UPC(s : String) : Boolean {
//calculate the odd sum
View supermarket.kt
fun price(items : String) : Double {
//split string into items
//store in a map thats maps items to their quantity
//calculate price
val itemsAsList = items.toCharArray().map { it.toString() }
val itemsMap = mutableMapOf<String, Int>()
for (i in itemsAsList) {
val qty = itemsMap.getOrDefault(i, 0)
View coroutines.kt
suspend fun <ResponseType>
makeCall(deferredResponse: Deferred<Response<ResponseType>>): LiveData<Resource<ResponseType>> {
val result = MutableLiveData<Resource<ResponseType>>()
try {
val response = deferredResponse.await()
if (response.isSuccessful) {
@biodunalfet
biodunalfet / barter_t_and_c.md
Last active Oct 7, 2020
Barter Terms and Conditions
View barter_t_and_c.md

Flutterwave's Barter® Terms of Service

Introduction

These Terms and Conditions ("Terms") contained herein on this page is a legal agreement between you, as a prospective customer and or customer of Flutterwave's services and Flutterwave UK Limited (Flutterwave, "we", "our" or "us") and shall govern your access to and use of Flutterwave's services which include all pages within the Flutterwave website, mobile applications and other products and services (collectively referred to

View Url.java
private class MyBrowser extends WebViewClient {
@SuppressWarnings("deprecation")
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
view.loadUrl(url);
return true;
}
@TargetApi(Build.VERSION_CODES.N)
@Override