-
Create the repo
git init
-
Add and commit your files
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 matplotlib.pyplot as plt | |
from pydataset import data | |
class Plot: | |
def __init__(self, data=None): | |
if data is not None: | |
self.data = data | |
def __getattr__(self, attr): | |
def wrapper(*args, **kwargs): | |
if attr in ['scatter', 'hist', 'bar', 'plot'] and 'data' not in kwargs: |
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
In [148]: def various_scales(s: pd.Series): | |
...: df = pd.DataFrame() | |
...: df['original'] = s | |
...: df['min_max'] = MinMaxScaler().fit_transform(s.values.reshape(-1, 1)) | |
...: df['percentile'] = s.rank(pct=True) | |
...: df['rank'] = s.rank() | |
...: df['z_score'] = StandardScaler().fit_transform(s.values.reshape(-1, 1)) | |
...: return df |
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 bash | |
tail -n +3 $0 | pandoc --section-divs --mathjax -o index.html ; exit 0 | |
# Self-Rendering Markdown File | |
Just make sure you have `pandoc` installed, ignore the first two lines of this | |
file, and make this file executable (`chmod +x self-rendering.md`). | |
Then you can run this file to produce it's html output. | |
``` |
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
JUPYTER_NOTEBOOK_CONFIG_FILE=$(jupyter --config-dir)/jupyter_notebook_config.py | |
# conda -c conda-forge install jupytext | |
python3 -m pip install --upgrade jupytext | |
[[ -f $JUPYTER_NOTEBOOK_CONFIG_FILE ]] || jupyter notebook --generate-config | |
if ! grep -q 'c.NotebookApp.contents_manager_class = "jupytext.TextFileContentsManager"' $JUPYTER_NOTEBOOK_CONFIG_FILE ; then | |
echo "# Added by $0 at $(date)" >> $JUPYTER_NOTEBOOK_CONFIG_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
#!/usr/bin/env bash | |
# Shell script to install docker and docker-compose | |
# author: Zach Gulde <[email protected]> | |
# | |
# This script is more or less an automation of the guides found here: | |
# | |
# - https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-18-04 | |
# - https://www.digitalocean.com/community/tutorials/how-to-install-docker-compose-on-ubuntu-18-04 | |
# |
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 pyspark | |
import env | |
MYSQL_CONNECTOR_VERSION = '5.1.38' | |
DATABASE = 'a_database' | |
TABLE = 'some_db_table' | |
spark = (pyspark.sql.SparkSession.builder | |
.config(f'spark.jars.packages', 'mysql:mysql-connector-java:{MYSQL_CONNECTOR_VERSION}') |
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 codeup_test_db; | |
TRUNCATE albums; | |
INSERT INTO albums (artist, name, release_date, genre, sales) | |
VALUES | |
("Michael Jackson", "Thriller", 1982, "Pop, rock, R&B", 43.3), | |
("AC/DC", "Back in Black", 1980, "Hard rock", 25.9), | |
("Pink Floyd", "The Dark Side of the Moon", 1973, "Progressive rock", 22.7), | |
("Whitney Houston / Various artists", "The Bodyguard", 1992, "Soundtrack/R&B, soul, pop", 27.4), | |
("Meat Loaf", "Bat Out of Hell", 1977, "Hard rock, progressive rock", 20.6), | |
("Eagles", "Their Greatest Hits (1971–1975)", 1976, "Rock, soft rock, folk rock", 32.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
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<meta http-equiv="x-ua-compatible" content="ie=edge" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1" /> | |
<title></title> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous"> | |
</head> | |
<body> |
- We're smarter than intellij when it comes to variables in our views
- [Define the head fragment, including a placeholder for the page title][1]
- Elsewhere, [when the fragment is included, pass a value for the title][2]
- In the fragment, [use the passed value][3]