This file contains hidden or 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
| #!/bin/bash | |
| # | |
| # git-svn-diff originally by (http://mojodna.net/2009/02/24/my-work-git-workflow.html) | |
| # modified by mike@mikepearce.net | |
| # modified by aconway@[redacted] - handle diffs that introduce new files | |
| # modified by t.broyer@ltgt.net - fixes diffs that introduce new files | |
| # modified by m@rkj.me - fix sed syntax issue in OS X | |
| # modified by rage-shadowman - cleaned up finding of SVN info and handling of path parameters | |
| # modified by tianyapiaozi - cleaned up some diff context lines | |
| # |
This file contains hidden or 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
| <resources> | |
| <style name="AppBaseTheme" parent="Theme.AppCompat.Light"> | |
| </style> | |
| <style name="AppBaseTheme.Compact" parent="AppBaseTheme"> | |
| </style> | |
| <style name="AppTheme.Preference" parent="android:Theme.Holo.Light"/> |
This file contains hidden or 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 static String dump(Object object) { | |
| Field[] fields = object.getClass().getDeclaredFields(); | |
| StringBuilder sb = new StringBuilder(); | |
| sb.append(object.getClass().getSimpleName()).append('{'); | |
| boolean firstRound = true; | |
| for (Field field : fields) { | |
| if (!firstRound) { | |
| sb.append(", "); |
This file contains hidden or 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 static void setListViewHeightBasedOnChildren(ListView listView) { | |
| ListAdapter listAdapter = listView.getAdapter(); | |
| if (listAdapter == null) { | |
| return; | |
| } | |
| int totalHeight = 0; | |
| for (int i = 0; i < listAdapter.getCount(); i++) { | |
| View listItem = listAdapter.getView(i, null, listView); | |
| listItem.measure(0, 0); |
This file contains hidden or 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 time | |
| import requests | |
| import gevent | |
| from gevent.pool import Pool | |
| from pyquery import PyQuery as pq |
This file contains hidden or 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 com.google.auto.value.AutoValue; | |
| import java.lang.annotation.Retention; | |
| import java.lang.annotation.Target; | |
| import static java.lang.annotation.ElementType.TYPE; | |
| import static java.lang.annotation.RetentionPolicy.RUNTIME; | |
| /** | |
| * Marks an {@link AutoValue @AutoValue}-annotated type for proper Gson serialization. | |
| * <p> |
This file contains hidden or 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 int getActionBarHeight() { | |
| int actionBarHeight = getSupportActionBar().getHeight(); | |
| if (actionBarHeight != 0) | |
| return actionBarHeight; | |
| final TypedValue tv = new TypedValue(); | |
| if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { | |
| if (getTheme().resolveAttribute(android.R.attr.actionBarSize, tv, true)) | |
| actionBarHeight = TypedValue.complexToDimensionPixelSize(tv.data, getResources().getDisplayMetrics()); | |
| } else if (getTheme().resolveAttribute(com.actionbarsherlock.R.attr.actionBarSize, tv, true)) | |
| actionBarHeight = TypedValue.complexToDimensionPixelSize(tv.data, getResources().getDisplayMetrics()); |
NewerOlder