Skip to content

Instantly share code, notes, and snippets.

View tuttelikz's full-sized avatar
🔨
生き甲斐

San Askaruly tuttelikz

🔨
生き甲斐
View GitHub Profile
@tuttelikz
tuttelikz / move_certain_files
Created January 20, 2018 06:49
Bash command to move files with certain extension
mv /path/to/original/directory/*.pdf /path/to/new/directory
@tuttelikz
tuttelikz / count_files
Created January 20, 2018 07:49
Bash script to count number of files
find . -type f | wc -l
@tuttelikz
tuttelikz / rename_folder.sh
Last active January 20, 2018 09:48
Bash command to rename folder
mv /home/user/oldname /home/user/newname
@tuttelikz
tuttelikz / labels_multiple_if.py
Created January 20, 2018 09:47
Python line for creating list with multiple conditions
['yes' if v == 1 else 'no' if v == 2 else 'idle' for v in l]
@tuttelikz
tuttelikz / sort_create_label_write_text.py
Created January 20, 2018 09:55
Simple gist for opening directory, sorting and writing text
import glob
from PIL import Image
img_dir_path = 'data_cheek/*.jpg'
train_test_filelist = sorted(glob.glob(img_dir_path))
cheek_label_list = [0 if "old" in files else 1 for files in train_test_filelist]
thefile = open('data_cheek.txt', 'w')
for item in cheek_label_list:
@tuttelikz
tuttelikz / copy_with_new_name.sh
Created January 21, 2018 03:10
Bash command to copy with new name
cp program3.cpp homework6.cpp
@tuttelikz
tuttelikz / open_with_subl.sh
Created January 21, 2018 03:13
Bash command to open with sublime
subl cnn_region_v2_batchnorm.py
#Bash to delete with user confirmation
rm /path/to/directory/*
#Bash to delete without asking
rm -rf /path/to/directory/*
@tuttelikz
tuttelikz / tensorboard_simple.py
Created January 21, 2018 08:11
Gist for simple model visualization in TensorBoard
# View more python learning tutorial on my Youtube and Youku channel!!!
# Youtube video tutorial: https://www.youtube.com/channel/UCdyjiB5H8Pu7aDTNVXTTpcg
# Youku video tutorial: http://i.youku.com/pythontutorial
"""
Please note, this code is only for python 3+. If you are using python 2+, please modify the code accordingly.
"""
from __future__ import print_function
import tensorflow as tf
@tuttelikz
tuttelikz / multiple_graphs_tensorboard.py
Created January 21, 2018 11:00
This is a snippet example how to create multiple accuracies on same plot in Tensorboard
train_summary = tf.Summary()
train_summary.value.add(tag="%sAccuracy" % fold,simple_value=avg_train_acc)
train_summary.value.add(tag="%sLoss" % fold,simple_value=avg_train_loss)
train_writer.add_summary(train_summary,epoch)
test_summary = tf.Summary()
test_summary.value.add(tag="%sAccuracy" % fold,simple_value=avg_test_acc)
test_summary.value.add(tag="%sLoss" % fold,simple_value=avg_test_loss)
test_writer.add_summary(test_summary,epoch)