Skip to content

Instantly share code, notes, and snippets.

@lxfly2000
lxfly2000 / js-blacklist.txt
Last active April 1, 2025 05:43
JavaScript网站黑名单
www.baidu.com 广告 强制跳转
m.baidu.com 广告 强制跳转
image.baidu.com
cn.bing.com 广告
weibo.com
s.weibo.com
m.weibo.cn
www.zhihu.com 强制登录
blog.csdn.net 广告
sina.cn
@echo off
setlocal ENABLEDELAYEDEXPANSION
if "%~1"=="" (
echo No path specified.
goto:eof
)
call:listcd %1
goto:eof
:listcd
@lxfly2000
lxfly2000 / geoatlas_download.py
Created January 4, 2025 05:32
下载阿里云DataV.GeoAtlas的地图数据(到县级)
# python 3.11
import os
import json
from urllib import request
from urllib.error import HTTPError
def save_json(str,path):
print("保存至\""+path+".json\"")
open(path+".json","wb").write(str)
@lxfly2000
lxfly2000 / jstest.cpp
Created March 17, 2025 14:56
VC++ and JS interop using Chakra
#include<Windows.h>
#include<jsrt.h>
#pragma comment(lib,"jsrt.lib")
int WINAPI wWinMain(_In_ HINSTANCE hInst, _In_opt_ HINSTANCE hPrevInst, _In_ LPWSTR param, _In_ int iSW)
{
JsRuntimeHandle runtime;
JsContextRef context;
JsValueRef result;
unsigned currentSourceContext = 0;