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 as dt | |
from croniter import croniter | |
from functools import wraps | |
from typing import Dict, Any | |
def cache_with_schedule(schedule: str): | |
""" | |
Decorator to cache the results of a function "f(x)" and clear the cache as | |
scheduled. |
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/bash | |
# This script is useful to update branches that are based on a branch | |
# that was just merged to "master". | |
# | |
# As an example, suppose you have an open Merge Request based on branch "B1" | |
# and, while you are waiting for reviews, you start working on another | |
# branch, "B2", which is created directly from "B1". | |
# After a few commits on "B2", your MR gets reviewd and "B1" is merged to | |
# "master". | |
# Now your code on "B2" is ready for review and you want to create a new |
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
""" | |
Knapsacks have weight capacity; items have weight and value. | |
We want to find the allocation of items which maximizes the total | |
carried value. | |
""" | |
from typing import List, Set, Tuple | |
OlderNewer