Skip to content

Instantly share code, notes, and snippets.

:octocat:
Focusing intensifies.

Jan Rabe kibotu

:octocat:
Focusing intensifies.
Block or report user

Report or block kibotu

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
@kibotu
kibotu / throttlesample.kt
Last active Feb 6, 2020
Throttle KeyDown Events from MainActivity using Rx
View throttlesample.kt
class MyActivity : AppCompatActivity() {
private val emitter = KeyEventEmitter()
private var subscription by Delegates.notNull<CompositeDisposable>()
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
View measureTime.kt
inline fun <reified T> measureTime(message: String, min: Long? = null, block: () -> T): T {
val startTime = System.currentTimeMillis()
val result = block()
val blockRuntime = System.currentTimeMillis() - startTime
if (min != null) {
@kibotu
kibotu / MyActivity.java
Created Jan 16, 2020 — forked from Shahbazsultan/MyActivity.java
Keystore android encryption and decryption
View MyActivity.java
public class MyActivity extends AppCompatActivity{
@Override
public void onCreate(Bundle savedInstanceState) {
setcontentView(R.layout.myview);
//To set the encrypted string to keystore
SharedPrefUtils.put(MyActivity.this , "My Key" ,"My keys value");
//To get the decrypted string from keystore
View commits.sh
git log --date=local --pretty=format:'%ad %s' > commits.txt
@kibotu
kibotu / ConnectivityAndInternetAccess.kt
Created Jan 7, 2020 — forked from rodrigosambadesaa/ConnectivityAndInternetAccess.kt
Class to check the Connectivity and Internet Access of an Android device.
View ConnectivityAndInternetAccess.kt
/*
* Copyright (c) 2020 Rodrigo Sambade
*
* 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:
@kibotu
kibotu / AndroidManifest.xml
Created Jan 6, 2020 — forked from brkattk/AndroidManifest.xml
Android Application Setup for use with Charles Proxy
View AndroidManifest.xml
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme"
android:networkSecurityConfig="@xml/network_security_config">
@kibotu
kibotu / README.md
Created Jan 3, 2020
Raspberry PI - External Wifi Storage
View README.md
@kibotu
kibotu / openAppOrMarket.kt
Last active Nov 29, 2019
openAppOrMarket()
View openAppOrMarket.kt
/**
* Open another app.
*
* source: https://stackoverflow.com/a/7596063/1006741
*
* @param packageName the full package name of the app to open
*/
fun Activity.openMainLauncherApp(packageName: String?) = with(packageManager.getLaunchIntentForPackage(packageName!!)!!) {
View gzip_test.sh
#!/bin/bash
URL=$1
PLAIN="$(curl $URL --silent --write-out "%{size_download}\n" --output /dev/null)"
GZIPPED="$(curl $URL --silent -H "Accept-Encoding: gzip,deflate" --write-out "%{size_download}\n" --output /dev/null)"
if test $PLAIN -gt $GZIPPED
then echo "supported"
else echo "unsupported"
fi
@kibotu
kibotu / graph_schema.json
Last active Sep 16, 2019
graph.json schema
View graph_schema.json
{
"definitions": {},
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "http://example.com/root.json",
"type": "object",
"title": "The Root Schema",
"required": [
"nodes",
"edges"
],
You can’t perform that action at this time.