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
// High performance | |
public static String getProcessName() { | |
try { | |
File file = new File("/proc/" + android.os.Process.myPid() + "/" + "cmdline"); | |
BufferedReader mBufferedReader = new BufferedReader(new FileReader(file)); | |
String processName = mBufferedReader.readLine().trim(); | |
mBufferedReader.close(); | |
return processName; | |
} catch (Exception e) { | |
e.printStackTrace(); |
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
task runGetDeps() { | |
doLast { | |
project.getConfigurations().each { configuration -> | |
// println("conf $configuration.name") | |
if (configuration.name == "debugCompileClasspath" && configuration.canBeResolved) { | |
println("conf $configuration.name") | |
configuration.incoming.resolutionResult.getAllDependencies().each { dep -> | |
println("dep => $dep") | |
} | |
} |
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 org.gradle.api.Plugin | |
import org.gradle.api.Project | |
class ButterKnifePlugin: Plugin<Project> { | |
private val KAPT_NAME = "kapt" | |
private val APT_NAME = "annotationProcessor" | |
private val KOTLIN_KAPT_PLUGIN_ID = "org.jetbrains.kotlin.kapt" | |
private val BUTTER_KNIFE_PLUGIN_ID = "com.jakewharton.butterknife" |
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 okhttp3.Interceptor | |
import okhttp3.Response | |
import java.io.IOException | |
/** | |
* Fresco无法直接设置request的header来传递Hostname | |
* 通过提供Interceptor来添加和video相同的httpdns支持 | |
* 同时图片下载的成功与否也会用来对host进行评分 |
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 -*- | |
import store | |
from tools.tor import ThreadRequestContext | |
class BaseHandler(RequestHandler): | |
def prepare(self): | |
store.db() |
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
builder.header("X-AppEngine-Country", DeviceUtils.getCountryISO()) | |
.header("Accept", "application/json") | |
.header("Content-Type", "application/json") | |
.header("User-Agent", SMAuthUtilsProxy.getUserAgent() + ConnectionManager.getConnectType()) | |
.header("app-language", DeviceUtils.getLanguageCodeWithCountry()) | |
.header("locale", DeviceUtils.getLanguageCodeWithCountry()) | |
.header("country", DeviceUtils.getCountryISO()) | |
.header("cpu-abi", SystemUtils.getMostPreferredABI()) | |
.header("unique-key", getUniqueKey()); | |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
</head> | |
<body> | |
<button class="test" style="width:100%; height:300px" onclick="test()">test</button> | |
<script> | |
document.getElementsByClassName("test").onclick = function() { | |
} | |
function test() { |
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
Analysic Version 6.1.3 | |
Total: 67931 Fail: 10008(14.73%) Multi Fail: 439(0.65%) | |
createRecord failed: 687 (6.86%, 1.01%) | |
Good 0 0.00% | |
Normal 0 0.00% | |
Poor 0 0.00% | |
None 0 0.00% | |
compose Error: 1508 (15.07%, 2.22%) | |
Good 0 0.00% |
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
# Path to your oh-my-zsh configuration. | |
ZSH=$HOME/.oh-my-zsh | |
# Set name of the theme to load. | |
# Look in ~/.oh-my-zsh/themes/ | |
# Optionally, if you set this to "random", it'll load a random theme each | |
# time that oh-my-zsh is loaded. | |
ZSH_THEME="gentoo" | |
# Example aliases |
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 CompatCollapsingToolbarLayout extends CollapsingToolbarLayout { | |
private boolean mLayoutReady; | |
public CompatCollapsingToolbarLayout(Context context) { | |
this(context, null); | |
} | |
public CompatCollapsingToolbarLayout(Context context, AttributeSet attrs) { | |
this(context, attrs, 0); | |
} |
NewerOlder