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
| #include <stdint.h> | |
| #include <sys/ioctl.h> | |
| #include <stdio.h> | |
| #include <unistd.h> | |
| #include <stdbool.h> | |
| #include <string.h> | |
| #include <stdlib.h> | |
| #include <errno.h> | |
| #include <signal.h> |
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 Foundation | |
| import IOKit | |
| import IOKit.hid | |
| class KeyboardCapture { | |
| var manager: IOHIDManager | |
| init() { | |
| manager = IOHIDManagerCreate(kCFAllocatorDefault, IOOptionBits(kIOHIDOptionsTypeNone)) |
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
| #include <ranges> | |
| #include <type_traits> | |
| #include <vector> | |
| #include <list> | |
| #include <iostream> | |
| template <typename T> requires std::ranges::sized_range<T> | |
| T &&merge_sort(T &&arr) { | |
| if (std::ranges::size(arr) < 2) return std::forward<T>(arr); | |
| auto mid_len = std::ranges::size(arr) / 2; |
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
| #include <stdint.h> | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| struct list { | |
| struct list *next; | |
| int n; | |
| }; | |
| struct list *new_list(int *arr, size_t 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
| GUA = [63, 0, 17, 34, 23, 58, 2, 16, 55, 59, 7, 56, 61, 47, 4, 8, 25, 38, 3, 48, 41, 37, 32, 1, 57, 39, 33, 30, 18, 45, 28, 14, 60, 15, 40, 5, 53, 43, 20, 10, 35, 49, 31, 62, 24, 6, 26, 22, 29, 46, 9, 36, 52, 11, 13, 44, 54, 27, 50, 19, 51, 12, 21, 42] # fmt: skip | |
| def bit2gua(bit6: int) -> str: | |
| return chr(0x4DC0 + GUA.index(bit6 & 0x3F)) | |
| def byte_segment(in_byte: bytes) -> bytearray: | |
| ret: bytearray = [] | |
| rem = 0 |
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
| { | |
| inputs = { | |
| nixpkgs.url = "github:cachix/devenv-nixpkgs/rolling"; | |
| systems.url = "github:nix-systems/default"; | |
| devenv.url = "github:cachix/devenv"; | |
| devenv.inputs.nixpkgs.follows = "nixpkgs"; | |
| }; | |
| nixConfig = { | |
| extra-trusted-public-keys = |
OlderNewer