Skip to content

Instantly share code, notes, and snippets.

View Lonenso's full-sized avatar

Peter Lonenso

  • China XMN
  • 23:24 (UTC +08:00)
View GitHub Profile
@Lonenso
Lonenso / index.html
Created August 4, 2023 01:10
ipc benchmark
<p>Send / Receive payload using ArrayBuffer, see output in devtools.</p>
<button id='send'>Send payload to main</button>
<button id='receive'> Receive payload from main</button>
<script src="renderer.js"></script>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<!-- https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP -->
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'">
<title>Hello World!</title>
</head>
<body>
<h1>Hello World!</h1>
@Lonenso
Lonenso / index.html
Last active July 13, 2023 02:22
sentry demo
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<!-- https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP -->
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'">
<title>Hello World!</title>
</head>
<body>
<h1>Hello World!</h1>
from zhdate import ZhDate
from datetime import datetime
def nextYear(date):
date = datetime(date.year + 1, date.month, date.day)
zhDate = ZhDate.from_datetime(date)
return date, zhDate
def matched(date, zhDate, orignalDate, originalZhDate):
month = date.month == orignalDate.month and zhDate.lunar_month == originalZhDate.lunar_month
import re
import sys
import signal
# TODO: How to increase the possibility for turning yellow to green?
def stupid_wordle_solver(wordlist, exclude, include, pattern="_____", limit=5):
assert(len(exclude) != 0)
exclude_pattern = pattern.replace('_', f"[^{exclude}")
candidates = []
@Lonenso
Lonenso / blacklist.txt
Last active July 13, 2023 04:10
personal blacklist for chrome extension: uBlacklist
*://0955zn.com/*
*://118.119.9.140/*
*://124.128.244.211/*
*://202.114.181.28/*
*://218.75.15.78/*
*://221.182.185.154/*
*://240722753.kantonalcup.ch/*
*://24h.m.pchome.com.tw/*
*://27.195.3.39/*
*://360ai.org/*