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
package com.myapp | |
import android.os.Build | |
import android.os.StrictMode | |
import com.snap.core.BuildConfig | |
import com.snapchat.android.framework.logging.Timber | |
import java.lang.reflect.Field | |
import java.lang.reflect.Modifier | |
/** |
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
2018-07-03 11:03:13.648 22151-22151/com.myapp D/StrictMode: StrictMode policy violation; ~duration=9 ms: android.os.StrictMode$StrictModeDiskReadViolation: policy=3211271 violation=2 | |
at android.os.StrictMode$AndroidBlockGuardPolicy.onReadFromDisk(StrictMode.java:1293) | |
at libcore.io.BlockGuardOs.open(BlockGuardOs.java:183) | |
at libcore.io.IoUtils.canOpenReadOnly(IoUtils.java:163) | |
at dalvik.system.DexPathList$Element.findNativeLibrary(DexPathList.java:550) | |
at dalvik.system.DexPathList.findLibrary(DexPathList.java:480) | |
at dalvik.system.BaseDexClassLoader.findLibrary(BaseDexClassLoader.java:84) | |
at java.lang.Runtime.loadLibrary0(Runtime.java:966) | |
at java.lang.System.loadLibrary(System.java:1567) | |
at com.qualcomm.qti.Performance.<clinit>(Performance.java:21) |
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 android.text.Editable; | |
import android.text.TextWatcher; | |
import android.widget.EditText; | |
public class SSNFormattingTextWatcher implements TextWatcher { | |
private EditText mEditText; | |
private boolean mShouldDeleteSpace; | |
public SSNFormattingTextWatcher(EditText editText) { | |
mEditText = editText; |
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
// If true, the emails will be sent to the support email | |
var DEV_MODE = false; | |
// Index of some column that is not used. | |
var SENT_COLUMN = 15; | |
// Place your Grid API Key here. | |
var SENDGRID_KEY = PUT_YOUR_SEND_GRID_API_KEY_HERE; | |
// The emails will be send here. | |
var EMAIL_TO = "[email protected]"; | |
// Errors will be send here |
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
#!/bin/bash | |
TIMESTAMP=`date +%F-%H%M` | |
DUMP_LOCAL=/tmp/dump-${TIMESTAMP} | |
# exit if something fails | |
set -e | |
if [ $# -lt 2 ] | |
then |
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
#!/bin/bash | |
MONGODUMP_PATH="/usr/bin/mongodump" | |
TIMESTAMP=`date +%F-%H%M` | |
S3_CONFIG="/home/ubuntu/.s3cfg" | |
CHUNK_SIZE="500m" # 500 mg | |
DUMPS_TO_KEEP=30 | |
if [ $# -lt 2 ] |
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
int padding = 10; // in pixels | |
yourTextView.setShadowLayer(padding /* radius */, 0, 0, 0 /* transparent */); | |
yourTextView.setPadding(padding, padding, padding, padding); | |
// Now create the new span | |
String str = "Some really long string goes in here"; | |
Spannable spannable = new SpannableString(str); | |
spannable.setSpan(new PaddingBackgroundColorSpan( | |
getResources().getColor(android.R.color.black), | |
padding |
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 android.graphics.Canvas; | |
import android.graphics.Paint; | |
import android.graphics.Rect; | |
import android.text.style.LineBackgroundSpan; | |
public class PaddingBackgroundColorSpan implements LineBackgroundSpan { | |
private int mBackgroundColor; | |
private int mPadding; | |
private Rect mBgRect; |
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
String str = "Some really long string goes in here"; | |
Spannable spannable = new SpannableString(str); | |
spannable.setSpan(new BackgroundColorSpan( | |
getResources().getColor(android.R.color.black) | |
), 0, str.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); | |
yourTextView.setText(spannable); |
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
<script>(function(d, s, id) { | |
var js, ujs = d.getElementsByTagName(s)[0]; | |
if (d.getElementById(id)) return; | |
js = d.createElement(s); js.id = id; | |
js.src = "//umano.me/widgets/player.min.js"; | |
ujs.parentNode.insertBefore(js, ujs); | |
}(document, 'script', 'umano-jssdk'));</script> | |
<div class="umano-player" data-canonical="http://pandodaily.com/2012/11/21/umano-wants-to-tell-you-the-news-literally"> | |
</div> |
NewerOlder