Skip to content

Instantly share code, notes, and snippets.

星一 baoyongzhang

Block or report user

Report or block baoyongzhang

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View safari_reader.js
/*
* 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 = {
@baoyongzhang
baoyongzhang / executor.java
Last active Aug 29, 2015
Java线程池异常会被吞掉,需要手动获取异常信息
View executor.java
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
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);
You can’t perform that action at this time.