Skip to content

Instantly share code, notes, and snippets.

Saving the world.

Jerry Okafor jerryOkafor

Saving the world.
Block or report user

Report or block jerryOkafor

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View USSDService
import android.accessibilityservice.AccessibilityService
import android.accessibilityservice.AccessibilityServiceInfo
import android.content.Context
import android.os.Build
import android.util.Log
import android.view.Gravity
import android.view.LayoutInflater
View Listing.kt
* Data class that is necessary for a UI to show a listing and interact w/ the rest of the system
data class Listing<T>(
// the LiveData of paged lists for the UI to observe
val pagedList: LiveData<PagedList<T>>,
// represents the network request status to show to the user
val networkState: LiveData<NetworkState>,
// represents the refresh status to show to the user. Separate from networkState, this
// value is importantly only when refresh is requested.
jerryOkafor /
Created Feb 18, 2018 — forked from jemshit/
Proguard rules for common Android libraries
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
-keepclassmembers class fqcn.of.javascript.interface.for.webview {
public *;
### RxJava, RxAndroid (
-keep class rx.schedulers.Schedulers {
public static <methods>;
jerryOkafor / firesheetz.ts
Created Dec 12, 2017 — forked from CodingDoug/
Copying data from Firebase Realtime Database to a Google Sheet in real time via Cloud Functions
View firesheetz.ts
// Copyright 2017 Google LLC.
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
jerryOkafor /
Created May 30, 2017
Some Somaple Codes for Chat UI Using facebook Litho
package com.pacentltd.smartalumni.layoutspec;
import com.facebook.drawee.backends.pipeline.Fresco;
import com.facebook.drawee.drawable.ScalingUtils;
import com.facebook.drawee.generic.RoundingParams;
import com.facebook.drawee.interfaces.DraweeController;
import com.facebook.imagepipeline.common.ResizeOptions;
import com.facebook.imagepipeline.request.ImageRequest;
import com.facebook.imagepipeline.request.ImageRequestBuilder;
import com.facebook.litho.Column;
jerryOkafor /
Created Apr 13, 2017 with two methods to add and remove items and inheritance to for one of the Andela Home Study Exercise.
class ShoppingCart:
def __init__(self): = 0
self.items = {}
def add_item(self, item_name, quantity, price): += price * quantity
self.items.update({item_name: quantity})
def remove_item(self, item_name, quantity, price):
jerryOkafor /
Last active Apr 11, 2017
A function that check if a word is an Isogram, returns the boolean indicator and the turple of the word, raise a TyepError if the argument is not a string with a message "Argument should be a string", returns the argument and false if the argument is empty.
def is_iso(word):
if not type(word) is str:
raise TypeError("Argument should be a string")
if len(word) == 0:
return word, False
word = word.lower()
for char in word:
if word.count(char) > 1:
return tuple(word), False
return tuple(word), True
jerryOkafor / sets.json
Created Dec 3, 2016
This is a sample .json data for my blog post.
View sets.json
"-KXAlZM_-wGb6VtDWaXi" : {
"members" : {
"93O9tc5SebdZEOtei8tiTN8JQRt2" : 100,
"KUwDuuo9zqR0EfAQD5DdGMI3MnS2" : 200,
"L9qJXkjvsfRLip5Awg0yhJLcmJb2" : 500
"schId" : "-KXAlZMY1cwVaekwtqm2",
"schName" : "University of Nigeria Nsukka",
"setAdmin" : "KUwDuuo9zqR0EfAQD5DdGMI3MnS2",
public void querySet(String memberId)
Query queryByMember = FirebaseDatabase.getInstance().getReference().child("sets").orderByChild("members/"+memberId).startAt(300);
queryByMember.addValueEventListener(new ValueEventListener() {
public void onDataChange(DataSnapshot dataSnapshot) {
//Not that we are returning a list as our query is on sets
//so iterate through the datasnapshot and get the values
for (DataSnapshot data : dataSnapshot.getChildren())
You can’t perform that action at this time.