Skip to content

Instantly share code, notes, and snippets.

kuno /
Created Jun 14, 2019 — forked from bjornson/
Custom Glide CropTransformation that allows top/center/bottom left/center/right crop with percentages
package com.extendedvision.futurehistory.images;
import android.content.Context;
import com.bumptech.glide.load.engine.bitmap_recycle.BitmapPool;
import com.bumptech.glide.load.resource.bitmap.BitmapTransformation;
View DialogNavigator.kt
package com.geekorum.geekdroid.navigation
import android.content.Context
import android.os.Bundle
import android.util.AttributeSet
import androidx.core.content.res.use
import androidx.core.os.bundleOf
kuno / build.gradle
Created Feb 25, 2019 — forked from pocmo/build.gradle
(Android) Gradle: Copy native libraries into final APK
View build.gradle
// Tested with gradle 1.7 and android plugin 0.5.6
// [..] Your gradle build script
// Copy *.so files from libs/ folder of your project to native-libs folder
// Adjust if your native libraries are somewhere else..
task copyNativeLibs(type: Copy) {
from(new File(project(':yourproject').projectDir, 'libs')) { include '**/*.so' }
kuno / CheckableLinearLayout
Created May 1, 2018 — forked from christopherperry/CheckableLinearLayout
A LinearLayout that implements the Checkable interface, allowing a LinearLayout to be put into a checked state.
View CheckableLinearLayout
import android.content.Context;
import android.os.Parcel;
import android.os.Parcelable;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Checkable;
import android.widget.LinearLayout;
kuno /
Created Feb 25, 2018 — forked from aunyks/
The code in this gist isn't as succinct as I'd like it to be. Please bare with me and ask plenty of questions that you may have about it.
from flask import Flask
from flask import request
import json
import requests
import hashlib as hasher
import datetime as date
node = Flask(__name__)
# Define what a Snakecoin block is
class Block:
View name.xml
<string name="purchase">Purchase</string>
<string name="reload">RELOAD</string>
<string name="confirm_reload">Confirm Reload</string>
<string name="extension_fee">Extension Fee</string>
<string name="transferred_cancel_reload">Cancel Reloading</string>
<string name="transferred_out">Transferred Out</string>
<string name="transferred_in">Transferred In</string>
<string name="transaction_in_store">Store Purchase</string>
<string name="transaction_reload">Reload</string>
<string name="transaction_refund">Refund</string>
kuno /
Created Aug 21, 2017 — forked from vestrel00/
A: 2.11 simple example with support for Singleton, PerActivity, PerFragment, and PerChildFragment scopes
// This is a super simplified example of how to use the new framework
// introduced in Dagger 2.10. For a more complete, in-depth guide to
// read
// For a complete codebase using 2.11, butterknife 8.7, and MVP,
// see
// Note that this example uses Dagger 2.11, where @ContributesAndroidInjector was
// introduced removing the need to define @Subcomponent classes.
kuno /
Created Jan 26, 2016 — forked from grantland/
RecyclerView item onClick

RecyclerView item onClick

RecyclerView does not have an OnItemClickListener like it's predecessor, ListView. However, detecting item clicks is pretty simple.

Set an OnClickListener in your ViewHolder creation:

private class MyAdapter extends RecyclerView.Adapter<MyAdapter.ViewHolder>  {

    public static class ViewHolder extends RecyclerView.ViewHolder
kuno / ToolbarColorizeHelper
Created Jan 10, 2016 — forked from chomi3/ToolbarColorizeHelper
Helper class to colorize all Android Toolbar Icons
View ToolbarColorizeHelper
Copyright 2015 Michal Pawlowski
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
Unless required by applicable law or agreed to in writing, software
kuno / gist:282db62d7784548bfa11
Created Nov 21, 2015 — forked from dodyg/gist:5823184
Kotlin Programming Language Cheat Sheet Part 1
View gist:282db62d7784548bfa11


Kotlin is a new programming language for the JVM. It produces Java bytecode, supports Android and generates JavaScript. The latest version of the language is Kotlin M5.3

Kotlin project website is at

All the codes here can be copied and run on Kotlin online editor.

Let's get started.