Skip to content

Instantly share code, notes, and snippets.

@johncassil
johncassil / snowflake_odbc_m1_tutorial.md
Created April 21, 2023 23:50
Getting the snowflake odbc driver working on an M1 Mac

Background

Many people have had quite a bit of trouble with this based on the documentation/tutorials online. If you want to connect to snowflake but have an M1 mac, the tutorials online as of this post are misleading at best. After figuring it out, I created this to leave breadcrumbs for other engineers.

You may be following this tutorial - https://community.snowflake.com/s/article/How-To-Connect-Snowflake-with-R-RStudio-using-RODBC-driver-on-Windows-MacOS-Linux

Step 1 is to follow this tutorial - https://docs.snowflake.com/en/developer-guide/odbc/odbc-mac

Requirement is to download and install iodbc from here - https://www.iodbc.org/dataspace/doc/iodbc/wiki/iodbcWiki/Downloads

@johncassil
johncassil / pluck_recursive.R
Created March 10, 2022 04:52
From a tree, recursively pluck all elements with a particular name
# @drob's version from https://twitter.com/drob/status/1501747414780239879
pluck_recursive <- function(lst, name) {
if (is.list(lst)) {
if (!is.null(lst[[name]])) {
return(lst[[name]])
}
return(unname(unlist(purrr::map(lst, pluck_recursive, name))))
}
}
@johncassil
johncassil / gist:38e657ce70d2e729b06c060bd094ad62
Created December 4, 2019 15:39
bash: change folder/file permissions
chmod g+rwx foldername