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
/*Create Web Worker*/ | |
const AsposePDFWebWorker = new Worker("AsposePDFforJS.js"); | |
AsposePDFWebWorker.onerror = evt => console.log(`Error from Web Worker: ${evt.message}`); | |
AsposePDFWebWorker.onmessage = evt => document.getElementById('output').textContent = | |
(evt.data == 'ready') ? 'loaded!' : | |
(evt.data.json.errorCode == 0) ? `Result:\n${DownloadFile(evt.data.json.fileNameResult, "application/msword", evt.data.params[0])}` : `Error: ${evt.data.json.errorText}`; | |
/*Event handler*/ | |
const ffileToDoc = e => { | |
const file_reader = new FileReader(); |
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
from nonebot.adapters import Event, Message | |
from nonebot.params import EventPlainText, CommandArg | |
from nonebot.plugin.on import on_message, on_command | |
from nonebot.adapters.onebot.v11.message import MessageSegment | |
import os | |
import ast | |
import json | |
import shelve | |
import aiohttp |
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
// Load the PDF as a Blob | |
const file = await fetch('path/to/pdf.pdf').then(res => res.blob()); | |
// Convert the PDF to a base64-encoded data URI | |
const reader = new FileReader(); | |
reader.readAsDataURL(file); | |
reader.onload = () => { | |
const base64 = reader.result; | |
// Create a new Blob from the data URI |
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 NextHead from 'next/head' | |
import React from 'react' | |
import ReactGA from 'react-ga' | |
import Router from 'next/router' | |
// GA Tracking Id | |
const gaTrackingId = '[GOOGLE ANALYTICS TRACKING ID GOES HERE]' | |
Router.onRouteChangeComplete = () => { |
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
/** | |
* CharacterUtils | |
* | |
* @author Laughing | |
* @date 2018/7/11 15:24 | |
* Description: | |
*/ | |
public class CharacterUtils { | |
/** | |
* 判断一个字符是否是中文 |
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 static class BottomSheetViewPagerListener extends ViewPager.SimpleOnPageChangeListener { | |
private final ViewPager mViewPager; | |
private final ViewPagerBottomSheetBehavior<View> mBehavior; | |
private BottomSheetViewPagerListener(ViewPager viewPager, View bottomSheetParent) { | |
mViewPager = viewPager; | |
mBehavior = ViewPagerBottomSheetBehavior.from(bottomSheetParent); | |
} | |
@Override |
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
package android.support.design.widget; | |
import android.support.v4.view.ViewCompat; | |
import android.support.v4.view.ViewPager; | |
import android.view.View; | |
import android.view.ViewGroup; | |
import java.lang.ref.WeakReference; | |
/** |
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
let bankcardList = [{ | |
bankName: "中国邮政储蓄银行", | |
bankCode: "PSBC", | |
patterns: [{ | |
reg: /^(621096|621098|622150|622151|622181|622188|622199|955100|621095|620062|621285|621798|621799|621797|620529|621622|621599|621674|623218|623219)\d{13}$/g, | |
cardType: "DC" | |
}, { | |
reg: /^(62215049|62215050|62215051|62218850|62218851|62218849)\d{11}$/g, | |
cardType: "DC" | |
}, { |
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
package me.zfly.demo.sensitiveword; | |
import java.io.*; | |
import java.util.ArrayList; | |
import java.util.HashMap; | |
import java.util.List; | |
import java.util.Map; | |
import java.util.regex.Matcher; | |
import java.util.regex.Pattern; |
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 final class AsyncLayoutInflater { | |
private static final String TAG = "AsyncLayoutInflater"; | |
LayoutInflater mInflater; | |
Handler mHandler; | |
InflateThread mInflateThread; | |
public AsyncLayoutInflater(@NonNull Context context) { | |
mInflater = new BasicInflater(context); | |
mHandler = new Handler(mHandlerCallback); |
NewerOlder