This file contains 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
-- Heavily inspired by this StackOverflow thread | |
-- https://stackoverflow.com/questions/47230534/how-do-i-create-a-dates-table-in-redshift | |
-- and tired of bumping my head in the wall after getting the generate_series() error. | |
DROP VIEW IF EXISTS public.dim_date; | |
CREATE VIEW public.dim_date AS | |
WITH | |
digit AS ( | |
SELECT | |
0 AS D |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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 pandas as pd | |
pd.set_option("display.max_rows", 200) | |
pd.set_option("display.max_columns", 100) | |
pd.set_option("display.max_colwidth", 200) | |
## Reset to defaults | |
# pd.reset_option("^display") |
This file contains 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
# After Ubuntu 16.04, Systemd becomes the default. | |
# It is simpler than https://gist.github.com/Doowon/38910829898a6624ce4ed554f082c4dd | |
# https://gist.github.com/whophil/5a2eab328d2f8c16bb31c9ceaf23164f | |
# PUT THIS IN /usr/lib/systemd/system | |
[Unit] | |
Description=Jupyter Notebook | |
[Service] | |
Type=simple |
This file contains 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 s3fs.core import S3FileSystem | |
s3 = S3FileSystem(anon=False, profile_name="your-profile-name") | |
print(s3.ls("s3://your-bucket/some-folder")) |
This file contains 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 | |
# Doesn't fix the icon to have the right appearance, but stop the top bar from being ridiculously big. | |
cd /usr/share/pritunl_client && for f in `ls *svg`; do sudo sed -i -E -e 's/200([ "])/24\1/g' $f; done && cd - |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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 sklearn.base import BaseEstimator, TransformerMixin | |
class NoFitMixin: | |
"""Gives fit method by inheritance.""" | |
def fit(self, X, y=None, **fit_params): | |
return self | |
class LabelFeaturizer(BaseEstimator, TransformerMixin, NoFitMixin): |
NewerOlder