Skip to content

Instantly share code, notes, and snippets.

@qvoid
qvoid / 0_reuse_code.js
Created January 18, 2017 14:51
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@qvoid
qvoid / vimrc
Last active October 23, 2020 10:40
My Vim configuration #Vim
" Use Vim settings, rather than Vi settings (much better!).
" This must be first, because it changes other options as a side effect.
set nocompatible " be iMproved, required
" When started as "evim", evim.vim will already have done these settings.
if v:progname =~? "evim"
finish
endif
filetype off " required
@qvoid
qvoid / StringUtil.java
Created January 19, 2017 11:51
Millisecond to string #Java #Time
static String millisToString(long millis, boolean text) {
boolean negative = millis < 0;
millis = java.lang.Math.abs(millis);
millis /= 1000;
int sec = (int) (millis % 60);
millis /= 60;
int min = (int) (millis % 60);
millis /= 60;
int hours = (int) millis;
@qvoid
qvoid / monkey
Last active November 18, 2017 04:03
Monkey testing command on an Anddroid App #Android #Monkey #Shell
monkey --throttle 1000 -p com.example.vlcmediaplayerdemo --pct-touch 80 --pct-motion 20 --pct-majornav 0 --pct-syskeys 0 --pct-nav 0 --kill-process-after-error --monitor-native-crashes -v 540000 > /mnt/sdcard/kmbox/log/monkey.log
@qvoid
qvoid / adb-touch
Last active October 29, 2022 07:42
Send touch event to Android device using adb cmd #Android #ADB
adb shell input tap x y
@qvoid
qvoid / runAndroid.md
Last active November 16, 2017 11:53
Runing Android OpenSource Project in a fast way

Fistly

check Gradle version, builTools version and compile sdk version

Compile and packaging

./gradlew clean
./gradlew assembleDebug
@qvoid
qvoid / cma-checkout.txt
Last active November 18, 2017 04:03
Checking out Android CMA size and usage
cd /sys/kernel/debug/ion/heaps
cat cma
cat cma-bitmap
cat vmalloc
@qvoid
qvoid / ffmepg cmd
Last active July 30, 2021 02:55
Useful ffmpeg command
# 检查坏帧
ffmpeg -y -i 00013633_de.mpg -vf showinfo -frames:v 200 test.mpg
ffmpeg -i A016C001_160112_R6QT.mov -an -vcodec libx264 test.mp4
# 查看Mediainfo
ffmpeg -i test.mp4
# 抽取音频
ffmpeg -i ./00015234.mpg -map 0:2 15234_2.mp3
@qvoid
qvoid / screenrecord
Last active November 18, 2017 04:02
Record screen on an Androi device
screenrecord --size 1280x720 --bit-rate 3000000 --time-limit 10 /sdcard/demo.mp4
@qvoid
qvoid / rm_reverse
Last active September 21, 2023 10:13
remove file in reverse
## use grep
```
rm `ls | grep -v "file_name_wanted_to_be_kept"`
```