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 pwsh | |
| <# | |
| "statusLine": { | |
| "type": "command", | |
| "command": "pwsh -NoProfile -File ~/.claude/statuslines.ps1" | |
| } | |
| #> | |
| # Set UTF-8 output encoding to properly display Unicode characters |
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
| # 强制设定控制台和 PowerShell 管道的编码为 UTF-8,拯救 Emoji | |
| [Console]::OutputEncoding = [System.Text.Encoding]::UTF8 | |
| [Console]::InputEncoding = [System.Text.Encoding]::UTF8 | |
| $OutputEncoding = [System.Text.Encoding]::UTF8 | |
| function Start-Mihomo { | |
| param( | |
| [string]$Path = ".\mihomo.exe", | |
| [string]$Dir = ".", | |
| [string]$Config = "config.yml" |
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
| // ==UserScript== | |
| // @name 微博 转跳时间轴 | |
| // @namespace Violentmonkey Scripts | |
| // @match https://weibo.com/* | |
| // @grant none | |
| // @version 1.0 | |
| // @author - | |
| // @description 微博首页转跳到自定义分组(根据时间排序查看微博) | |
| // ==/UserScript== | |
| (function() { |
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 | |
| D:/path/to/your.bat |
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/bash | |
| # https://stackoverflow.com/a/67658259/1265727 | |
| # solve:The source and destination cannot both be remote. | |
| # rsync error: syntax or usage error (code 1) at main.c(1428) [Receiver=3.2.7] | |
| export MSYS_NO_PATHCONV=1 | |
| wsl rsync -azhP raspi:/home/pi/www/ /mnt/z/backup/www | |
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
| # https://leetcode.com/problems/n-queens/submissions/ | |
| class Solution: | |
| def solveNQueens(self, n: int) -> List[List[str]]: | |
| queen = [0]*(n+1) | |
| # print(queen) | |
| result = [] | |
| def Place(y): | |
| for x in range(1,y): | |
| if queen[x] == queen[y] or (abs(queen[x]-queen[y]) == (y-x)): | |
| return 0 |
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
| """ | |
| https://stackoverflow.com/a/33436061/1265727 | |
| """ | |
| from contextlib import closing | |
| from socket import socket, AF_INET, SOCK_DGRAM | |
| import struct | |
| import time | |
| NTP_PACKET_FORMAT = "!12I" | |
| NTP_DELTA = 2208988800 # 1970-01-01 00:00:00 |
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
| import unittest | |
| import requests | |
| right_referer = 'https://xx.com' | |
| img_url = "https://i.xx.com/f54ae2eb228d7.jpg" | |
| content_length = 16714 | |
| AntiTheft_content_length = 41 | |
| class TestAntiTheft(unittest.TestCase): | |
| """ |
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
| from openpyxl import Workbook | |
| from openpyxl.styles import PatternFill | |
| from PIL import Image | |
| import sys | |
| ''' | |
| require: python3 pillow openpyxl | |
| usage: python3 img2excel 1.jpg out | |
| ''' |
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/1.1 200 OK | |
| Content-Type: text/html; charset=UTF-8 | |
| Server: netcat! | |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>A webpage served by netcat</title> |
NewerOlder