Skip to content

Instantly share code, notes, and snippets.

@shaobin0604
shaobin0604 / ArtDexOptimizer.java
Created May 9, 2018 10:58
ArtDexOptimizer.java
package com.lody.virtual.helper;
import android.os.Build;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.Executor;
android {
lintOptions {
checkReleaseBuilds false
abortOnError false
disable 'GoogleAppIndexingWarning',
'IconMissingDensityFolder',
'IconDensities',
'RtlHardcoded',
'RtlSymmetry',
@shaobin0604
shaobin0604 / fix_sdk.sh
Created November 16, 2016 07:05
setup sdk ndk location in local.properties
alias fix_sdk='echo "sdk.dir=`echo $ANDROID_SDK`" > local.properties; echo ndk.dir=`echo $ANDROID_NDK` >> local.properties'
Unless specified otherwise, all of the below tinting applies to both Lollipop and pre-Lollipop using AppCompat v21.
To use the support version of these attributes, remove the android namespace.
For instance, "android:colorControlNormal" becomes "colorControlNormal".
These attributes will be propagated to their corresponding attributes within the android namespace
for devices running Lollipop. Any exceptions to this will be noted by including the "android:" prefix.
All Clickable Views:
-----------
@shaobin0604
shaobin0604 / place_autocomplete_item_prediction.xml
Last active March 15, 2016 03:04
Google Play Service Place Search UI
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="@dimen/place_autocomplete_prediction_height"
xmlns:android="http://schemas.android.com/apk/res/android">
<include android:layout_gravity="center" android:visibility="invisible" android:layout_width="@dimen/place_autocomplete_progress_size" android:layout_height="@dimen/place_autocomplete_progress_size" android:layout_marginLeft="@dimen/place_autocomplete_progress_horizontal_margin" android:layout_marginRight="@dimen/place_autocomplete_progress_horizontal_margin" android:layout_alignParentLeft="true" android:layout_centerVertical="true" layout="@layout/place_autocomplete_progress" />
<View android:id="@id/place_autocomplete_separator" android:layout_width="0.0dip" android:layout_height="0.0dip" android:layout_centerVertical="true" />
<TextView android:textSize="@dimen/place_autocomplete_prediction_primary_text" android:textColor="@color/place_autocomple
@shaobin0604
shaobin0604 / gist:f35faae7b9a32587e8bf
Created March 9, 2016 01:28 — forked from aisk/gist:3735854
百度地图坐标与像素互相转换的方法
pixelToPoint = function(point, zoom, center, bounds) {
// 像素到坐标
if (!point) {
return
}
var zoomUnits = getZoomUnits(zoom);
var mercatorLng = center.lng + zoomUnits * (point.x - bounds.width / 2);
var mercatorLat = center.lat - zoomUnits * (point.y - bounds.height / 2);
var mercatorLngLat = {lng: mercatorLng, lat: mercatorLat};
return mercatorToLngLat(mercatorLngLat)
@shaobin0604
shaobin0604 / Android Studio .gitignore
Created October 15, 2015 03:18 — forked from iainconnor/Android Studio .gitignore
A .gitignore for use in Android Studio
# Built application files
/*/build/
# Crashlytics configuations
com_crashlytics_export_strings.xml
# Local configuration file (sdk path, etc)
local.properties
# Gradle generated files
@shaobin0604
shaobin0604 / android-tcpdump.sh
Created September 24, 2015 06:50 — forked from dweinstein/android-tcpdump.sh
Easier tcpdump setup for Android (make sure tcpdump binary is in /data/local/tmp/xbin/tcpdump). Assumes socat and wireshark are installed on your system and that you're on OS X. Easily tweaked for other platforms...
#!/usr/bin/env bash
TCPDUMP_PID=""
SOCAT_PID=""
OUTPUT_FILE=""
PORT=12345
TMPDIR="."
TCPDUMP_PATH="/data/local/tmp/xbin/tcpdump"
NETCAT_PATH="/data/local/tmp/nc"
HOST_INTERFACE="en0"
@shaobin0604
shaobin0604 / 数据采集.md
Last active September 11, 2015 01:57
[功能] 附近兴趣点采集
版本 作者 日期
1.0 邵彬 2015-09-10

[TOC]

数据采集(管理版)

@shaobin0604
shaobin0604 / form_template.json
Last active September 7, 2015 09:58
附近信息提交模板
{
"id": 1,
"version": 1,
"title": "二手车信息采集",
"entries": [
{
"key": "email",
"name": "电子邮件",
"optional": false,
"widget": "edittext",