Skip to content

Instantly share code, notes, and snippets.

View sbdzdz's full-sized avatar
🧅

Sebastian Dziadzio sbdzdz

🧅
View GitHub Profile
@sbdzdz
sbdzdz / install_jupyter.sh
Created June 12, 2019 14:07
How to run a Jupyter notebook from a virtual environment
python3 -m virtualenv venv
source venv/bin/activate
python -m ipykernel install --user --name venv
jupyter notebook
@sbdzdz
sbdzdz / async.py
Last active January 22, 2018 13:33
Asynchronous and synchronous requests in Python 3.6
import asyncio
import json
import sys
from asyncio import ensure_future
from aiohttp import ClientSession
async def fetch(domain, session):
url = 'http://localhost:8080/allicons.json'
params = {'url': domain, 'format': 'png'}
async with session.get(url, params=params, timeout=600) as response:
@sbdzdz
sbdzdz / config.py
Created January 15, 2018 12:26
Configuring and testing device placement for TensorFlow
import tensorflow as tf
num_cores = 4
GPU = True
CPU = False
if GPU:
num_GPU = 1
num_CPU = 1
if CPU: