Skip to content

Instantly share code, notes, and snippets.

Avatar
🐢
Working away...

Shay Palachy shaypal5

🐢
Working away...
View GitHub Profile
@shaypal5
shaypal5 / gist:4522797c5971a48c628b56fe9b1b4b8e
Last active Oct 12, 2021 — forked from dotrung/gist:a32aad56ddbb5f218b7c3ec51639b6f0
Install Vim 8 with Python, Python 3 support on Ubuntu 16.04
View gist:4522797c5971a48c628b56fe9b1b4b8e
sudo apt-get remove --purge vim vim-runtime vim-gnome vim-tiny vim-gui-common
sudo apt-get install build-essential cmake
sudo apt-get install python-dev python3-dev
#Optional: so vim can be uninstalled again via `dpkg -r vim`
sudo apt-get install checkinstall
sudo rm -rf /usr/local/share/vim /usr/bin/vim
@shaypal5
shaypal5 / lifecycle_core.sh
Last active Feb 3, 2021
The core component of my Sagemaker lifecycle template for DS
View lifecycle_core.sh
#!/bin/bash
# --- script documentation
# recieves two arrays as input using the length prefix convention. See:
# https://stackoverflow.com/questions/43686878/pass-multiple-arrays-as-arguments-to-a-bash-script
# add mandatory packages here
# packages+=("pandas")
echo ">>> conda_envs: ${conda_envs[@]}"
@shaypal5
shaypal5 / conftest.py
Created Oct 6, 2020
Temp environment variables for pytest
View conftest.py
import os
import pytest
try:
from.temp_env_var import TEMP_ENV_VARS, ENV_VARS_TO_SUSPEND
except ImportError:
TEMP_ENV_VARS = {}
ENV_VARS_TO_SUSPEND = []
@shaypal5
shaypal5 / bitbucket-pipelines.yml
Created Jul 30, 2020
Bitbucket status badges
View bitbucket-pipelines.yml
image: python:3.8.3
# pipeline stages definitions
test: &test
step:
name: test
caches:
- pip
script:
- python --version
@shaypal5
shaypal5 / test_gilad.py
Created Aug 3, 2019
pytest parameterize example for Gilad
View test_gilad.py
@pytest.mark.parametrize("parallelize", [True, False])
def test_rubin(parallelize):
if parallelize:
run_parallel()
else:
foo()
@shaypal5
shaypal5 / .vimrc
Created Jul 31, 2019
My current .vimrc
View .vimrc
" :echom "Loading Shay's .vimrc!"
" === vim-plug plugin manager ===
" automatic installation of vim-plug itself, if missing
if empty(glob('~/.vim/autoload/plug.vim'))
:echom "vim-plug is missing. Installing vim-plug..."
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif
@shaypal5
shaypal5 / .travis.yml
Last active Jul 16, 2019
Travis: Python 3.5.4 on Windows
View .travis.yml
matrix:
include:
- name: "Python 3.5.4 on Windows"
os: windows # Windows 10.0.17134 N/A Build 17134
language: shell # 'language: python' is an error on Travis CI Windows
before_install:
- choco install python --version 3.5.4
- python --version
- python -m pip install --upgrade pip
- pip3 install --upgrade pytest
@shaypal5
shaypal5 / .travis.yml
Created Jul 16, 2019
Travis: Python 2.7.14 on macOS 10.13
View .travis.yml
matrix:
include:
- name: "Python 2.7.14 on macOS 10.13"
os: osx
osx_image: xcode9.3 # Python 2.7.14_2 running on macOS 10.13
language: shell # 'language: python' errors on Travis CI macOS
before_install:
- python --version
- pip install pytest --user
- pip install codecov --user
@shaypal5
shaypal5 / .travis.yml
Created Jul 16, 2019
Testing Python 3.6.5 on macOS 10.13
View .travis.yml
matrix:
include:
- name: "Python 3.6.5 on macOS 10.13"
os: osx
osx_image: xcode9.4 # Python 3.6.5 running on macOS 10.13
language: shell # 'language: python' is an error on Travis CI macOS
before_install:
- python3 --version
- pip3 install -U pip
- pip3 install -U pytest
@shaypal5
shaypal5 / .travis.yml
Last active Jul 16, 2019
Bad example for a .travis.yml for Python on maxOS
View .travis.yml
matrix:
include:
- name: "Generic Python 3.5 on macOS"
os: osx
language: shell # 'language: python' is an error on Travis CI macOS
python: 3.5