Language | Name |
---|---|
Rust | Vec |
C++ | vector |
Python | list |
Java | ArrayList |
C# | List |
JavaScript | Array |
This file contains 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
use clap::Parser; | |
use regex::Regex; | |
use std::{ | |
fmt::{self, Debug, Display}, | |
str::FromStr, | |
}; | |
use thiserror::Error; | |
#[derive(Debug, Default, Clone, Copy, PartialEq, Eq)] | |
enum Browser { |
This file contains 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 dataclasses import dataclass | |
from typing import TypeVar, Generic, cast | |
T = TypeVar("T") | |
@dataclass | |
class Some(Generic[T]): | |
value: T | |
Option = Some[T] | None |
This file contains 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 ast import literal_eval | |
from collections import deque | |
from typing import Callable, Iterable | |
from more_itertools import is_sorted | |
def solve_sorted(numbers: Iterable[int], target: int) -> tuple[int, int] | None: | |
values = deque(numbers) | |
start = 0 |
This file contains 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 typing import TypeVar | |
from collections.abc import Sequence | |
from sys import argv, stderr | |
from itertools import cycle, islice | |
T = TypeVar("T") | |
def dist(index: int, length: int) -> int: | |
if not (0 <= index < length): | |
raise ValueError("index must be in [0; length)") |
I hereby claim:
- I am iamalicecarroll on github.
- I am alicecarroll (https://keybase.io/alicecarroll) on keybase.
- I have a public key ASA-Bc9gX-KSJlpBLeB4FnyfoVkAsfun_GP_gsRHHfMBGgo
To claim this, I am signing this object:
This file contains 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
shell: | |
program: /bin/fish | |
args: | |
- -C silver -c silver.toml init | source | |
- -C sleep 1000 & | |
- -C false | |
font: | |
normal: | |
family: JetBrains Mono Nerd Font Mono | |
size: 7 |
This file contains 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
:root { | |
--DarkBlack: #282828 !important; | |
--DarkRed: #cc241d !important; | |
--DarkGreen: #98971a !important; | |
--DarkYellow: #d79921 !important; | |
--DarkBlue: #458588 !important; | |
--DarkPurple: #b16286 !important; | |
--DarkAqua: #689d6a !important; | |
--DarkWhite: #a89984 !important; | |
--DarkOrange: #d65d0e !important; |
This file contains 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/zsh | |
filename="${1%.*}" | |
nasm -felf32 $1 && \ | |
ld -melf_i386 -s -o $filename $filename.o && \ | |
rm $filename.o |
This file contains 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 itertools as it | |
def group(iterable, size, fill=None): | |
yield from it.zip_longest(*[iter(iterable)] * size, fillvalue=fill) | |
if __name__ == '__main__': | |
print(*group(range(10), 3, 0), sep=', ') # -> (0, 1, 2), (3, 4, 5), (6, 7, 8), (9, 0, 0) |
NewerOlder