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(dplyr) | |
| library(nycflights13) | |
| conn <- nycflights13_sqlite() | |
| flights_sql <- tbl(conn, 'flights') | |
| weather_sql <- tbl(conn, 'weather') | |
| `[.tbl_sql` <- function(x, condition) { | |
| x %>% select_(condition) | |
| } |
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(shiny) | |
| shinyServer(function(input, output, session) { | |
| # Return the components of the URL in a string: | |
| output$urlText <- renderText({ | |
| paste(sep = "", | |
| "protocol: ", session$clientData$url_protocol, "\n", | |
| "hostname: ", session$clientData$url_hostname, "\n", | |
| "pathname: ", session$clientData$url_pathname, "\n", |
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
| # originally from: http://stackoverflow.com/questions/42528400/plot-brushing-or-accessing-drawn-shape-geometry-for-spatial-subsets-in-shiny-lea | |
| # uses https://github.com/bhaskarvk/leaflet.extras | |
| library(shiny) | |
| library(leaflet) | |
| library(leaflet.extras) | |
| library(sp) | |
| cities <- structure(list(AccentCity = c("Saint Petersburg", "Harare", "Qingdao", | |
| "Addis Abeba", "Xian", "Anshan", "Rongcheng", "Kinshasa", "New York", |
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 os | |
| from io import BytesIO | |
| import pyarrow as pa | |
| import pyarrow.parquet as pq | |
| kilobytes = 1024 | |
| megabytes = kilobytes * 1000 | |
| chunksize = int(10 * megabytes) |
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
| #!/bin/bash | |
| set -o nounset -o errexit -o pipefail | |
| IP_ADDR=$(/sbin/ifconfig eth0 | grep "inet addr" | cut -d ":" -f2 | cut -d " " -f1) | |
| CONF_DIR="$HOME/.ipython/profile_default" | |
| CONF_FILE="${CONF_DIR}/ipython_notebook_config.py" | |
| mkdir -p "${CONF_DIR}" | |
| cat <<EOF >>"${CONF_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
| "***************************************************************************** | |
| "" Vim-PLug core | |
| "***************************************************************************** | |
| if has('vim_starting') | |
| set nocompatible " Be iMproved | |
| endif | |
| let vimplug_exists=expand('~/.config/nvim/autoload/plug.vim') | |
| let g:vim_bootstrap_langs = "html,javascript,python,scala" |
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
| "***************************************************************************** | |
| "" Vim-PLug core | |
| "***************************************************************************** | |
| if has('vim_starting') | |
| set nocompatible " Be iMproved | |
| endif | |
| let g:vim_bootstrap_langs = "html, javascript,python,scala" | |
| let g:vim_bootstrap_editor = "vim" |
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
| #!/usr/bin/env python | |
| # coding: utf-8 | |
| # In[11]: | |
| # dependencies | |
| import pytesseract | |
| from bs4 import BeautifulSoup | |
| from PIL import Image |
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 IPython.core.magic import line_magic, line_cell_magic, Magics, magics_class | |
| from pyspark.sql import SparkSession | |
| from pyspark.dbutils import DBUtils | |
| spark = SparkSession.builder.getOrCreate() | |
| sc = spark.sparkContext | |
| dbutils = DBUtils(sc) | |
| @magics_class | |
| class DatabricksConnectMagics(Magics): |
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
| #!python | |
| import functools | |
| import json | |
| import os | |
| import requests | |
| import urllib | |
| import uuid | |
| import configparser | |
| # TODO: CURRENTLY ONLY WORKS FOR AWS, NEED TO ADD ADDITIONAL PARSING FOR AZURE |