- BLE Library Docs: Bleak
- Might have to
pip3 install bleakfirst
- Might have to
- Protocol Docs from Sensirion: Link
- I'm listening for the BLE advertisement here (see p4 for data structure)
- Calculation of measurements from ticks see p7, "3.9 Sample 8"
- You can get the device address from the
scan.pyscript (doesn't always show the name for some reason) or a tool like BlueSee - Code to get the data is in
log-data.py
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 bash | |
| set -euo pipefail | |
| # Usage: git todo [base-branch] [--allcase] [--strict] | |
| # Default base branch = develop. | |
| base=${1:-develop} | |
| shift || true | |
| match_case=0 # 0 = case-sensitive (ignore "todos"), 1 = case-insensitive |
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 PyPDF2 | |
| from io import BytesIO | |
| def extract_pdf_pages(pdf_path, first_page, last_page): | |
| """ | |
| Extract specific pages from a PDF file. | |
| Args: | |
| pdf_path (str): Path to the input PDF file. | |
| first_page (int): 1-based index of the first page to extract. |
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
| # Extracts text from a PDF file and copies it to clipboard | |
| # This relies on pdftotext, which you can install via "brew install poppler" | |
| # pbcopy is available by default on macOS, but if you're on linux, this won't work | |
| ptxt() { | |
| if [[ -z "$1" ]]; then | |
| echo "Usage: ptxt <path_to_pdf>" | |
| return 1 | |
| fi | |
| local pdf_path="$1" |
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
| /* | |
| * Set these as userstyles for the respective domain to hide everything but | |
| * notifications, messages, and the option to write a tweet. | |
| * | |
| * Originally from Beck Tench (twitter.com/@10ch) | |
| */ | |
| /* twitter.com */ | |
| [role="complementary"] {visibility: hidden;} | |
| [data-testid="sidebarColumn"] {visibility: hidden;} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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/python3 | |
| def copy_file(src, dest, header): | |
| with open(dest, "w+") as d: | |
| d.write(header + "\r\n") | |
| with open(src) as s: | |
| for line in s: | |
| d.write(line) |
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/python3 | |
| def fibonacci(n): | |
| if n <= 1: | |
| return 1 | |
| return fibonacci(n-1) + fibonacci(n-2) | |
| print([fibonacci(i) for i in range(20)]) |
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/python3 | |
| def sum_of_digits(number): | |
| digit_sum = 0 | |
| for digit in str(number): | |
| digit_sum += int(digit) | |
| return digit_sum | |
NewerOlder