CTRL + A : Move the cursor to the beginning of the line
CTRL + E : Move the cursor to the end of the line
OPTION + Left Arrow : Move the cursor one word backward
OPTION + Right arrow : Move the cursor one word forward
Left Arrow : Move the cursor one character backward
Right Arrow : Move the cursor one character forward
This file contains hidden or 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
| #Reference: https://github.com/kedro-org/kedro/issues/635 | |
| from pathlib import Path | |
| from kedro.framework.startup import _is_project, bootstrap_project | |
| from kedro.framework.context import KedroContext | |
| from kedro.framework.project import settings, find_pipelines | |
| from kedro.framework.hooks import _create_hook_manager | |
| from kedro.config import ConfigLoader | |
| @project_group.command() |
This file contains hidden or 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 logging | |
| from kedro.framework.hooks import hook_impl | |
| ## Hooks specs: https://docs.kedro.org/en/stable/kedro.framework.hooks.specs.html | |
| ## There are five types of hooks: (1) Kedro Context (2) DataCatalog (3) Pipeline (4) Node (5) Dataset | |
| class PrintEverythingHooks: | |
| _logger = None | |
| def __init__(self, log_file_path='PrintEverything.log') -> None: |
This file contains hidden or 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
| pip uninstall pyodbc -y | |
| pip install --no-binary :all: pyodbc | |
| python -c "import pyodbc" |
This file contains hidden or 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
| # Base Library Packages | |
| import _thread | |
| # Third Party Packages | |
| from pynput import keyboard | |
| from functools import wraps | |
| import sys | |
| def escape_hatch( |
This file contains hidden or 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://github.com/tqdm/tqdm | |
| # Search "bar_format" | |
| from tqdm import tqdm | |
| for i in tqdm(range(1_000_000_000), total=1_000_000_000, bar_format = "{desc}: {percentage:.2f}%|{bar}| {n:,}/{total:,} [{elapsed}<{remaining}"): | |
| pass |
This file contains hidden or 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
| #### Best first guess for Wordle | |
| # Wordle: https://www.powerlanguage.co.uk/wordle/ | |
| # Script by: @ernesthan | |
| # Created on: 13th Jan 2022 | |
| #### If not already installed, run the following lines in interactive python | |
| # import nltk | |
| # nltk.download('wordnet') | |
| # nltk.download('omw-1.4') |
This file contains hidden or 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
| # Update and check Brew | |
| brew update | |
| brew doctor | |
| # Install Postgres | |
| brew install postgresql | |
| # Start Postgres | |
| brew services start postgresql |
This file contains hidden or 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 os | |
| import pandas as pd | |
| def load_file(filedir): | |
| filenames = os.listdir(filedir) | |
| filenames.sort() | |
| filepaths = [os.path.join(filedir, filename) for filename in filenames if filename.endswith('.csv')] | |
| combined_csv = pd.concat([pd.read_csv(path) for path in filepaths]) | |
| return combined_csv |
Magic words:
psql -U postgresSome interesting flags (to see all, use -h or --help depending on your psql version):
-E: will describe the underlaying queries of the\commands (cool for learning!)-l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
NewerOlder