Skip to content

Instantly share code, notes, and snippets.

📉
Down

Tiou Lims douo

Block or report user

Report or block douo

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
View ViewDataBindingFix.kt
package info.dourok.androidx.databinding
import androidx.databinding.ViewDataBinding
import androidx.lifecycle.GenericLifecycleObserver
import androidx.lifecycle.Lifecycle.Event.ON_START
import androidx.lifecycle.LifecycleObserver
import androidx.lifecycle.LifecycleOwner
import java.lang.ref.WeakReference
import java.util.WeakHashMap
View keybase.md

Keybase proof

I hereby claim:

  • I am douo on github.
  • I am douo (https://keybase.io/douo) on keybase.
  • I have a public key ASAQODR5d3WbIv6rb_fA0x5ThgafJdlcrttE9jV8HKu9KQo

To claim this, I am signing this object:

View LambdaTest.class
Classfile ./com/company/LambdaTest.class
Last modified 2017-10-11; size 1296 bytes
MD5 checksum 7ac0bf40633d31a57673577fde0a699d
Compiled from "LambdaTest.java"
public class com.company.LambdaTest
minor version: 0
major version: 52
flags: ACC_PUBLIC, ACC_SUPER
Constant pool:
#1 = Methodref #8.#25 // java/lang/Object."<init>":()V
@douo
douo / capitalizeWord.groovy
Created Aug 19, 2016
IntelliJ LivePlugin script:将当前单词或下一个单词转换为首字母大写
View capitalizeWord.groovy
import com.intellij.openapi.actionSystem.AnActionEvent
import static liveplugin.PluginUtil.*
/**
* 将当前单词或下一个单词转换为首字母大写
*/
registerAction("Capitalize Word", "alt C") { AnActionEvent event ->
runDocumentWriteAction(event.project) {
currentEditorIn(event.project).with {
@douo
douo / HierarchyFragmentPagerAdapter.java
Created Jul 26, 2016
可嵌套使用的 FragmentPagerAdapter 主要修复 FragmentPagerAdapter 处理 {@link Fragment#setMenuVisibility(boolean)} 的 bug
View HierarchyFragmentPagerAdapter.java
/*
* Copyright (C) 2011 The Android Open Source Project
*
* 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
@douo
douo / Vagrantfile
Created Mar 5, 2016
Vagrantfile for my ruhoh writing system
View Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure(2) do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
@douo
douo / FloatingActionMenu.java
Created Jun 23, 2015
FloatingActionMenu build by android support FloatingActionButton
View FloatingActionMenu.java
package com.diaoser.tmr.view;
import android.animation.Animator;
import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.animation.TimeInterpolator;
import android.animation.ValueAnimator;
import android.content.Context;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
@douo
douo / build.gradle
Last active Oct 25, 2017
Android 项目打包成 maven 工件,并发布到 jcenter
View build.gradle
apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'com.jfrog.bintray'
version = "" // 项目的版本名
android {
compileSdkVersion 22
buildToolsVersion '22.0.1'
defaultConfig {
@douo
douo / chinese_id.rb
Last active Sep 27, 2018
Chinese ID card number checksum
View chinese_id.rb
module ChineseId
WEIGHT = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2]
CODE = ["1", "0", "X", "9", "8", "7", "6", "5", "4", "3", "2"]
#S = Sum(Ai * Wi)
#Y = mod(S, 11)
#C = Cy
def self.checksum id
@douo
douo / Data.java
Last active Mar 8, 2017
一个实现 Recycle 机制的例子
View Data.java
/**
* Created by Tiou on 2014/7/15.
* 一个实现 Recycle 机制的对象
*/
public class Data {
/**
* 对象池,就是上文所提到的对象仓库,用于暂时存放不用的对象。
* 用链表来实现对象池结构,直观,高效,易用。
* sPool 便是指向链表头部的引用
*/
You can’t perform that action at this time.