Skip to content

Instantly share code, notes, and snippets.

View zakayothuku's full-sized avatar
👨‍💻
Opportunities don't respect sleep

Zakayo Thuku zakayothuku

👨‍💻
Opportunities don't respect sleep
View GitHub Profile
@zakayothuku
zakayothuku / OnThrottleClickListener.kt
Created June 8, 2020 20:58 — forked from matpag/OnThrottleClickListener.kt
ThrottleClickListener prevent double click using OnClickListener
import android.os.SystemClock
import android.view.View
/**
* This is a custom clicklistener to prevent multiple click events to happens at the same time.
*
* Each click on a button is added in the internal event handler queue, there is no way to remove
* them from there so the only thing we can do is adding a filter to prevent them to run too
* frequently
*
@zakayothuku
zakayothuku / XposedUtils.java
Created November 8, 2019 11:30 — forked from jaredrummler/XposedUtils.java
Utility methods for checking if the Xposed framework is installed.
/*
* Copyright (C) 2016 Jared Rummler <[email protected]>
*
* 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@zakayothuku
zakayothuku / pagination.js
Last active May 8, 2019 09:46 — forked from proudlygeek/pagination.js
Pagination Helper Kata
// http://www.codewars.com/kata/515bb423de843ea99400000a/train/javascript
// TODO: complete this object/class
// The constructor takes in an array of items and a integer indicating how many
// items fit within a single page
function PaginationHelper(collection, itemsPerPage){
this.collection = collection;
this.itemsPerPage = itemsPerPage;
}