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
# Switch keyboard layout (inline) | |
bind = $mainMod, SPACE, exec, switch=$(hyprctl devices -j | jq -r '.keyboards[] | .active_keymap' | uniq -c | [ $(wc -l) -eq 1 ] && echo "next" || echo "0"); for device in $(hyprctl devices -j | jq -r '.keyboards[] | .name'); do hyprctl switchxkblayout $device $switch; done; activeKeymap=$(hyprctl devices -j | jq -r '.keyboards[0] | .active_keymap'); if [ $switch == "0" ]; then resetStr="(reset)"; else resetStr=""; fi; hyprctl notify -1 1500 0 "$activeKeymap $resetStr"; | |
# Switch keyboard layout (shell script) | |
bind = $mainMod, SPACE, exec, ~/somewhere/switch_layout.sh |
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 celery | |
from tasks import FooTask | |
app = celery.Celery( | |
"app", | |
broker="amqp://", | |
) | |
FooTask.register_for_app(app) |
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 heapq | |
from collections import defaultdict | |
from dataclasses import dataclass, field | |
from enum import Enum, auto | |
class Step(Enum): | |
A = auto() | |
B = auto() | |
C = auto() |
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 asyncio | |
from concurrent.futures import ThreadPoolExecutor | |
from functools import partial | |
from typing import AsyncIterator, Iterator, TypeVar | |
T = TypeVar("T") | |
def checked_next(iterator: Iterator[T]) -> T | None: | |
try: |