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/sh | |
help() { | |
echo 'up/down [DEVICE]' | |
echo 'status [DEVICE]' | |
} | |
is_available() { | |
uci show pbr | grep -q "pbr.$1=policy" | |
} |
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
# Runs the entire test suite by default | |
# + | a - addition | |
# - | s - subtraction | |
# * | m - multiplication | |
# / | d - division | |
# p - printing | |
# -q - quiet mode | |
# -s - stop after the first failed test and copy it to clipboard (linux only) | |
import os |
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 json | |
import random | |
import time | |
import requests | |
from collections.abc import Callable, Generator | |
from dataclasses import dataclass | |
from enum import Enum | |
from typing import Any | |
class Poller: |
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 | |
# Usage: | |
# git gpt [-c COUNT] - Generate commit message with OpenAI GPT-4o-mini | |
# Installation | |
# 1. Install this script somewhere in `$PATH` | |
# 2. Create `${HOME}/.secrets/openai.secret` and put your OpenAI api key there | |
# 3. Run `git gpt` | |
import os |
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 bs4 | |
import requests | |
import re | |
URL = input("URL: ") | |
p = re.compile(r"<.*") | |
p2 = re.compile(r"(\d+\.?){4}") | |
s = bs4.BeautifulSoup(requests.get(URL).text, features='lxml') | |
for item in s.select("a.btn.btn-default.btn-block"): |