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
# Script that uses github API to restore all files from directory | |
# Get API token from Settings > Developer Setting > Personal Access Token > Fine Grained Token | |
import requests | |
from datetime import datetime | |
headers = { | |
"Authorization": "<TOKEN>" | |
} |
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
##################################################### | |
# Use GPT-3 in R with the OpenAI API. You need to install the reticulate package. | |
# Additionally, an API key is required that must be saved in a separate file, called .openaikey | |
# Get your API key here: https://openai.com/api/ | |
##################################################### | |
# install.packages("reticulate") # run only once | |
library(reticulate) | |
# create python env |
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
# Set up environment for Python in R Studio | |
# install.packages("reticulate") # run only once | |
library(reticulate) | |
# create python environment | |
conda_create(envname = "mlclass", python_version = "3.9") | |
use_condaenv("mlclass") | |
# install packages |
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
# How to create Google Maps links based on coordinates and add links to leaflet markers | |
library(leaflet) | |
library(htmltools) | |
# create df with coordinates | |
df <- read.csv(textConnection( | |
"name,Lat,Long | |
Parc Lafontaine,45.5273219,-73.5703556 | |
Central Park,40.7812199,-73.9665138" |