Skip to content

Instantly share code, notes, and snippets.

View EHG613's full-sized avatar
🐍
A busy Day!

lijian EHG613

🐍
A busy Day!
View GitHub Profile
@EHG613
EHG613 / 压缩脚本.sh
Created June 9, 2023 00:59 — forked from MoyuScript/压缩脚本.sh
字体压缩
#!/bin/bash
# MIT License
# Copyright (c) 2022-present MoyuScript
# See: https://mit-license.org/
echo "Input path: $1"
echo "With subset: $2"
echo "Custom text file: $3"
<template>
<!-- <div class="scroll">
<div class="item">1</div>
<div class="item">2</div>
<div class="item">3</div>
<div class="item">4</div>
<div class="item">5</div>
<div class="item">6</div>
<div class="item">7</div>
<div class="item">8</div>
@EHG613
EHG613 / Android任务栈.java
Created February 28, 2023 02:32
GET_TASKS权限在5.0已废弃;可以通过如下方式获取任务栈列表
Log.e("Live",getTaskId()+"");
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.M) {
ActivityManager activityManager = getSystemService(ActivityManager.class);
//获取任务栈列表
List<ActivityManager.AppTask> tasks = activityManager.getAppTasks();
for (ActivityManager.AppTask task : tasks) {
ActivityManager.RecentTaskInfo info = task.getTaskInfo();
int activityCount = info.numActivities; //栈内Activity数量
String topActivity = info.topActivity.getClassName(); //栈顶Activity
String baseActivity = info.baseActivity.getClassName(); //栈底Activity
@EHG613
EHG613 / AdaptScreenUtils.kt
Created January 13, 2023 03:29
根据DisplayMetrics.DENSITY_MEDIUM判断系统是否开启大字体,且考虑老年人使用适当放大1.25倍字体
/*
* AdaptScreenUtils.kt, 2023-01-05
*
* Copyright © 2015-2023 Liangyihui. All rights reserved.
*
*/
package com.dop.h_doctor.util
import android.content.res.Resources
find . -iname '*.flac' -exec bash -c 'D=$(dirname "{}"); B=$(basename "{}"); T="mp3/$D"; mkdir -p "$T"; ffmpeg -i "{}" -ab 192k -map_metadata 0 -id3v2_version 3 -acodec libmp3lame "$T/${B%.*}.mp3"' \;
Paint paint=new Paint();
ColorMatrix cm = new ColorMatrix();
cm.setSaturation(0);
paint.setColorFilter(new ColorMatrixColorFilter(cm));
getWindow().getDecorView().setLayerType(View.LAYER_TYPE_HARDWARE,paint);
@EHG613
EHG613 / gif_creator.sh
Created May 11, 2020 01:31 — forked from cachapa/gif_creator.sh
Shell script to generate high-quality animated gifs from a video file
#!/bin/bash
# Based on http://blog.pkh.me/p/21-high-quality-gif-with-ffmpeg.html
# Requires ffmpeg
filename="${1%.*}"
palette="/tmp/palette.png"
filters="scale=320:-1:flags=lanczos"
ffmpeg -v warning -i "$1" -vf "$filters,palettegen" -y $palette
ffmpeg -v warning -i "$1" -i $palette -lavfi "$filters [x]; [x][1:v] paletteuse" -y "$filename.gif"
@EHG613
EHG613 / README.md
Last active March 6, 2023 08:48 — forked from chuyik/README.md
macOS 给 Git(Github) 设置代理(HTTP/SSH)
@EHG613
EHG613 / .git-commit-template.txt
Created July 4, 2018 01:26 — forked from jmaxhu/.git-commit-template.txt
一份建议的git commit模板
# <类型>: (类型的值见下面描述) <主题> (最多50个字)
# 解释为什么要做这些改动
# |<---- 请限制每行最多72个字 ---->|
# 提供相关文章和其它资源的链接和关键字
# 例如: Github issue #23
# --- 提交 结束 ---
# 类型值包含