Skip to content

Instantly share code, notes, and snippets.

🏈
Saving the world.

Jerry Okafor jerryOkafor

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
package velasolutions.velabank.services
import android.accessibilityservice.AccessibilityService
import android.accessibilityservice.AccessibilityServiceInfo
import android.content.Context
import android.graphics.PixelFormat
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
jerryOkafor / proguard-rules.pro
Created Feb 18, 2018 — forked from jemshit/proguard-rules.pro
Proguard rules for common Android libraries
View proguard-rules.pro
# 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 (https://gist.github.com/kosiara/487868792fbd3214f9c9)
-keep class rx.schedulers.Schedulers {
public static <methods>;
@jerryOkafor
jerryOkafor / firesheetz.ts
Created Dec 12, 2017 — forked from CodingDoug/README.md
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
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
View download_egghead_videos.md
@jerryOkafor
jerryOkafor / layoutspec_ContactMessageViewSpec.java
Created May 30, 2017
Some Somaple Codes for Chat UI Using facebook Litho
View layoutspec_ContactMessageViewSpec.java
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
jerryOkafor / shoppingcart.py
Created Apr 13, 2017
ShoppingCart.py with two methods to add and remove items and inheritance to for one of the Andela Home Study Exercise.
View shoppingcart.py
class ShoppingCart:
def __init__(self):
self.total = 0
self.items = {}
def add_item(self, item_name, quantity, price):
self.total += price * quantity
self.items.update({item_name: quantity})
def remove_item(self, item_name, quantity, price):
@jerryOkafor
jerryOkafor / isisogram.py
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.
View isisogram.py
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
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",
View StartAtQuery.java
public void querySet(String memberId)
{
Query queryByMember = FirebaseDatabase.getInstance().getReference().child("sets").orderByChild("members/"+memberId).startAt(300);
queryByMember.addValueEventListener(new ValueEventListener() {
@Override
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.