Skip to content

Instantly share code, notes, and snippets.

@adammarples
adammarples / notebookpipenv.fish
Created February 28, 2018 16:54
A fish function to create a pipenv which will be made available as a jupyter notebook kernel
function notebookpipenv
set d (basename (pwd))
pipenv install ipykernel $argv[1..-1]
pipenv run python -m ipykernel install --user --name=$d
end
#install docker on ubuntu
sudo apt-get remove docker docker-engine docker.io
sudo apt-get update
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo apt-key fingerprint 0EBFCD88
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
xenial \
stable"
sudo apt-get update
seen = set()
items = [x for x in items if not (x in seen or seen.add(x))]
@adammarples
adammarples / install_xgboost.sh
Created March 26, 2018 13:31
Install XGBoost binaries before running pip install xgboost
git clone --recursive https://github.com/dmlc/xgboost
cd xgboost
cp make/minimum.mk ./config.mk
make -j4
cd python-package
sudo python setup.py install
{
"embeddings": [
{
"tensorName": "movielens-embeddings",
"tensorShape": [
26744,
30
],
"tensorPath": "https://raw.githubusercontent.com/adammarples/movie-embeddings/master/tensors.tsv",
"metadataPath": "https://raw.githubusercontent.com/adammarples/movie-embeddings/master/metadata.tsv"
create or replace file format example_file_format_name
type = 'csv'
field_delimiter = ','
skip_header = 1
date_format = 'DD/MM/YYYY';
create or replace stage example_stage_name
file_format = example_file_format_name;
{
"Working Directory" : "\/Users\/adam.marples",
"Prompt Before Closing 2" : false,
"Selected Text Color" : {
"Green Component" : 0,
"Red Component" : 0,
"Blue Component" : 0
},
"Rows" : 58,
"Ansi 11 Color" : {
# pyenv
set -x PYENV_ROOT $HOME/.pyenv
set -U PATH $PYENV_ROOT/bin $PATH
source (pyenv init - | psub)
set -e _OLD_FISH_PROMPT_OVERRIDE
set -e _OLD_VIRTUAL_PYTHONHOME
set -e _OLD_VIRTUAL_PATH
# direnv
direnv hook fish | source
function project
cd $HOME/projects
cp -r template $argv
cd $argv
direnv allow .
git init
git add .
git commit -m "initial commit"
tree -aL 2 .
end
layout python3
#ln -s .direnv/$(basename $VIRTUAL_ENV)/ .env