Skip to content

Instantly share code, notes, and snippets.

View kjsolo's full-sized avatar

Solo Ho kjsolo

View GitHub Profile
#!/bin/bash
COMMAND="$1"
UANMEA=$(uname -a)
ARCH="x64"
DEST=$HOME/.config/clash/service
PLIST=/Library/LaunchDaemons/com.lbyczf.cfw.helper.plist
# if [[ $UANMEA == *"x86_64" ]]; then
# ARCH="x64"
@kjsolo
kjsolo / ForegroundImageView.java
Created December 11, 2017 02:57 — forked from JakeWharton/ForegroundImageView.java
An ImageView which supports a foreground drawable.
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.widget.ImageView;
public class ForegroundImageView extends ImageView {
private Drawable foreground;
@kjsolo
kjsolo / MagicArrayAdapter.java
Last active November 27, 2015 08:29
Android,抽象ArrayAdapter与ViewHolder之间的代码
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
/**
* @author solo
*/
public abstract class MagicArrayAdapter<T> extends ArrayAdapter<T> {
@kjsolo
kjsolo / DateUtils.java
Created April 17, 2015 08:48
Android,智能格式化中文时间
public class DateUtils {
public static String formatDateTime(Date date) {
String text;
long dateTime = date.getTime();
if (isSameDay(dateTime)) {
Calendar calendar = GregorianCalendar.getInstance();
if (inOneMinute(dateTime, calendar.getTimeInMillis())) {
return "刚刚";
} else if (inOneHour(dateTime, calendar.getTimeInMillis())) {