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
| #!/usr/bin/env python3 | |
| from __future__ import annotations | |
| """ | |
| clip2file.py — 将剪贴板中的长文本/富文本保存为 Markdown 文件, | |
| 并将"文件对象"写回剪贴板(可在邮件/聊天/IDE 中直接粘贴附件)。 | |
| 富文本处理策略(参考 paste-to-markdown Raycast 扩展): | |
| 1. 用 osascript 读取剪贴板的 HTML 格式(保留链接、格式信息) | |
| 2. 用内置 html.parser 将 HTML 转为 Markdown(不转义下划线等正文字符) | |
| 3. 回退:若剪贴板无 HTML,直接使用 pbpaste 纯文本 |
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 main | |
| import ( | |
| "fmt" | |
| "testing" | |
| "time" | |
| ) | |
| // WHY: | |
| // |
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 main | |
| import ( | |
| "fmt" | |
| "github.com/google/go-cmp/cmp" | |
| ) | |
| func isSpace(b byte) bool { | |
| switch b { |
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 log | |
| import ( | |
| "bytes" | |
| "path" | |
| "time" | |
| "github.com/gin-gonic/gin" | |
| "github.com/lestrrat/go-file-rotatelogs" | |
| "github.com/pkg/errors" |
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
| #ifndef __AE_H__ | |
| #define __AE_H__ | |
| #include <time.h> | |
| #define AE_OK 0 | |
| #define AE_ERR -1 | |
| #define AE_NONE 0 /* No events registered. */ | |
| #define AE_READABLE 1 /* Fire when descriptor is readable. */ |
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
| """ | |
| redis proxy | |
| 用来展示redis协议 | |
| """ | |
| import asyncio | |
| redis_addr = ('127.0.0.1', 6379) | |
| proxy_addr = ('127.0.0.1', 6380) | |
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
| //http://www.it165.net/os/html/201308/5868.html | |
| #include <sys/socket.h> | |
| #include <sys/wait.h> | |
| #include <netinet/in.h> | |
| #include <netinet/tcp.h> | |
| #include <sys/epoll.h> | |
| #include <sys/sendfile.h> | |
| #include <sys/stat.h> | |
| #include <unistd.h> | |
| #include <stdio.h> |
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
| #!/bin/sh | |
| # 版本号类似于 MAJOR.MINOR.PATCH 遵循 Semantic Versioning 2.0.0: | |
| # MAJOR: 主版本号,不兼容的修改,如:底层重构、框架层变动 | |
| # MINOR:次版本号,向前兼容的修改,如:增加新功能、代码优化 | |
| # PATCH: 小版本号,修复bug | |
| PREFIX=v | |
| DEFAULT_VERSION=0.0.0 | |
| # 获取git版本号 |
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
| 0xA62D03dA4F56043663859c9173E8E6ad9A24C40a |
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 main | |
| import ( | |
| "bytes" | |
| "fmt" | |
| "strconv" | |
| ) | |
| const STEP, NUM = 4, 40 |
NewerOlder