Skip to content

Instantly share code, notes, and snippets.

@ruxi
ruxi / download_file.py
Last active February 3, 2024 18:56
python download_file with progressbar using request and tqdm
#!/usr/bin/env python
__author__ = "github.com/ruxi"
__license__ = "MIT"
import requests
import tqdm # progress bar
import os.path
def download_file(url, filename=False, verbose = False):
"""
Download file with progressbar
@ruxi
ruxi / make_conda_env.sh
Created July 21, 2016 18:38
bash script to make basic conda env
%%writefile make_conda_env.sh
#!/usr/bin/env bash
# author: github.com/ruxi
# reproducibly create conda env
read -p "Create new conda env (y/n)?" CONT
if [ "$CONT" == "n" ]; then
echo "exit";
else
@ruxi
ruxi / jointplot_w_hue.py
Last active March 13, 2021 23:39
jointplot_w_hue
__author__ = "lewis.r.liu@gmail.com"
__copyright__ = "Copyright 2020, 2018, https://gist.github.com/ruxi/ff0e9255d74a3c187667627214e1f5fa"
__license__ = "MIT"
__version__ = "0.0.2"
# update: June 13, 2020
# created: Feb 19, 2018
# desc: seaborn jointplot with 'hue'
# prepared for issue: https://github.com/mwaskom/seaborn/issues/365
# resolved (22 Aug 2020): https://github.com/mwaskom/seaborn/pull/2210
@ruxi
ruxi / xgboost_gpu_build.txt
Last active December 5, 2020 08:08
how to build xgboost with gpu support
# install latest nvidia driver
sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt-get update
# then go to device manager and dl newest driver
# nvidia-390 for linux >4.13.32 | there is a bug with <nvidia-390 & >linux 4.13.25
@ruxi
ruxi / .gitignore
Created November 3, 2019 09:21 — forked from smoser/.gitignore
cloud-init ubuntu nocloud example with network config
*.img
*.raw
@ruxi
ruxi / FlowLayoutGist.py
Last active April 16, 2018 19:34
Plot horizontally in jupyter notebooks. source: https://stackoverflow.com/questions/21754976/
# source: https://stackoverflow.com/questions/21754976/
import numpy as np
from IPython.display import HTML
import io
import base64
class FlowLayout(object):
''' A class / object to display plots in a horizontal / flow layout below a cell '''
def __init__(self):
# source: https://stackoverflow.com/questions/21754976/
import numpy as np
from IPython.display import HTML
import io
import base64
class FlowLayout(object):
''' A class / object to display plots in a horizontal / flow layout below a cell '''
def __init__(self):
# source: https://stackoverflow.com/questions/21754976/
import numpy as np
from IPython.display import HTML
import io
import base64
class FlowLayout(object):
''' A class / object to display plots in a horizontal / flow layout below a cell '''
def __init__(self):
# source: https://stackoverflow.com/questions/21754976/
import numpy as np
from IPython.display import HTML
import io
import base64
class FlowLayout(object):
''' A class / object to display plots in a horizontal / flow layout below a cell '''
def __init__(self):
@ruxi
ruxi / opendata_liesure_winnipeg2018.ipynb
Created March 3, 2018 22:52
opendata hackathon 2018 (rough draft)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.