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
| void rot18(char *c) | |
| { | |
| while (*c) | |
| { | |
| if (*c >= 'A' && *c <= 'Z') | |
| *c = ('A' + (*c - 'A' + 13) % 26); | |
| else if (*c >= 'a' && *c <= 'z') | |
| *c = ('a' + (*c - 'a' + 13) % 26); | |
| else if (*c >= '0' && *c <= '9') | |
| *c = ('0' + (*c - '0' + 5) % 10); |
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
| ; PlatformIO Project Configuration File | |
| ; | |
| ; Build options: build flags, source filter | |
| ; Upload options: custom upload port, speed and extra flags | |
| ; Library options: dependencies, extra library storages | |
| ; Advanced options: extra scripting | |
| ; | |
| ; Please visit documentation for the other options and examples | |
| ; https://docs.platformio.org/page/projectconf.html |
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
| from itertools import count, groupby | |
| from typing import Iterable, Tuple | |
| def group_consecutive(nums: Iterable[int]) -> Iterable[Tuple[int, ...]]: | |
| counter = count() | |
| for _, g_it in groupby(nums, lambda n: n - next(counter)): | |
| yield tuple(g_it) | |
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 currentTheme() { | |
| const currentTheme = localStorage.getItem("theme") || "auto"; | |
| const prefersDark = window.matchMedia("(prefers-color-scheme: dark)").matches; | |
| if (currentTheme === "auto") { | |
| return prefersDark ? "dark" : "light"; | |
| } | |
| return currentTheme; | |
| } |
OlderNewer