For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.
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
| fyi | |
| const x = HTMLWidgets.getInstance( document.getElementById( <ID> ) ); | |
| x.getMap() | |
| leaflet(elementId = 'hello', | |
| options = leafletOptions(preferCanvas = F)) %>% | |
| addPolygons(lat = c(1,2), | |
| lng = c(1,2) |
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 | |
| projects_df.set_index('id').isna().groupby(level=0).sum()['ServiceAccount'].sum() |
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
| pd_df['column'].str.lower().str.strip() |
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://airflow.apache.org/docs/apache-airflow/stable/installation/installing-from-pypi.html | |
| python -m venv .venv | |
| source .venv/bin/activate | |
| # AIRFLOW_VERSION=2.6.3 | |
| export AIRFLOW_HOME=~/airflow | |
| sudo pip3 install "apache-airflow[celery]==2.6.3" --constraint "https://raw.githubusercontent.com/apache/airflow/constraints-2.6.3/constraints-3.10.txt" |
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
| def read_file(filename): | |
| with open(filename, 'r') as f: | |
| content = f.read() | |
| f.close() | |
| return content | |
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
| echo "Logfile started: $(date +'%D %T'$" > log.txt |
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 | |
| logging.basicConfig(level=logging.INFO, format="%(asctime)s - %(name)s - %(levelname)s - %(message)s") | |
| logging.info(f'This is a logging message with an {fstring}') | |
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 yaml | |
| yaml.load(open(<path_to_yaml_config>, 'r'), Loader=yaml.SafeLoader) | |
| # convert json to yaml and back again. | |
| import json | |
| with open('config.json', 'r') as file: | |
| configuration = json.load(file) |
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
| library(plotly) | |
| fig <- plot_ly( | |
| type = 'scatter', | |
| mode='markers', | |
| y=rep(5, 40), | |
| marker=list( | |
| size=seq(0, 39), | |
| color=seq(0, 39), | |
| colorbar=list( |
NewerOlder