Skip to content

Instantly share code, notes, and snippets.

View donglua's full-sized avatar
😎
Haha

鲁大师 donglua

😎
Haha
View GitHub Profile
@donglua
donglua / adb.go
Last active February 7, 2018 16:32
adb_tools
package adb_tools
import (
"fmt"
"log"
"os/exec"
"strings"
)
func RunAdb(args ...string) {
### Keybase proof
I hereby claim:
* I am donglua on github.
* I am donglua (https://keybase.io/donglua) on keybase.
* I have a public key ASC0uWQWVisv533-0eaRZJw39kRpmkBbCKWwkbiKiUhi9Qo
To claim this, I am signing this object:
@donglua
donglua / gist:ed18540c9742f9c7b189d9cb33bd53a7
Created February 4, 2017 07:33
Remove gitignore files
git rm --cached `git ls-files -i --exclude-from=.gitignore`
@donglua
donglua / kotlin_constructor.md
Last active October 20, 2016 03:37
Kotlin 的构造方法参数
class MyClass
constructor(
    private val value1: Int,
    var value2: String,
    value3: Int,
)
  • 这里的 private val value1: Int表示传入参数 value1 并赋值给命名为 value1 的成员变量
  • value3 参数只在构造方法中使用
@donglua
donglua / GlideImageGetter
Last active April 30, 2018 08:22 — forked from AndroidT/GlideImageGetter
GlideImageGetter uses Glide Image Library to load GIFs/JPG/PNG in HTML <img> tags into TextView
import android.content.Context;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.text.Html;
import android.view.View;
import android.widget.TextView;
import com.bumptech.glide.Glide;
@donglua
donglua / Android Lollipop Widget Tinting Guide
Created November 15, 2015 09:39 — forked from seanKenkeremath/Android Lollipop Widget Tinting Guide
How base colors in Lollipop apply to different UI elements
Unless specified otherwise, all of the below tinting applies to both Lollipop and pre-Lollipop using AppCompat v21. To use the support version of these attributes, remove the android namespace. For instance, "android:colorControlNormal" becomes "colorControlNormal". These attributes will be propagated to their corresponding attributes within the android namespace for devices running Lollipop. Any exceptions to this will be noted by including the "android:" prefix.
All Clickable Views:
-----------
* ripple effect (Lollipop only) -- "colorControlHighlight"
Status Bar:
------------
* background (Lollipop only) - "colorPrimaryDark"
@donglua
donglua / EmptyRecyclerView.java
Last active August 29, 2015 14:27 — forked from meoyawn/EmptyRecyclerView.java
RecyclerView doesn't have an emptyView support, we gotta fix that
import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.util.AttributeSet;
import android.view.View;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
public class EmptyRecyclerView extends RecyclerView {
@Nullable View emptyView;
rails new demo --skip-test-unit
bundle install
rails server