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 functools import reduce | |
import itertools | |
from collections.abc import Generator | |
def combinations[T]( | |
lst: list[T], k: int, combo: list[T] = None) -> Generator[list[T]]: | |
""" Yield combinations of the list of size k """ | |
if combo is None: | |
combo = [] |
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 serial | |
import serial.tools.list_ports | |
import sys | |
# Common NMEA baud rates | |
BAUD_RATES = [4800, 9600, 38400, 115200] | |
def main(): | |
# Find available COM ports | |
ports = [port.device for port in serial.tools.list_ports.comports()] |
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
@echo off | |
doskey gsu=git status -uno | |
doskey gs=git status | |
doskey gpr=git pull -r | |
doskey gf=git fetch | |
doskey gc=git commit $* | |
doskey ga=git add $* | |
doskey gch=git checkout $* | |
doskey gka=gitk --all | |
doskey gla=git log --graph --pretty=format:"%%Cred%%h%%Creset -%%C(yellow)%%d%%Creset %%s %%Cgreen(%%cr) %%C(bold blue)<%%an>%%Creset" --all |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
(* Non tail-recursive list len function *) | |
let rec len lst = | |
match lst with | |
| [] -> 0 | |
| _::t -> 1 + len t | |
(* Tail-recursive list len function *) | |
let len_tr lst = | |
let rec len_tr' lst current_len = | |
match lst with |
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
def remove(path: pathlib.Path): | |
""" Remove a file or non-empty directory. | |
Unlink only works on files, and rmdir requires the directory to be empty | |
""" | |
if not path.is_dir(): | |
path.unlink() | |
return | |
for child in path.iterdir(): | |
remove(child) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 datetime import datetime, timedelta, timezone | |
import google.auth | |
from google.auth.transport import requests | |
from google.cloud import storage | |
def ingest(): | |
"""This endpoint responds with a presigned URL for GCP upload.""" |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
NewerOlder