This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # pip3 install requests pandas | |
| import requests | |
| import pandas as pd | |
| import os | |
| import sqlite3 | |
| if __name__ == '__main__': |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| python -c "from tensorflow.python.client import device_lib; print(device_lib.list_local_devices())" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import time() | |
| class Timer: | |
| def __init__(self, title, decimals=6): | |
| self.title = title | |
| self.decimals = decimals | |
| def __enter__(self): | |
| self.start = time.time() | |
| return self |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from contextlib import contextmanager | |
| import time | |
| @contextmanager | |
| def timer(title, decimals=6): | |
| t0 = time.time() | |
| yield | |
| print('"{}" - done in {:.{}f}s'.format(title, time.time() - t0, decimals)) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| CUDNN_TAR_FILE="cudnn-8.0-linux-x64-v7.tgz" | |
| wget http://developer.download.nvidia.com/compute/redist/cudnn/v7.0.5/${CUDNN_TAR_FILE} | |
| tar -xzvf ${CUDNN_TAR_FILE} | |
| sudo cp -P cuda/include/cudnn.h /usr/local/cuda-8.0/include | |
| sudo cp -P cuda/lib64/libcudnn* /usr/local/cuda-8.0/lib64/ | |
| sudo chmod a+r /usr/local/cuda-8.0/lib64/libcudnn* | |
| # set environment variables |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| VERSION=1.2.1 | |
| HASH=3e50a65 | |
| BASENAME=robo3t-$VERSION-linux-x86_64-$HASH | |
| cd /opt/ | |
| wget https://download.robomongo.org/$VERSION/linux/$BASENAME.tar.gz | |
| sudo tar -xzf $BASENAME.tar.gz -C /opt | |
| rm $BASENAME.tar.gz | |
| sudo ln -fs /opt/$BASENAME/bin/robo3t /usr/bin/robo3t | |
| cat > ~/.local/share/applications/robo3t.desktop <<EOL |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ---------------------------------------------------------- | |
| // A short snippet for detecting versions of IE in JavaScript | |
| // without resorting to user-agent sniffing | |
| // ---------------------------------------------------------- | |
| // If you're not in IE (or IE version is less than 5) then: | |
| // ie === undefined | |
| // If you're in IE (>=5) then you can determine which version: | |
| // ie === 7; // IE7 | |
| // Thus, to detect IE: | |
| // if (ie) {} |