solid ascii
facet normal 0.0825722 0.0130781 0.996499
outer loop
vertex 0.682297 0.3 0.493181
vertex 0.678269 0.325431 0.493181
vertex 0.6 0.3 0.5
endloop
endfacet
facet normal 0.0744894 0.0379543 0.996499
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 | |
| # /// script | |
| # requires-python = ">=3.10" | |
| # dependencies = ["PyGObject", "pillow"] | |
| # /// | |
| """ | |
| Take a screenshot on Wayland using xdg-desktop-portal. | |
| Usage: | |
| uv run take_screenshot.py -f output.png |
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
| // Adapted from https://github.com/vercel/next.js/blob/dda62b693e3e9cf9fd566085e7372c46c16fa14a/packages/next/src/server/accept-header.ts#L13 | |
| interface Selection { | |
| pos: number | |
| q: number | |
| token: string | |
| } | |
| export function acceptedLanguages(rawHeader: string) { | |
| const header = rawHeader.replace(/[ \t]/g, '') |
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
| (async function () { | |
| const API_KEY = "YOUR_API_KEY"; | |
| const SYSTEM_PROMPT = "Summarize the following article in 10 bullet points:"; | |
| async function getSummary(text) { | |
| const API_URL = "https://api.openai.com/v1/chat/completions"; | |
| const data = { | |
| model: "gpt-3.5-turbo-16k", | |
| messages: [ | |
| { |
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
| function getSelectedText() { | |
| return window.getSelection().toString(); | |
| } | |
| let restartTimeout = null; | |
| function restartPeriodically() { | |
| window.speechSynthesis.pause(); | |
| window.speechSynthesis.resume(); | |
| restartTimeout = setTimeout(restartPeriodically, 5000); | |
| } |
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 tempfile | |
| import subprocess | |
| import openai | |
| from telegram import Update, InlineQueryResultArticle, InputTextMessageContent | |
| from telegram.ext import ( | |
| filters, | |
| MessageHandler, | |
| ApplicationBuilder, |
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 re | |
| import os | |
| import pdfminer.high_level as pdf_reader | |
| import csv | |
| PATTERNS = [ | |
| re.compile(p, re.M) | |
| for p in [ | |
| r"^Tumor Mutational Burden\s+([^\s]+|Not Evaluable)\s+mutations-per-megabase$(?:\n|\s)+Microsatellite Instability(?:\n|\s)+([^\n]+)$", |
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 re | |
| import os | |
| import pdfminer.high_level as pdf_reader | |
| import csv | |
| ignore_list = ["GENE", "MSI-High", ""] | |
| def get_pattern(text: str) -> re.Pattern[str]: | |
| if "FMI Sample ID" in text: |
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
| for path in cwd.rglob("*.py"): | |
| if 'pipstrap' in str(path): | |
| continue | |
| if str(path).count('/dev/') > 1: | |
| continue | |
| text = path.read_text() | |
| if 'analytics_view_id' not in text: | |
| continue | |
| print('replacing in ', path) | |
| for k, v in d.items(): |
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 collections | |
| import typing | |
| import unicodedata | |
| import json | |
| import re | |
| T = typing.TypeVar("T") | |
| K = typing.TypeVar("K") | |
| Message = typing.Any |
NewerOlder