Skip to content

Instantly share code, notes, and snippets.

View jlomako's full-sized avatar

jlomako

  • Montréal
View GitHub Profile
@jlomako
jlomako / restore_files.py
Created February 3, 2023 03:33
restore all files from github directory
# 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>"
}
@jlomako
jlomako / openai_in_R.R
Created October 27, 2022 15:34
use GPT-3 in R with the OpenAI API
#####################################################
# 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
@jlomako
jlomako / python_in_R.R
Created October 26, 2022 15:38
create python environment in R Studio for ML class
# 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
@jlomako
jlomako / leaflet_with_google_map_links.R
Created October 21, 2022 13:32
Create Google Maps links based on coordinates and add links to leaflet markers