-
Review the code for the ocrs-cli crate which is a CLI tool for OCR. Then make a plan to implement a new feature which will allow processing images taken from the system clipboard. The feature should be behind aclipboardCargo feature which is disabled by default. To read from the clipboard, the arboard crate (https://docs.rs/arboard/latest/arboard/) should be used. -
`Implement the following plan:
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 | |
| import argparse | |
| import json | |
| import os | |
| import sys | |
| import time | |
| from datetime import datetime, timezone | |
| from typing import List, Dict, Any, Optional |
- Download Microsoft Edge VM from https://developer.microsoft.com/en-us/microsoft-edge/tools/vms/
- Download Virtualbox and import the Edge VM image.
Then in the VM:
- Install guest addons in the VM
- Download & install latest NVDA from nvaccess.org
- Download & install SharpKeys and use it to map left an alternative key (eg. Left Ctrl) to the Insert key. This is needed because Macs do not typically have an “Insert” key which is the prefix for many NVDA commands.
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> | |
| <body> | |
| <div id="app"></div> | |
| <script type="importmap"> | |
| { | |
| "imports": { | |
| "preact": "https://unpkg.com/preact@10.25.4/dist/preact.module.js", | |
| "preact/hooks": "https://unpkg.com/preact@10.25.4/hooks/dist/hooks.module.js" | |
| } | |
| } |
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 getpass | |
| import json | |
| import re | |
| import sys | |
| import requests | |
| GROUP_URL_PATTERN = "https://hypothes.is/groups/([^/]+)/.*" | |
| api_token = getpass.getpass( |
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
| # Analysis of Hypothesis Python app routes as part of | |
| # https://github.com/hypothesis/playbook/issues/1797#issuecomment-2397242000. | |
| import os | |
| import ast | |
| import sys | |
| def find_py_files(root_dir): | |
| excluded_dirs = ["node_modules", "build", "test", "tests", "third_party"] |
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
| # Script to fetch and print the transcript for a YouTube video using the | |
| # YouTube Data API v3. | |
| # | |
| # 1. Create a project in the Google API Console | |
| # 2. Enable the YouTube Data API v3 for the new project | |
| # 3. Create credentials for a "Desktop" OAuth client. Download the JSON file | |
| # containing the credentials at the end of the setup process. | |
| # 4. Create a new virtualenv and install dependencies with: | |
| # | |
| # ``` |
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
| #include <algorithm> | |
| #include <chrono> | |
| #include <iostream> | |
| #include <iterator> | |
| #include <random> | |
| #include <vector> | |
| #include <Accelerate/Accelerate.h> | |
| #include <cblas.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
| import cv2 | |
| import numpy as np | |
| import argparse | |
| def warp_quadrilateral( | |
| input_path: str, | |
| src_points: list[tuple[int, int]], | |
| output_path: str, | |
| output_size: tuple[int, int], |
NewerOlder