Skip to content

Instantly share code, notes, and snippets.

View jokamjohn's full-sized avatar
🏠
Working from home

John Kagga jokamjohn

🏠
Working from home
View GitHub Profile
@jokamjohn
jokamjohn / README.md
Created January 16, 2018 20:37 — forked from CodingDoug/README.md
Building an assistant (chatbot) that translates languages, integrated with Slack
@jokamjohn
jokamjohn / firesheetz.ts
Created December 11, 2017 05:20 — forked from CodingDoug/README.md
Copying data from Firebase Realtime Database to a Google Sheet in real time via Cloud Functions
// 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,
@jokamjohn
jokamjohn / bootstrap-nav-profile-pic.css
Created November 19, 2017 17:54 — forked from matthewhartstonge/bootstrap-nav-profile-pic.css
Bootstrap Navbar Profile CSS with HTML Example
/* Bootstrap Navbar Profile Picture CSS
*
* The CSS for profile pictures in the navbar has always annoyed me,
* so here's my fix that appears to have the least hoops.
*
* Production use:
* >Add a div with the specified class.
* >Using JS, change the profile picture CSS URL as needed.
*
* HTML example:
@jokamjohn
jokamjohn / Android Privacy Policy Template
Created November 12, 2017 08:59 — forked from alphamu/Android Privacy Policy Template
A template for creating your own privacy policy for Android apps. Look for "[" and "<!--" to see where you need to edit this app in order to create your own privacy olicy.
<html>
<body>
<h2>Privacy Policy</h2>
<p>[Individual or Company Name] built the [App Name] app as a [open source | free | freemium | ad-supported | commercial] app. This SERVICE is provided by [Individual or company name] [at no cost] and is intended
for use as is.</p>
<p>This page is used to inform website visitors regarding [my|our] policies with the collection, use, and
disclosure of Personal Information if anyone decided to use [my|our] Service.</p>
<p>If you choose to use [my|our] Service, then you agree to the collection and use of information in
relation with this policy. The Personal Information that [I|we] collect are used for providing and
improving the Service. [I|We] will not use or share your information with anyone except as described
@jokamjohn
jokamjohn / gist:0c1c86c4728f9f529651ba6c029c5797
Created January 12, 2017 15:28 — forked from samkirton/gist:0242ba81d7ca00b475b9
Fixed a bug where images added to the MediaStore are not inserted at the front of the gallery
package com.memtrip;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.OutputStream;
import android.content.ContentResolver;
import android.content.ContentUris;
import android.content.ContentValues;
import android.graphics.Bitmap;
@jokamjohn
jokamjohn / snippet.java
Created January 12, 2017 14:40 — forked from xaf-cv/snippet.java
Click&Hold detection through View.OnTouchListener()
View.OnTouchListener detectClickAndHoldListener = new View.OnTouchListener() {
private Timer timer = new Timer();
private long LONG_PRESS_TIMEOUT = 1337; // TODO: your timeout here
private boolean wasLong = false;
@Override
public boolean onTouch(View v, MotionEvent event) {
Log.d(getClass().getName(), "touch event: " + event.toString());
@jokamjohn
jokamjohn / index.php
Created December 30, 2016 17:32 — forked from drizzentic/index.php
Sample USSD Application
<!-- MIT License
Copyright (c) 2016 Derrick Rono
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@jokamjohn
jokamjohn / WaitForInitialValue.java
Created December 30, 2016 16:23 — forked from puf/WaitForInitialValue.java
Waiting for an initial value
public class Main {
static ValueEventListener mListener;
public static void main(String[] args) throws Exception {
Firebase ref = new Firebase("https://<your-app>.firebaseio.com/");
mListener = ref.addValueEventListener(new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot snapshot) {
if (snapshot.exists()) {
System.out.println("The value is now "+snapshot.getValue());
@jokamjohn
jokamjohn / MapStyleManager.java
Created November 7, 2016 19:57 — forked from josh-burton/MapStyleManager.java
MapStyleManager - Google Map Styles per zoom level
public final class MapStyleManager implements GoogleMap.OnCameraMoveListener {
private final Context context;
private final GoogleMap map;
private final GoogleMap.OnCameraMoveListener onCameraMoveListener;
private final TreeMap<Float, Integer> styleMap = new TreeMap<>();
@RawRes
private int currentMapStyleRes = 0;
@jokamjohn
jokamjohn / Full Stack JavaScript.md
Created October 10, 2016 03:04 — forked from m0n01d/Full Stack JavaScript.md
Learn Full Stack JavaScript Web Development for FREE using resources like YouTube, Udacity and NodeSchool