View safari_reader.js
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
/* | |
* Copyright (c) 2010 Apple Inc. All rights reserved. | |
*/ | |
function hostnameMatchesHostKnownToContainEmbeddableMedia(e) { | |
const t = /^(.+\.)?(youtube\.com|vimeo\.com|dailymotion\.com|soundcloud\.com|mixcloud\.com|embedly\.com|embed\.ly)\.?$/; | |
return t.test(e) | |
} | |
function lazyLoadingImageURLForElement(e) { | |
const t = /(data:image\/)?gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==/, | |
n = { |
View executor.java
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
mExecutor = new ScheduledThreadPoolExecutor(6) { | |
@Override | |
protected void afterExecute(Runnable r, Throwable t) { | |
super.afterExecute(r, t); | |
if (t == null && r instanceof Future<?>) { | |
try { | |
Future<?> future = (Future<?>) r; | |
if (future.isDone()) | |
future.get(); | |
} catch (CancellationException ce) { |
View gist:737dd0461e61e5b59e6c
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
public class BlurUtil { | |
public static Bitmap blur(Context context, Bitmap sentBitmap, int radius) { | |
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.JELLY_BEAN) { | |
Bitmap bitmap = sentBitmap.copy(sentBitmap.getConfig(), true); | |
final RenderScript rs = RenderScript.create(context); | |
final Allocation input = Allocation.createFromBitmap(rs, sentBitmap, Allocation.MipmapControl.MIPMAP_NONE, | |
Allocation.USAGE_SCRIPT); |