Skip to content

Instantly share code, notes, and snippets.

View alextremblay's full-sized avatar

Alex Tremblay alextremblay

  • University of Toronto Scarborough
  • Toronto, Canada
View GitHub Profile
[
{
"backcolor": "#666666",
"name": "BFO-9000"
},
[
{
"p": "CHICKLET",
"a": 3
},
@alextremblay
alextremblay / .bashrc
Last active March 21, 2024 18:47
atuin up-arrow mod
# replace the default:
[[ -f ~/.bash-preexec.sh ]] && source ~/.bash-preexec.sh
eval "$(atuin init bash)"
# with this:
[[ -f ~/.bash-preexec.sh ]] && source ~/.bash-preexec.sh
eval "$(atuin init bash --disable-up-arrow)"
export ATUIN_ARROW_INDEX=-1
export ATUIN_CYCLE_MODE=0
[tool.poetry]
name = "utsc.core"
version = "2022.5.13"
description = "an opinionated set of utilities designed to be easily included in any number of projects"
readme = "README.md"
authors = ["Alex Tremblay <[email protected]>", "University of Toronto Governing Council <[email protected]>"]
license = "MIT"
packages = [
{ include = "utsc/core", from = "../../src" }
]
@alextremblay
alextremblay / get_all_parks_avail.py
Created March 15, 2021 15:09
Ontario Parks Availability
from pathlib import Path
import pickle
from typing import Union
import csv
from uuid import uuid4
import requests
import arrow
@alextremblay
alextremblay / tokenizer.py
Last active July 15, 2021 15:42
An example string tokenizer / regex splitter
from __future__ import annotations
from typing import Any, Callable, List, Literal, Tuple, Union, TypeVar, cast
import regex
from regex.regex import Match
DEFAULT = '_SCANNER_DEFAULT_PATTERN' # a sentinel value
T = TypeVar('T')
class TokenMeta(type):
@alextremblay
alextremblay / Async Fetch All
Last active October 23, 2019 13:18
Asynchronously Fetch All Elements Of A REST API with Asks and Trio
The following is an example of how to asynchronously fetch all objects at a given REST API endpoint by ID, with rate limiting, using the awesome asks library
https://asks.readthedocs.io/en/latest/

Keybase proof

I hereby claim:

  • I am alextremblay on github.
  • I am alextremblay (https://keybase.io/alextremblay) on keybase.
  • I have a public key ASCRY-OTDNDA37iCUS3Ggd2iNaGcCYYs09KxF9Q8jlInlQo

To claim this, I am signing this object: