Skip to content

Instantly share code, notes, and snippets.

View tony9527167's full-sized avatar
💭
I may be slow to respond.

tony9527167 tony9527167

💭
I may be slow to respond.
View GitHub Profile
@tony9527167
tony9527167 / MSVS-Links.md
Created October 23, 2025 12:54 — forked from Postrediori/MSVS-Links.md
MS Visual Studio Installers and ISO direct links
@tony9527167
tony9527167 / Vehicle registration plates of Hong Kong.md
Last active May 31, 2025 06:10
Vehicle registration plates of Hong Kong
@tony9527167
tony9527167 / fix.ananke.diff
Created May 11, 2025 16:40
fix theme/ananke for hugo v0.147.2+extended
diff --git a/layouts/partials/social-share.html b/layouts/partials/social-share.html
index 14ae033..18d8be6 100644
--- a/layouts/partials/social-share.html
+++ b/layouts/partials/social-share.html
@@ -3,7 +3,7 @@
{{ $facebook_href := printf "https://www.facebook.com/sharer.php?u=%s" $url }}
{{ $twitter_href := printf "https://twitter.com/intent/tweet?url=%s&text=%s" $url $title }}
-{{ with site.Social.twitter }}
+{{ with site.Params.twitter }}

Checkbox Tables in Markdown

An attempt to make a list of the supported ways to make a table with checkboxes in Markdown.

Results as of October 2023.


Below is the style element that formats the colors of the colored check mark emojis.

@tony9527167
tony9527167 / analysisContainerFmts.py
Created April 6, 2025 16:59
stat top 10 media video audio codec and extension
# stat top contrainer formats, audio & video codes
import os
import typing
import ffprobe
def printTopN(m: typing.Dict[str, int], n: int, title: str):
sorted_m = []
for ext, c in m.items():
sorted_m.append((ext, c))
@tony9527167
tony9527167 / http-post-client-implement.py
Created April 6, 2025 16:02
HTTP POST client implementation
#-*- coding:utf-8 -*-
import cgi
import socket
import urllib
# 示例一:客户端以 application/x-www-form-urlencoded 方式 POST 数据实现,通常用于 POST 简单的字符串key-value对
d = {
"namename": "test",
"password": "secret",
}
@tony9527167
tony9527167 / wsgi_profiler.py
Created April 6, 2025 16:00
Flask custom ProfilerMiddleware
#coding:utf-8
import os
import sys
import time
from werkzeug.contrib.profiler import ProfilerMiddleware
from werkzeug.contrib.profiler import Stats
from werkzeug.contrib.profiler import Profile
from werkzeug.contrib.profiler import available
@tony9527167
tony9527167 / profiler.py
Created June 30, 2024 02:45
Profiler for Django view function or Django REST framework ViewSet function.
"""
Profiler for Django view function or Django REST framework ViewSet function.
See also
- https://docs.python.org/3/library/profile.html
- https://code.djangoproject.com/wiki/ProfilingDjango
- https://github.com/pallets/werkzeug/blob/3.0.x/src/werkzeug/middleware/profiler.py
"""
import os.path
import functools
@tony9527167
tony9527167 / settings.py
Created June 24, 2024 02:36
custom Django logging
LOGGING = {
"version": 1,
"disable_existing_loggers": False,
'formatters': {
'default': {
'format': '%(asctime)s %(filename)s:%(lineno)d [%(levelname)s] %(message)s',
'style': '%',
},
},
import 'dart:async';
import 'dart:convert';
import 'dart:io';
import 'package:http2/http2.dart';
void main() async {
var uri = Uri.parse('https://www.bing.com/?q=http2&mkt=zh-CN');
var transport = await connectTunnel('127.0.0.1', 7890, uri.host);
var headers = [
Header.ascii(':method', 'GET'),