Skip to content

Instantly share code, notes, and snippets.

@nathanchance
nathanchance / gitfu
Last active September 18, 2020 23:45
Reset all files that conflict but keep the non-conflicted ones:
for i in $(git status | grep "both modified" | awk '{print $3}'); do git reset HEAD $i && git checkout -- $i; done
Delete all branches but one
for i in $(git ls-remote -q | grep "refs/head" | cut -d '/' -f 3 | awk '!(/^<BRANCH_NAME_TO_KEEP>$/)'); do git push origin :$i; done
@msfjarvis
msfjarvis / sepolicy.md
Last active December 16, 2023 20:50
How to write sepolicy to fix a denial
@qinshulei
qinshulei / ConvertAndroidVectorDrawable2png.md
Last active September 20, 2022 07:29
Convert Android VectorDrawable to png

转换方法:

  1. Convert Android VectorDrawable to SVG:

使用附件中的java程序。命令如下:

cp Vector2Svg.java path/to/xml_dir
javac Vector2Svg.java
java Vector2Svg ./*.xml
mkdir svg_dir