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.app.ActivityManager; | |
import android.content.ComponentName; | |
import android.content.Context; | |
import android.os.Build; | |
import java.util.List; | |
public class AppUtil { | |
private static final int KITKAT_WATCH = 20; |
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 groovy.io.FileType | |
def source = "import android.support.wearable" | |
def dest = "import ticwear.support.wearable" | |
def dir = new File("res") | |
dir.eachFileRecurse (FileType.FILES) { f -> | |
def fileText = f.text | |
fileText = (fileText =~ /${source}/).replaceAll(dest) | |
f.write(fileText) |
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
apply plugin: 'android' | |
def getVersionCode = { -> | |
try { | |
def stdout = new ByteArrayOutputStream() | |
exec { | |
commandLine 'git', 'rev-list', '--first-parent', '--count', 'master' | |
standardOutput = stdout | |
} | |
return Integer.parseInt(stdout.toString().trim()) |
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
wget https://github.com/adobe-fonts/source-code-pro/archive/2.030R-ro/1.050R-it.zip | |
unzip 1.050R-it.zip | |
mkdir ~/.fonts | |
mv source-code-pro-2.030R-ro-1.050R-it/OTF/*.otf ~/.fonts/ | |
rm -r source-code-pro-2.030R-ro-1.050R-it/ 1.050R-it.zip | |
fc-cache -f -v |
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
# -*- coding: utf-8 -*- | |
""" | |
批量递归压缩指定目录下的jpg或者png文件,使用tinify库进行压缩实现。 | |
注意:新生成的压缩文件会替换之前的源文件,请在运行脚本之前做好备份,或者使用git之类的版本管理工具将源文件加入版本仓库! | |
运行脚本前需确保以下库已经安装 | |
1. pip install tinify | |
2. pip install click | |
""" |
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
# -*- coding: utf-8 -*- | |
""" | |
手机屏幕截图,参考 https://github.com/wangshub/wechat_jump_game | |
""" | |
import subprocess | |
import os | |
import sys | |
from PIL import Image |
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 java.io.File; | |
import java.io.FileNotFoundException; | |
import java.io.IOException; | |
import okio.BufferedSink; | |
import okio.BufferedSource; | |
import okio.GzipSink; | |
import okio.Okio; | |
public class ZipUtil { |
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
let mapleader = "," " leader is comma | |
let localleader = "," " leader is comma | |
set tabstop=4 " number of visual spaces per TAB | |
set softtabstop=4 " number of spaces in tab when editing | |
set shiftwidth=4 " spaces in newline start | |
set expandtab " tabs are spaces | |
set number " show line numbers | |
set rnu " show relative line numbers | |
set showcmd " show command in bottom bar |
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
imap fd <Esc> |
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
package com.leaf.library; | |
import android.annotation.TargetApi; | |
import android.app.Activity; | |
import android.content.Context; | |
import android.graphics.Color; | |
import android.os.Build; | |
import android.support.annotation.ColorInt; | |
import android.support.annotation.IntRange; | |
import android.support.annotation.NonNull; |