Skip to content

Instantly share code, notes, and snippets.

View biodunalfet's full-sized avatar

Hamza Fetuga biodunalfet

View GitHub Profile
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

Privacy Policy

Hamza Fetuga built the UssdOne app as an Ad Supported app. This SERVICE is provided by Hamza Fetuga at no cost and is intended for use as is.

This page is used to inform visitors regarding my policies with the collection, use, and disclosure of Personal Information if anyone decided to use my Service.

If you choose to use my Service, then you agree to the collection and use of information in relation to this policy. The Personal Information that I collect is used for providing and improving the Service. I will not use or share your information with anyone except as described in this Privacy Policy.

The terms used in this Privacy Policy have the same meanings as in our Terms and Conditions, which is accessible at UssdOne unless otherwise defined in this Privacy Policy.

@biodunalfet
biodunalfet / Interceptor.java
Created January 15, 2019 06:26 — forked from alex-shpak/Interceptor.java
Refreshing OAuth token with okhttp interceptors. All requests will wait until token refresh finished, and then will continue with the new token.
private class HttpInterceptor implements Interceptor {
@Override
public Response intercept(Chain chain) throws IOException {
Request request = chain.request();
//Build new request
Request.Builder builder = request.newBuilder();
builder.header("Accept", "application/json"); //if necessary, say to consume JSON
@biodunalfet
biodunalfet / Interceptor.java
Created January 15, 2019 06:26 — forked from alex-shpak/Interceptor.java
Refreshing OAuth token with okhttp interceptors. All requests will wait until token refresh finished, and then will continue with the new token.
private class HttpInterceptor implements Interceptor {
@Override
public Response intercept(Chain chain) throws IOException {
Request request = chain.request();
//Build new request
Request.Builder builder = request.newBuilder();
builder.header("Accept", "application/json"); //if necessary, say to consume JSON
@biodunalfet
biodunalfet / MultipleViewholders.kt
Last active January 5, 2019 16:38
Fastadapter quick samples
package com.hf.ussdone.data
import android.annotation.SuppressLint
import android.support.v4.content.ContextCompat
import android.view.View
import com.hf.ussdone.R
import com.mikepenz.fastadapter.FastAdapter
import com.mikepenz.fastadapter.items.AbstractItem
import kotlinx.android.synthetic.main.base_cat_list_item.view.*
import kotlinx.android.synthetic.main.fave_cat_item.view.*
@biodunalfet
biodunalfet / Fastfile
Created June 21, 2018 03:57 — forked from polbins/Fastfile
Fastlane script for Uploading to Slack and Play Store Alpha
default_platform :android
platform :android do
before_all do
ENV["SLACK_URL"] = "https://hooks.slack.com/services/ABC/123/XYZ"
end
######################### PUBLIC LANES #########################
desc "Deploy a new Prod APK version to Play Store Alpha"
tagmanager.accounts.containers.triggers.create(
{
accountId : accountId,
containerId : containerId,
name : "First Trigger",
type : "customEvent",
eventName: {
type: "template",
value: "firstTrigger"
}
// REQUEST BODY IN API EXPLORER
{
"accountId": "526400647",
"containerId": "2678459",
"name": "trigger1",
"type": "customEvent",
"triggerId": "3",
"eventName": {
"key": "eventName",
var functions = require('firebase-functions');
var admin = require('firebase-admin');
admin.initializeApp(functions.config().firebase);
exports.sendNotificationOnEventComment
= functions.database.ref('/eventComments/{eventUid}/{eventCommentUid}').onWrite(event => {
if (event.data.exists()) {
var eventUid = event.params.eventUid;
{
"dfsdfs" : {
"ingredients" : [ {
"name" : "olive oil",
"quantity" : "5",
"unit" : "teaspoons"
}, {
"explanation" : "cut into thin strips",
"name" : "large onion",
"quantity" : "1"