Skip to content

Instantly share code, notes, and snippets.

# (42f63b0de7318fe1 is a device id)
adb -s 075d0cdb0ae533b1 shell setprop log.tag.Volley VERBOSE

Parse -> LeanCloud 文件迁移工具

注意:这个工具是用来导入到中国区节点的

依赖: gevent、requests

Ubuntu 可以 # apt-get install python-gevent python-requests

@TonyTangAndroid
TonyTangAndroid / android_studio_shortcuts.md
Created April 7, 2016 05:02 — forked from stkent/android_studio_shortcuts.md
Android Studio Shortcuts (Mac)

Android Studio Shortcuts (Mac)

Notes:

  • Two of the most useful shortcuts utilize the Fn (function) keys. It is therefore recommended that you enable the "Use all F1, F2, etc. keys as standard function keys" option [System Preferences > Keyboard].
  • Be sure to enable the Mac OS X 10.5+ keymap in Android Studio [Preferences > Keymap].
  • A fairly complete shortcut list can be found here.

Useful symbols:

@TonyTangAndroid
TonyTangAndroid / Interceptor.java
Created November 16, 2016 22:48 — forked from alex-shpak/Interceptor.java
Refreshing OAuth token with okhttp interceptors. All requests will wait until token refresh finished, and then will continue with the new token.
private class HttpInterceptor implements Interceptor {
@Override
public Response intercept(Chain chain) throws IOException {
Request request = chain.request();
//Build new request
Request.Builder builder = request.newBuilder();
builder.header("Accept", "application/json"); //if necessary, say to consume JSON
@TonyTangAndroid
TonyTangAndroid / gist:35bd8c9d2eb0fba8206c955dbf1dc1d5
Created March 3, 2017 20:23
The submit button only gets enabled if username and password have a length>=3
emailChangeObservable = RxTextView.textChangeEvents(email);
passwordChangeObservable = RxTextView.textChangeEvents(password);
// force-disable the button
submitButton.setEnabled(false);
Observable.combineLatest(emailChangeObservable, passwordChangeObservable,
(emailObservable, passwordObservable) -> {
boolean emailCheck = emailObservable.text().length() >= 3;
boolean passwordCheck = passwordObservable.text().length() >= 3;
@TonyTangAndroid
TonyTangAndroid / Example.java
Created May 5, 2023 06:49 — forked from gelitenight/Example.java
A way to easily traverse any view hierarchy in Android
/* basic usage */
ViewGroup root = (ViewGroup) findViewById(android.R.id.content);
LayoutTraverser.build(new LayoutTraverser.Processor() {
@Override
public void process(View view) {
// do stuff with the view
}
}).traverse(root);
@TonyTangAndroid
TonyTangAndroid / gist:0f7253f6cc80cdaa88cc1f97fdeb7359
Created September 9, 2023 05:45
Buffer Debounce RxJava 2 Util
package aa.rx;
import io.reactivex.Observable;
import io.reactivex.ObservableTransformer;
import io.reactivex.Scheduler;
import java.util.List;
import java.util.concurrent.TimeUnit;
/**
* <a href="https://stackoverflow.com/a/49866518/4068957">Inspired</a>