Skip to content

Instantly share code, notes, and snippets.

View guillaume-chevalier's full-sized avatar
💯
Innovating

Guillaume Chevalier guillaume-chevalier

💯
Innovating
View GitHub Profile
@guillaume-chevalier
guillaume-chevalier / create_venv_and_add_as_jupyter_kernel.sh
Last active November 5, 2019 03:28
Create python3 venv and register it to Jupyter Notebook as a python kernel
# This script will create a venv under as a `./venv` folder, and it will name it `my_new_venv_nickname_in_the_jupyter_menu` in jupyter's kernel list to choose the venv.
# You can edit the `./venv` path here to change it:
python3 -m venv ./venv
source ./venv/bin/activate
pip install --upgrade pip
pip install setuptools wheel
pip install ipykernel
# You can change the `my_new_venv_nickname_in_the_jupyter_menu` name in menu here:
ipython kernel install --user --name=my_new_venv_nickname_in_the_jupyter_menu
@guillaume-chevalier
guillaume-chevalier / python_ascii_one_line_animation.py
Last active June 23, 2021 15:56
Print a one line ASCII console animation in Python
# Example output:
# .-'¯ _,.-'¯ _,.-'¯ _,.-'¯ _,.-'¯ | your message here |.,_ ¯'-.,_ ¯'-.,_ ¯'-.,_ ¯'-.,_ ¯
# The things next to the message are animated and moving.
import time
import sys
import os
def wait():
import numpy as np
import matplotlib.pyplot as plt
import math
b = 8
a = 2**b
x = np.array([[math.cos(0.5**i*x*2*math.pi) for x in range(0, a)] for i in range(1, b+1)])
@guillaume-chevalier
guillaume-chevalier / cuda8-cudnn6-dl-setup.sh
Last active November 11, 2018 17:16 — forked from mjdietzx/waya-dl-setup.sh
Install CUDA Toolkit v8.0 and cuDNN v6.0 on Ubuntu 16.04
#!/bin/bash
# install CUDA Toolkit v8.0
# instructions from https://developer.nvidia.com/cuda-downloads (linux -> x86_64 -> Ubuntu -> 16.04 -> deb (network))
CUDA_REPO_PKG="cuda-repo-ubuntu1604_8.0.61-1_amd64.deb"
wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/${CUDA_REPO_PKG}
sudo dpkg -i ${CUDA_REPO_PKG}
sudo apt-get update
sudo apt-get -y install cuda
@guillaume-chevalier
guillaume-chevalier / tensorflow-simple-second-order-optimization.py
Created July 30, 2017 04:58
Simple second order optimization with TensorFlow.
"""Simple second order optimization with TensorFlow."""
import tensorflow as tf
####
# 1. Define the problem