Skip to content

Instantly share code, notes, and snippets.

/**
* Luhn校验算法校验银行卡号;Luhm校验规则:16位银行卡号(19位通用):1、将未带校验位的 15(或18)位卡号从右依次编号 1 到 15(18),位于奇数位号上的数字乘以 2;2、将奇位乘积的个十位全部相加,再加上所有偶数位上的数字。
* @param {string} bankno 银行卡号
* @returns 是否为正确的银行卡号
*/
function verifyBankCardNumber(bankno) {
var lastNum = bankno.substr(bankno.length - 1, 1); //取出最后一位(与luhm进行比较)
var first15Num = bankno.substr(0, bankno.length - 1); //前15或18位
var newArr = new Array();
for (var i = first15Num.length - 1; i > -1; i--) {
@tomac4t
tomac4t / amap_search.py
Last active December 24, 2025 15:06
使用高德API搜索满足条件的两个POI
import requests
import time
import json
# 高德API密钥(请替换为您自己的密钥)
AMAP_KEY = "YOUR_API_KEY_HERE"
def search_poi_by_keyword(city, keyword):
"""使用关键字搜索POI"""
base_url = "https://restapi.amap.com/v3/place/text"
! 通用 CDN 域名
||bsccdn.net^
||gjfzpt.cn^
||jomodns.cn^
||kuiniuca.com^
||pkoplink.com^
||saxysec.com^
||szbdyd.com^
||uhabo.com^
||xycdn.com^
<!DOCTYPE html>
<html>
<head>
<title>PushState Title</title>
</head>
<body>
<h1>PushState Test</h1>
<button onclick="history.pushState(null, '', 'bar.html')">Push State</button>
</body>
</html>
@tomac4t
tomac4t / locate_me.html
Created March 31, 2024 13:47
generated by google gemini
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Locate Me</title>
</head>
<body>
<button id="find-me">Locate</button>
<p id="status"></p>
import requests
# replace github personal token
ghp = 'ghp_xxxxxxxxxxxxxxxxxxxxxxxxx'
username = 'JiaT75'
p = 0
def event(p):
params = {
@tomac4t
tomac4t / cernet2-v6.csv
Last active November 14, 2025 17:00
中国教育网学校 IPv6 地址段
IPv6 国家 省份 城市 学校/教育机构
2001:da8:0200::/48 中国 北京 北京 清华大学
2001:da8:0201::/48 中国 北京 北京 北京大学
2001:da8:0202::/48 中国 北京 北京 北京邮电大学
2001:da8:0203::/48 中国 北京 北京 北京航空航天大学
2001:da8:0204::/48 中国 北京 北京 北京理工大学
2001:da8:0205::/48 中国 北京 北京 北京交通大学
2001:da8:0206::/48 中国 北京 北京 北京城市学院
2001:da8:0207::/48 中国 北京 北京 北京师范大学
2001:da8:0208::/48 中国 北京 北京 北京科技大学
@tomac4t
tomac4t / tor-exit.csv
Last active March 16, 2026 15:49
Tor exit nodes geolocation
IP ASN Country Region City Organization
2.56.10.36 213373 Netherlands IP Connect Inc
2.58.56.35 210558 Netherlands Flevoland Lelystad 1337 Services GmbH
2.58.56.43 210558 Netherlands Flevoland Lelystad 1337 Services GmbH
2.58.56.93 210558 Netherlands Flevoland Lelystad 1337 Services GmbH
2.58.56.220 210558 Netherlands Flevoland Lelystad 1337 Services GmbH
5.2.67.226 60404 Netherlands The Infrastructure Group B.V.
5.2.72.110 60404 Netherlands The Infrastructure Group B.V.
5.2.79.179 60404 Netherlands The Infrastructure Group B.V.
5.34.182.203 15626 Ukraine Kyiv City Kyiv Green Floid LLC
@tomac4t
tomac4t / upload-release-assets.py
Last active January 17, 2023 01:16
A python script to upload the release assets via the GitHub Release API.
#!/usr/bin/python3
# A python script to upload the release assets via the GitHub Release API.
import mimetypes
import os
import requests
import sys
# Written for Github actions when release created event is triggered.
# It must set the env variables in the GitHub actions file:
# env: