Skip to content

Instantly share code, notes, and snippets.

kuno kuno

Block or report user

Report or block kuno

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
@kuno
kuno / PositionedCropTransformation.java
Created Jun 14, 2019 — forked from bjornson/PositionedCropTransformation.java
Custom Glide CropTransformation that allows top/center/bottom left/center/right crop with percentages
View PositionedCropTransformation.java
package com.extendedvision.futurehistory.images;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Matrix;
import android.graphics.Paint;
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
import androidx.fragment.app.DialogFragment
import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentManager
@kuno
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
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.graphics.drawable.Drawable;
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
kuno / snakecoin-server-full-code.py
Created Feb 25, 2018 — forked from aunyks/snakecoin-server-full-code.py
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.
View snakecoin-server-full-code.py
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
kuno / Dagger2SimpleExample.java
Created Aug 21, 2017 — forked from vestrel00/Dagger2SimpleExample.java
A: Dagger.android 2.11 simple example with support for Singleton, PerActivity, PerFragment, and PerChildFragment scopes
View Dagger2SimpleExample.java
// This is a super simplified example of how to use the new dagger.android framework
// introduced in Dagger 2.10. For a more complete, in-depth guide to dagger.android
// read https://proandroiddev.com/how-to-android-dagger-2-10-2-11-butterknife-mvp-part-1-eb0f6b970fd
// For a complete codebase using dagger.android 2.11, butterknife 8.7, and MVP,
// see https://github.com/vestrel00/android-dagger-butterknife-mvp
// Note that this example uses Dagger 2.11, where @ContributesAndroidInjector was
// introduced removing the need to define @Subcomponent classes.
@kuno
kuno / post.md
Created Jan 26, 2016 — forked from grantland/post.md
RecyclerView item onClick
View post.md

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
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
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
@kuno
kuno / openresty.sh
Last active Dec 31, 2015
Dowloading, building, installing openresty from source
View openresty.sh
#!/bin/bash
VERSION=1.4.3.9
echo '[CMD] Install dependencies'
sudo apt-get install -y libreadline-dev libncurses5-dev libpcre3-dev libssl-dev perl make
echo '[CMD] Downlaod openresty'
wget http://openresty.org/download/ngx_openresty-${VERSION}.tar.gz
echo '[CMD] Build openresty'
You can’t perform that action at this time.