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
fun readFileDataFromAsset(context: Context, fileName: String): String? { | |
val data: String? = null | |
try { | |
data = context.assets.open(fileName).bufferedReader().use { it.readText() } | |
} catch (ioException: IOException) { | |
ioException.printStackTrace() | |
return null | |
} | |
return data | |
} |
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
1. Ask HN: What books changed the way you think about almost everything? - https://news.ycombinator.com/item?id=19087418 | |
2. Ask HN: What are the best MOOCs you've taken? - https://news.ycombinator.com/item?id=16745042 | |
3. Ask HN: How to self-learn electronics? - https://news.ycombinator.com/item?id=16775744 | |
4. Ask HN: Successful one-person online businesses? - https://news.ycombinator.com/item?id=21332072 | |
5. Ask HN: What's the most valuable thing you can learn in an hour? - https://news.ycombinator.com/item?id=21581361 |
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 requests | |
from bs4 import BeautifulSoup | |
URL = 'https://alexa.com/siteinfo/theayurveda.org' | |
page = requests.get(URL) | |
soup = BeautifulSoup(page.content, 'html.parser') | |
results = soup.find_all('span', class_='pull-right') | |
for result in results: |
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
Apache License | |
Version 2.0, January 2004 | |
http://www.apache.org/licenses/ | |
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION | |
1. Definitions. | |
"License" shall mean the terms and conditions for use, reproduction, | |
and distribution as defined by Sections 1 through 9 of this document. |
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
class CustomLayoutManager extends LinearLayoutManager { | |
private final float mShrinkAmount = 0.15f; | |
private final float mShrinkDistance = 0.9f; | |
Context mContext; | |
//Make an instance variable at the top of you LayoutManager | |
private static final float MILLISECONDS_PER_INCH = 50f; | |
public CustomLayoutManager(Context context) { | |
super(context); | |
mContext = context; |
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 deployApks(type:Copy) { | |
description = "Copies APKs and Proguard mappings to the deploy directory" | |
def appName = "posture"; | |
def versionDir = android.defaultConfig.versionName+"_"+android.defaultConfig.versionCode; | |
println("Copies APK and Proguard to " + versionDir) | |
from 'build/outputs/mapping/release/' | |
include '**/mapping.txt' | |
into '../.admin/deploy/' + versionDir |
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
LOCAL_PATH:= $(call my-dir) | |
# The macro function my-dir, provided by the build system, returns the path of the current directory | |
include $(CLEAR_VARS) | |
# The CLEAR_VARS variable points to a special GNU Makefile that clears many LOCAL_XXX variables for you, | |
# such as LOCAL_MODULE, LOCAL_SRC_FILES, and LOCAL_STATIC_LIBRARIES. Note that it does not clear LOCAL_PATH | |
LOCAL_MODULE_TAGS := optional | |
LOCAL_SRC_FILES := $(call all-java-files-under, src) |
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
//Animate views with a nice fadeIn effect before drawing | |
getViewTreeObserver().addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener() { | |
@Override | |
public boolean onPreDraw() { | |
getViewTreeObserver().removeOnPreDrawListener(this); | |
if(mPOI.hasFacebookRating()) | |
ViewCompat.animate(mFacebookTv).alpha(1).setDuration(500); | |
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
-keep public class * extends android.app.Activity | |
-keep public class * extends android.app.Application | |
-keep public class * extends android.app.Service | |
-keep public class * extends android.content.BroadcastReceiver | |
-keep public class * extends android.content.ContentProvider | |
-keep public class * extends android.preference.Preference | |
-keep public class com.android.vending.billing.IInAppBillingService | |
-keep public class * extends android.view.View { | |
public <init>(android.content.Context); | |
public <init>(android.content.Context, android.util.AttributeSet); |
NewerOlder