Skip to content

Instantly share code, notes, and snippets.

View Trumeet's full-sized avatar
🏳️‍⚧️

Yuuta Liang Trumeet

🏳️‍⚧️
View GitHub Profile
@Trumeet
Trumeet / .travis.yml
Created March 26, 2019 22:14
A Travis CI configuration demo, it can auto build the Docker image, push it, release the JAR inside the image to GitHub Releases and tag it.
language: java
services:
- docker
before_install:
- echo "$DOCKER_PASSWORD" | docker login "$DOCKER_REGISTRY" -u "$DOCKER_USERNAME" --password-stdin
- ./gradlew exportVersion
- export VERSION=$(cat version.txt)
- export VERSION_CODE=$(cat version_code.txt)
script:
- docker build -t "$DOCKER_REGISTRY"/"$DOCKER_IMAGE_NAME":"$VERSION" .
@Trumeet
Trumeet / Program.cs
Last active April 23, 2023 05:27
Enable Aero style on Windows 10.
using System;
using System.Windows.Forms;
using System.Runtime.InteropServices;
using System.Drawing;
/// <summary>
/// Enable Aero style on Windows 10.
/// Refrences:
/// https://gist.github.com/ysc3839/b08d2bff1c7dacde529bed1d37e85ccf,
/// https://gist.github.com/riverar/fd6525579d6bbafc6e48,
@Trumeet
Trumeet / UserHandleUtils.kt
Created March 9, 2019 02:46
Create UserHandle instance without using hidden APIs
object UserHandleUtils {
private fun createUserHandleWithUserID(userId: Int): UserHandle {
val parcel = Parcel.obtain()
// I bet that it won't change a lot
parcel.writeInt(userId)
val userHandle = UserHandle(parcel)
parcel.recycle()
return userHandle
}
}
@Trumeet
Trumeet / ProguardDictionaryGenerator
Created February 24, 2019 20:12
A simple tool to generate styled proguard dictionary
/**
* Proguard dictionary generator
* Usage:
* java Generator [character] [lines]
* Example:
* java Generator A 5
* then you will get:
* A
* Aa
* Aaa
@Trumeet
Trumeet / Jyutping.csv
Created February 15, 2019 16:45
The most useful Chinese characters (from http://faculty.arts.ubc.ca/tli/guideline/changyongzibiao.pdf), useful Cantonese characters (from Wikipedia) and their Jyutping (converted via https://gist.github.com/Trumeet/dac51a72382a7bd2a5e458ed2e7c49d1)
Chinese character Jyutping
jat1
jyut3 jyut6
ji6
sap6
ding1
cong2
cat1
buk1
jan4
@Trumeet
Trumeet / JyutpingConverter.java
Last active March 2, 2019 04:56
Get the Jyutping of a single Chinese character, data are parsed from cantonese.org
package moe.yuuta.jyutpingconverter;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;
import java.io.IOException;
import java.util.*;
import java.util.stream.Collectors;
package moe.yuuta.intro
import android.graphics.Color
import android.graphics.drawable.ColorDrawable
import android.os.Bundle
import android.view.View
import android.widget.Button
import android.widget.ImageButton
import androidx.appcompat.app.AppCompatActivity
import androidx.fragment.app.Fragment

Keybase proof

I hereby claim:

  • I am Trumeet on github.
  • I am trumeet (https://keybase.io/trumeet) on keybase.
  • I have a public key whose fingerprint is D0AD F3AF 3371 4E47 9229 B603 96CB D083 5978 39CF

To claim this, I am signing this object:

@Trumeet
Trumeet / .gitlab-ci-example.yml
Created July 29, 2018 08:45
GitLab CI Android project config example
# 官方 https://about.gitlab.com/2016/11/30/setting-up-gitlab-ci-for-android-projects/ 早已过时,无法正常使用。这里分享一个自用的,不保证能行
image: openjdk:8-jdk
variables:
ANDROID_COMPILE_SDK: "27"
ANDROID_BUILD_TOOLS: "27.0.3"
ANDROID_SDK_TOOLS: "4333796" # 在 https://developer.android.com/studio/ 下面的 Command line tools only 查
before_script:
- apt-get --quiet update --yes>/dev/null
@Trumeet
Trumeet / customsdkgen.sh
Created November 14, 2017 09:57
Build a custom android sdk with some hidden api (Not tested, I just copy it from https://github.com/AOKP/build/blob/mm/tools/customsdkgen.sh)
#!/bin/bash
SDK_VER=23
CUSTOM_VER=123
CUSTOM_NAME=aokp
. ${ANDROID_BUILD_TOP}/vendor/aokp/tools/colors
if [ -z "$OUT" ]; then
echo -e $CL_RED"Please lunch a product before using this command"$CL_RST