This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
__author__ = 'yava' | |
from PIL import Image | |
from PIL import ExifTags | |
import os | |
import datetime | |
def getImageTime(path): | |
try: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public void onWindowFocusChanged(boolean hasFocus) { | |
super.onWindowFocusChanged(hasFocus); | |
if (hasFocus) { | |
if (Build.VERSION.SDK_INT < 16) { | |
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, | |
WindowManager.LayoutParams.FLAG_FULLSCREEN); | |
} else { | |
View decorView = getWindow().getDecorView(); | |
int uiOptions = View.SYSTEM_UI_FLAG_FULLSCREEN; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static final long SECOND_MILLIS = 1000; | |
private static final long MINUTE_MILLIS = 60 * SECOND_MILLIS; | |
private static final long HOUR_MILLIS = 60 * MINUTE_MILLIS; | |
private static final long DAY_MILLIS = 24 * HOUR_MILLIS; | |
private static final long MONTH_MILLIS = 30 * DAY_MILLIS; | |
private static final long YEAR_MILLIS = 12 * MONTH_MILLIS; | |
public static String getTimeAgo(long time) { | |
if (time < 1000000000000L) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.view.View; | |
public abstract class OneClickListener implements View.OnClickListener { | |
private long lastClickTime = 0; | |
private static long DIFF = 1000; | |
@Override | |
public void onClick(View v) { | |
if (!isFastDoubleClick()) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 关闭代理:adb shell settings put global http_proxy :0 | |
// 开启代理:adb shell settings put global http_proxy 192.168.1.50:8080 | |
// 封装函数,自动获取电脑ip,一键设置代理。adbproxy 8080/off | |
adbproxy(){ | |
if [[ -z $1 ]]; | |
then adb shell settings put global http_proxy "$(ifconfig | grep 192 | awk '{ print $2 ;}'):8080" | |
return | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class APIException extends RuntimeException { | |
private int code; | |
private String msg; | |
public APIException(int code, String msg) { | |
this.code = code; | |
this.msg = msg; | |
} |
OlderNewer