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
create_conda_env() { | |
# Check if the environment name and Python version are provided as arguments | |
if [ $# -lt 2 ]; then | |
echo "Please provide the conda environment name and Python version as arguments." | |
return 1 | |
fi | |
# Create conda environment with the specified Python version | |
conda create -n "$1" "$2" |
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
# Data | |
*.csv | |
*.png | |
*.jpg | |
*.jpeg | |
*.json | |
# Byte-compiled / optimized / DLL files | |
__pycache__/ |
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
### Download a file to Local System from Colab | |
from google.colab import files | |
with open('example.txt', 'w') as f: | |
f.write('some content') | |
files.download('example.txt') | |
#====================================================================================================== | |
#upload file to Colab from Local System | |
from google.colab import files | |
uploaded = files.upload() |
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
i = 0 | |
while True: | |
try: | |
i += 1 | |
if i == 10: i/0 | |
except ZeroDivisionError: | |
print('Go Free!!') | |
break |
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
;; -*- mode: emacs-lisp -*- | |
;; This file is loaded by Spacemacs at startup. | |
;; It must be stored in your home directory. | |
;; Ippikayak other buckets | |
(defun dotspacemacs/layers () | |
"Configuration Layers declaration. | |
You should not put any user code in this function besides modifying the variable | |
values." | |
(setq-default |
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
### Download a file to Local System from Colab | |
from google.colab import files | |
with open('example.txt', 'w') as f: | |
f.write('some content') | |
files.download('example.txt') | |
#====================================================================================================== | |
#upload file to Colab from Local System | |
from google.colab import files | |
uploaded = files.upload() |
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
(require 'hideshow) | |
(define-key hs-minor-mode-map (kbd "C-^") 'hs-toggle-hiding) | |
(add-hook 'python-mode-hook 'hs-minor-mode) | |
(defun display-code-line-counts (ov) | |
(when (eq 'code (overlay-get ov 'hs)) | |
(overlay-put ov 'display | |
(format " ... [%d]" | |
(count-lines (overlay-start ov) | |
(overlay-end ov)))) | |
(overlay-put ov 'face '(:foreground "yellow green")))) |
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
SPC | |
SPC: find file | |
, switch buffer | |
. browse files | |
: MX | |
; EX | |
< switch buffer | |
` eval | |
u universal arg | |
x pop up scratch |
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 tensorflow as tf | |
config = tf.ConfigProto() | |
config.gpu_options.allow_growth=True | |
sess = tf.Session(config=config) | |
import tensorflow as tf | |
config = tf.compat.v1.ConfigProto() | |
config.gpu_options.allow_growth=True | |
sess = tf.compat.v1.Session(config=config) |
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
""" | |
Create train, valid, test iterators for CIFAR-10 [1]. | |
Easily extended to MNIST, CIFAR-100 and Imagenet. | |
[1]: https://discuss.pytorch.org/t/feedback-on-pytorch-for-kaggle-competitions/2252/4 | |
""" | |
import torch | |
import numpy as np |
NewerOlder