Skip to content

Instantly share code, notes, and snippets.

View kuno's full-sized avatar

kuno kuno

View GitHub Profile
@kuno
kuno / custom.css
Created March 18, 2022 03:18 — forked from madawei2699/custom.css
logseq/custom.css
/*
/* Theme custom css start
/* https://raw.githack.com/dracula/logseq/master/custom.css
*/
@import url("https://fonts.googleapis.com/css2?family=Fira+Code:wght@300;400;500;700&family=Fira+Sans:ital,wght@0,300;0,400;0,500;0,700;1,300;1,400;1,500;1,700&display=swap");
:root {
--background: #282a36;
--light-background: #343746;
@kuno
kuno / PositionedCropTransformation.java
Created June 14, 2019 10:28 — forked from bjornson/PositionedCropTransformation.java
Custom Glide CropTransformation that allows top/center/bottom left/center/right crop with percentages
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;
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 February 25, 2019 06:59 — forked from pocmo/build.gradle
(Android) Gradle: Copy native libraries into final APK
// 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 09:16 — forked from christopherperry/CheckableLinearLayout
A LinearLayout that implements the Checkable interface, allowing a LinearLayout to be put into a checked state.
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 February 25, 2018 08:42 — 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.
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:
@kuno
kuno / name.xml
Last active September 21, 2017 10:17
<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 August 21, 2017 18:04 — forked from vestrel00/Dagger2SimpleExample.java
A: Dagger.android 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 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 January 26, 2016 00:46 — forked from grantland/post.md
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
kuno / ToolbarColorizeHelper
Created January 10, 2016 05:40 — forked from chomi3/ToolbarColorizeHelper
Helper class to colorize all Android Toolbar Icons
/*
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