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
| // ==UserScript== | |
| // @name Timestamp Formatter with Hover Tip (Top-Layer, 1s Delay, Precise Format - Refined) | |
| // @namespace http://tampermonkey.net/ | |
| // @version 1.6 | |
| // @description Detects 10-digit or 13-digit timestamps on a webpage and displays a YYYY-MM-DD HH:mm:ss.SSS formatted date on hover. Tooltip appears on top layer with 3s processing delay. | |
| // @author weijia.yan | |
| // @license MIT | |
| // @match *://*/* | |
| // @grant none | |
| // @downloadURL https://update.greasyfork.org/scripts/552036/Timestamp%20Formatter%20with%20Hover%20Tip%20%28Top-Layer%2C%201s%20Delay%2C%20Precise%20Format%20-%20Refined%29.user.js |
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 http.server | |
| import os | |
| class FileUploadHandler(http.server.BaseHTTPRequestHandler): | |
| def do_POST(self): | |
| # 获取文件大小 | |
| content_length = int(self.headers['Content-Length']) | |
| # 读取客户端上传的文件数据 | |
| file_data = self.rfile.read(content_length) | |
| # 保存文件到服务器上 |
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 java.util.*; | |
| import java.util.function.BiConsumer; | |
| import java.util.function.BiPredicate; | |
| import java.util.function.Consumer; | |
| import java.util.function.Function; | |
| import java.util.stream.Collectors; | |
| /** | |
| * 增量更新工具类<br/> |
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 re | |
| def desensitize_text(input_text): | |
| # 替换 手机/证件号/车架号(10到20位大小写字母+数字) | |
| id_pattern = re.compile(r'([a-zA-Z0-9]{2})[a-zA-Z0-9]*([a-zA-Z0-9]{2})') | |
| input_text = re.sub(id_pattern, r'\1****\2', input_text) | |
| # 地址脱敏, 文本包含以下任意三个, 就对这几个字前面两个字符用*代替 | |
| addr_words = ["省","市","区","县", "镇","街", "号", "座", "楼","路"] |
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
| public static String getIpAddress(HttpServletRequest request) { | |
| String ip = request.getHeader("x-forwarded-for"); | |
| if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { | |
| ip = request.getHeader("Proxy-Client-IP"); | |
| } | |
| if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { | |
| ip = request.getHeader("WL-Proxy-Client-IP"); | |
| } | |
| if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { | |
| ip = request.getHeader("HTTP_CLIENT_IP"); |
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 org.apache.commons.cli.*; | |
| import org.jsoup.Jsoup; | |
| import org.jsoup.nodes.Document; | |
| import org.jsoup.nodes.Element; | |
| import org.jsoup.select.Elements; | |
| import personal.xuzj157.stocksyn.crawler.util.StringUtils; | |
| import java.io.File; | |
| import java.io.IOException; |
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 com.haiq.util; | |
| import java.text.ParseException; | |
| import java.text.SimpleDateFormat; | |
| import java.util.Calendar; | |
| import java.util.Date; | |
| import java.util.GregorianCalendar; | |
| import java.util.regex.Matcher; | |
| import java.util.regex.Pattern; |