Some common variables for all functions
const NOTION_API_KEY = process.env.NOTION_API_KEY;
const headers = {
Accept: "application/json",
"Notion-Version": "2021-08-16",
"Content-Type": "application/json",
from botocore.loaders import create_loader | |
from botocore.regions import EndpointResolver | |
endpoints = create_loader().load_data('endpoints') | |
partitions = [part['partition'] for part in endpoints['partitions']] | |
for partition in partitions: | |
s3_regions = EndpointResolver(endpoints).get_available_endpoints("s3", partition) | |
aws_partition = next( |
Some common variables for all functions
const NOTION_API_KEY = process.env.NOTION_API_KEY;
const headers = {
Accept: "application/json",
"Notion-Version": "2021-08-16",
"Content-Type": "application/json",
curl -s https://www.checkiday.com/rss.php \ | |
| grep -o -E "<title><\!\[CDATA\[[^<]+</title>" \ | |
| sed -E "s/.+CDATA\[(.+)\]\].+/\\1/" \ | |
| head -n1 | |
# Curling is Cool Day |
from bs4 import BeautifulSoup, Comment | |
from typing import Dict, List, Optional, Tuple | |
AllowedTagsType = Dict[str, Optional[List[str]]] | |
# Example: | |
default_allow_tags = { | |
"p": None, | |
"b": None, # Allow no property |
<script>
Array.prototype.slice.call(document.querySelectorAll("a[href^=http]")).map((el)=> {
el.setAttribute("target", "_blank");
el.setAttribute("title", el.href);
el.setAttribute("rel", "noopener");
});
You can add the following functions for your shell, loadenv
will search for .env file if found will export all to the shell session with unloadenv
will unset the variables so you can start again, reloadenv
will reread the .env file.
function loadenv {
test -f .env || echo "No .env file in the working directory"
oldenv=$(env|sort)
export $(grep -v '^#' .env | xargs -d '\n')
diff <(echo "$oldenv") <(env | sort)
Most packages still fail due peer dependency version resolve. Packages like expo-cli. To be able to install it make sure you have the legacy mode for resolving versions is enabled
npm config --global set legacy-peer-deps true
import base64 | |
import hashlib | |
import secrets | |
from typing import NoReturn | |
def pbkdf2(password: str, salt: str, iterations: int, dklen: int=0, digest=None): | |
"""Return the hash of password using pbkdf2.""" | |
if digest is None: | |
digest = hashlib.sha256 |
INKSCAPE_BIN ?= flatpak run org.inkscape.Inkscape | |
iconsizes = 16 32 48 57 60 72 76 96 120 144 152 180 192 256 300 | |
iconnames = $(addsuffix .png, $(addprefix icons/icon-, $(iconsizes))) | |
all: icons icons/favicon.ico $(iconnames) | |
@echo = Done = | |
icons: | |
mkdir -p icons |