Skip to content

Instantly share code, notes, and snippets.

View jerryOkafor's full-sized avatar

Jerry Hanks Okafor jerryOkafor

View GitHub Profile
@CodingDoug
CodingDoug / README.md
Last active November 6, 2022 09:29
Example code from the video "Use async/await with TypeScript in Cloud Functions"

Example code from the video "Use async/await with TypeScript in Cloud Functions"

This is the example code from my video about using async/await with Cloud Functions. I've placed it here in a gist so it's easier to compare the "before" and "after" states for each case.

Watch the video here

The code in this project is licensed under the Apache License 2.0.

Copyright 2018 Google LLC
@CodingDoug
CodingDoug / README.md
Last active December 17, 2022 10:23
Copying data from Firebase Realtime Database to a Google Sheet in real time via Cloud Functions
@jerryOkafor
jerryOkafor / shoppingcart.py
Created April 13, 2017 07:40
ShoppingCart.py with two methods to add and remove items and inheritance to for one of the Andela Home Study Exercise.
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 April 11, 2017 19:54
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
@jemshit
jemshit / proguard-rules.pro
Last active November 10, 2024 16:50
Proguard Rules for 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 (https://gist.github.com/kosiara/487868792fbd3214f9c9)
-keep class rx.schedulers.Schedulers {
public static <methods>;
@burdenless
burdenless / implement_breadth_first_search.js
Created July 2, 2016 05:23
Khan Academy BFS Implementation - Completed ✅
/* A Queue object for queue-like functionality over JavaScript arrays. */
var Queue = function() {
this.items = [];
};
Queue.prototype.enqueue = function(obj) {
this.items.push(obj);
};
Queue.prototype.dequeue = function() {
return this.items.shift();
};
@jerryOkafor
jerryOkafor / FileChooser.java
Created April 23, 2016 09:04
This gist is to enable you select, or choose a file, stringfy it and uplaod to server
package com.dipoletech.unnmobile;
import android.app.Activity;
import android.content.ComponentName;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.pm.ResolveInfo;
import android.database.Cursor;
import android.graphics.Color;
@andrius
andrius / tts.sh
Last active June 8, 2022 17:27
Quick and dirty IVR sounds for your Asterisk PBX
#!/bin/bash
#title : tts.sh
#description : This script will convert text to speech using Google translate API
# and then to Asterisk formats (wav, sln, gsm)
#
#author : Andrius Kairiukstis <[email protected]>
#date : 26 July 2013
#version : 0.1
#usage : bash tts.sh FILENAME VOICE PHRASE