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
| name: install crate binary | |
| description: Install a Rust crate from a GitHub release asset | |
| inputs: | |
| repo: | |
| description: The GitHub repository containing the crate (e.g., "casey/just") | |
| required: true | |
| tag-prefix: | |
| description: The prefix to match the release tag (e.g., "name/" for tags like "name/v1.2.3") |
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 | |
| from dataclasses import dataclass | |
| import os | |
| from pathlib import Path | |
| import re | |
| import subprocess | |
| import sys | |
| from typing import Literal, Optional |
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 rust-script | |
| //! ```cargo | |
| //! [dependencies] | |
| //! anyhow = "1.0.96" | |
| //! argh = "0.1.13" | |
| //! casual = "0.2.0" | |
| //! indexmap = "2.7.1" | |
| //! serde = { version = "1.0.218", features = ["derive"] } | |
| //! serde_json = "1.0.139" | |
| //! ureq = { version = "3.0.8", features = ["json"] } |
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
| // Result of running https://gist.github.com/ToadKing/b883a8ccfa26adcc6ba9905e75aeb4f2 | |
| // through https://github.com/abend0c1/hidrdd | |
| // | |
| //-------------------------------------------------------------------------------- | |
| // Decoded Application Collection | |
| //-------------------------------------------------------------------------------- | |
| /* | |
| 05 01 (GLOBAL) USAGE_PAGE 0x0001 Generic Desktop Page | |
| 15 00 (GLOBAL) LOGICAL_MINIMUM 0x00 (0) <-- Info: Consider replacing 15 00 with 14 |
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
| class Window: | |
| def __init__(self, *args, window=2, step=1): | |
| self.iterator = iter(*args) | |
| self.window = window | |
| self.step = step | |
| self.buffer = () | |
| def __iter__(self): | |
| return self |
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 | |
| containers=$(docker ps -a -q) | |
| # Stop all containers | |
| if [ ! -n "$containers" ]; then | |
| docker stop $containers | |
| docker rm $containers | |
| fi |
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 inspect | |
| import pickle | |
| def allow_picklable_inner_classes(cls): | |
| for name in dir(cls): | |
| inner = getattr(cls, name) | |
| if not name.startswith('_') and inspect.isclass(inner): | |
| new_name = '{}.{}'.format(cls.__name__, inner.__name__) |
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
| class DictSet(dict): | |
| """ | |
| A dictionary type that allows set operations for nested dictionaries. | |
| """ | |
| def __or__(self, other): | |
| return self.union(other) | |
| def __and__(self, other): | |
| return self.intersection(other) |