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
| # karabiner elements for key mapping | |
| # brew or get .pkg from https://github.com/Homebrew/brew/releases/ | |
| /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" | |
| # oh my zsh | |
| sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" | |
| # https://gist.github.com/n1snt/454b879b8f0b7995740ae04c5fb5b7df |
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 pandas as pd | |
| import numpy as np | |
| df = pd.DataFrame( | |
| [ | |
| ["id_0", "2023-11-01", np.nan, 1, 0.5], | |
| ["id_0", "2023-11-02", 0.5, 2, np.nan], | |
| ["id_0", "2023-11-03", np.nan, np.nan, np.nan], # device in baseline | |
| ["id_0", "2023-11-04", np.nan, np.nan, np.nan], # device in baseline | |
| ["id_0", "2023-11-05", np.nan, 1.0, np.nan], |
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
| from typing import List | |
| import pandas as pd | |
| df = pd.DataFrame( | |
| [ | |
| ["device_1", None, 1.0, 2.0, None, None, 3.0], | |
| ["device_2", 1.0, None, 2.0, None, None, None], | |
| ], | |
| columns=["device_id", "0", "1", "2", "3", "4", "5"], | |
| ) |
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 pandas as pd | |
| df = pd.DataFrame( | |
| [ | |
| ["2023-01-01", "device_1", 800, True], | |
| ["2023-01-01", "device_2", 900, True], | |
| ["2023-01-02", "device_1", 800, True], | |
| ["2023-01-02", "device_3", 900, True], | |
| ["2023-01-03", "device_2", 900, True], | |
| ["2023-01-04", "device_1", 999, True], |
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
| ssh-keygen | |
| sudo apt install git | |
| sudo apt install curl zsh | |
| sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" | |
| # log out then back in | |
| # vscode: https://code.visualstudio.com/docs/?dv=linux64_deb |
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
| from airflow import DAG | |
| from airflow.decorators import task | |
| from google.cloud import aiplatform | |
| ENV = "my-env-name" | |
| PIPELINE_SPEC_URI = f"gs://bucket/something/something/pipeline-spec-{ENV}.json" | |
| PROJECT_ID = f"my-project-id-{ENV}" | |
| REGION = "moon-southpole1" | |
| PIPELINE_ROOT = f"gs://some-bucket/" |
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
| with DAG( | |
| ... | |
| ) as dag: | |
| my_task = PythonOperator( | |
| task_id="some-name", | |
| python_callable=invoke_container, | |
| op_kwargs={ | |
| "url": URL, | |
| "my_param": "toto", | |
| }, |
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
| from airflow.providers.google.common.utils import ( | |
| id_token_credentials as id_token_credential_utils, | |
| ) | |
| from google.auth.transport.requests import AuthorizedSession | |
| A_GLOBAL_PARAM = 57 | |
| def invoke_container(url: str, my_param: str, **kwargs) -> bool: |
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 re | |
| files_to_include = [ | |
| 'my_class.py', | |
| 'dir/other_file.py', | |
| 'main.py' # << finish by main | |
| ] | |
| output_file = 'bundled_code.py' |
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
| # get core temperature | |
| vcgencmd measure_temp | |
| # spotify | |
| curl -sL https://dtcooper.github.io/raspotify/install.sh | sh |
NewerOlder