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 { atom, type WritableAtom } from 'jotai' | |
| import * as Y from 'yjs' | |
| import { isEqual } from 'es-toolkit/compat' | |
| /** | |
| * Thin, typed bridge between Yjs types and Jotai atoms. | |
| * | |
| * Design goals: | |
| * - Minimal abstraction: only subscribe, snapshot(read), and write via native Yjs ops. | |
| * - Narrow subscriptions by default (type.observe). Opt-in deep observation if needed. | |
| * - No double updates: do not set after write; rely on Y events to propagate. |
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 PIL import Image | |
| def extract_red_remove_white_black(image_path, output_path, make_transparent=True): | |
| """ | |
| 提取图片中的红色,去掉白色和黑色 | |
| :param image_path: 输入图片路径 | |
| :param output_path: 输出图片路径 | |
| :param make_transparent: 是否创建透明背景 | |
| """ |
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 | |
| # Define colors | |
| RED='\033[0;31m' | |
| GREEN='\033[0;32m' | |
| YELLOW='\033[1;33m' | |
| BLUE='\033[0;34m' | |
| PURPLE='\033[0;35m' | |
| CYAN='\033[0;36m' | |
| NC='\033[0m' # No Color |
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
| // How to use: node DownloadWeChatStickers_macOS.js | |
| // Requirements: curl, node | |
| // Reference: https://blog.jogle.top/2022/08/14/macos-wechat-sticker-dump/ | |
| const { execSync } = require('child_process'); | |
| const { randomUUID } = require('crypto'); | |
| const fs = require('fs'); | |
| const exec = require('child_process').exec; | |
| const os = require('os'); | |
| const argv = process.argv.slice(2); |
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
| # Get the owner of the repository to which you contributed (Pull Requests) | |
| gh api graphql --paginate -f query=' | |
| query($endCursor: String) { | |
| user(login: "username") { | |
| pullRequests(first: 100, after: $endCursor, states: MERGED) { | |
| nodes { repository { owner { login } } } | |
| pageInfo { | |
| hasNextPage | |
| endCursor |
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
| /** | |
| * ASCII - CAM | |
| * Fork from @iveseenthedatk | |
| * https: //hellogithub.com/onefile/code/126093303b6b414dbab9d623c957fdd4 | |
| **/ | |
| (() => { | |
| 'use strict'; | |
| let interval; // 用于记录定时器的id | |
| let r_layer, g_layer, b_layer; // 用于记录每个颜色通道的canvas |
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
| <html lang="en"><head> | |
| <meta charset="UTF-8"> | |
| <meta name="author" content="iveseenthedark"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1"> | |
| <meta name="theme-color" content="#333333"> | |
| <title>A S C I I C A M</title> | |
| <style>#ascii-cam pre,body,html{width:100vw;height:100vh;margin:0}*{box-sizing:border-box}body{overflow:hidden;background-color:#000;color:#eee;font-family:monospace}#logo,#enable-cam-msg{transform:translate(-50%,-50%);position:absolute;left:50%;top:50%}.fade{transition:opacity 0.25s ease-in-out}#logo{line-height:1.5}#ascii-cam{opacity:0}#ascii-cam pre{position:absolute;top:0;left:0;overflow:hidden;line-height:0.6;user-select:none;mix-blend-mode:screen;font-size:1.2em;font-size:2vh}@media (max-height:50em){#ascii-cam pre{font-size:1em}}@media (min-height:60em){#ascii-cam pre{font-size:1.2em}}#ascii-cam #r-output{color:red}#ascii-cam #g-output{color:#0f0}#ascii-cam #b-output{color:#00f}#enable-cam-msg{opacity:0;font-size:3rem;background-color:white;color: |