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 sshtunnel import SSHTunnelForwarder | |
from sqlalchemy import create_engine | |
from sqlalchemy.orm import sessionmaker | |
from functools import wraps | |
# secrets.py contains credentials, etc. | |
import secrets | |
def get_engine_for_port(port): | |
return create_engine('postgresql://{user}:{password}@{host}:{port}/{db}'.format( |
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
# https://en.wikipedia.org/wiki/Second-level_domain | |
# https://www.quackit.com/domain-names/country_domain_extensions.cfm | |
from collections import defaultdict | |
second_level_domains_by_country_code = defaultdict(set) | |
d = second_level_domains_by_country_code | |
# Afghanistan | |
d['af'] = set(( | |
'com', | |
'edu', |
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 | |
from math import sin, cos, pi | |
days_in_month = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31] | |
def sin_cos(n): | |
theta = 2 * pi * n | |
return (sin(theta), cos(theta)) | |
def get_cycles(d): |
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
Brain fog coping strategies | |
Intro: Playfulness and experimentation will help you find strategies that work for you. | |
Memory | |
Navigating your memory landscape (vs constructing memory palaces) | |
The problem with mnemonics | |
Mnemonic techniques (such as memory palaces) are powerful, but ... | |
Mnemonics only help when you know ahead of time exactly what you want to remember _and_ when writing it down is not sufficient _and_ when you have the time and energy to do the encoding | |
Very few cases meet this criteria | |
Memorizing foreign language vocabulary | |
Memorizing material for an exam |
OlderNewer