Skip to content

Instantly share code, notes, and snippets.

View 2BAB's full-sized avatar
☀️
What's happening?

El Zhang 2BAB

☀️
What's happening?
View GitHub Profile
@2BAB
2BAB / image-fetch.main.kts
Created January 25, 2021 14:26
Blog Images Replacement
@file:DependsOn("com.squareup.okhttp3:okhttp:4.9.0")
import okhttp3.*
import okhttp3.internal.closeQuietly
import okio.IOException
import java.io.File
import java.util.concurrent.CountDownLatch
import java.util.concurrent.atomic.AtomicInteger
// Please specify the post directory, static-host blog usually puts all posts in one dir like "./_post"
@2BAB
2BAB / GenExcaliburMapTask
Created January 7, 2017 08:27
registerJavaGeneratingTask
public class GenExcaliburMapTask extends DefaultTask {
@OutputDirectory
File outputDir
@Input
String outputPackageName
@TaskAction
def generateMap() {
@2BAB
2BAB / easy-andfix.sh
Created June 30, 2016 08:35
easy-andfix.sh
#!/bin/bash
new_apk_path=
old_apk_link=
keystore_link=
keystore_password=
key_alias=
key_password=
@2BAB
2BAB / initPlugin.sh
Last active May 26, 2016 02:10
A Script For Init Gradle Plugin Project
#!/bin/sh
echo "Input Your ProjectName like my-gradle-plugin"
read projectName
echo "Input Your PackageName like com.example.gradle"
read packageName
echo "Input Your First Plugin Name like say-hello"
read pluginName
@2BAB
2BAB / gist:940e4f8633692e681fd4
Created June 3, 2015 02:13
DebouncedOnClickListener
public abstract class DebouncedOnClickListener implements View.OnClickListener {
private final long minimumInterval;
private Map<View, Long> lastClickMap;
/**
* setTime
*
* @param minimumIntervalMsec The minimum allowed time between clicks
* - any click sooner than this after a previous click will be rejected
@2BAB
2BAB / AndroidManifest
Last active September 13, 2023 17:56
Device Administration Bug
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="me.x2bab.deviceadmintrick" >
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity