Skip to content

Instantly share code, notes, and snippets.

View DEKHTIARJonathan's full-sized avatar
👨‍🚀
Focused on breaking the speed of light. Beam me up, Scotty

Jonathan DEKHTIAR DEKHTIARJonathan

👨‍🚀
Focused on breaking the speed of light. Beam me up, Scotty
View GitHub Profile
@DEKHTIARJonathan
DEKHTIARJonathan / create_hellotensor.py
Created August 19, 2020 21:19 — forked from omimo/create_hellotensor.py
A simple example for saving a tensorflow model and preparing it for using on Android
# Create a simple TF Graph
# By Omid Alemi - Jan 2017
# Works with TF <r1.0
import tensorflow as tf
I = tf.placeholder(tf.float32, shape=[None,3], name='I') # input
W = tf.Variable(tf.zeros_initializer(shape=[3,2]), dtype=tf.float32, name='W') # weights
b = tf.Variable(tf.zeros_initializer(shape=[2]), dtype=tf.float32, name='b') # biases
O = tf.nn.relu(tf.matmul(I, W) + b, name='O') # activation / output
# Make sure you grab the latest version
curl -OL https://github.com/google/protobuf/releases/download/v3.2.0/protoc-3.2.0-linux-x86_64.zip
# Unzip
unzip protoc-3.2.0-linux-x86_64.zip -d protoc3
# Move protoc to /usr/local/bin/
sudo mv protoc3/bin/* /usr/local/bin/
# Move protoc3/include to /usr/local/include/
@DEKHTIARJonathan
DEKHTIARJonathan / simple_args_parsing.sh
Created May 25, 2019 00:34 — forked from guenp/simple_args_parsing.sh
a simple way to parse shell script arguments
#!/bin/sh
#
# a simple way to parse shell script arguments
#
# please edit and use to your hearts content
#
ENVIRONMENT="dev"
@DEKHTIARJonathan
DEKHTIARJonathan / delete_git_submodule.md
Created March 10, 2019 09:23 — forked from myusuf3/delete_git_submodule.md
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule
@DEKHTIARJonathan
DEKHTIARJonathan / pytest.md
Created August 15, 2018 14:47 — forked from kwmiebach/pytest.md
pytest cheat sheet

Usage

(Create a symlink pytest for py.test)

pytest [options] [file_or_dir] [file_or_dir] ...

Help:

@DEKHTIARJonathan
DEKHTIARJonathan / colorize.py
Created January 18, 2018 09:24 — forked from jimfleming/colorize.py
A utility function for TensorFlow that maps a grayscale image to a matplotlib colormap for use with TensorBoard image summaries.
import matplotlib
import matplotlib.cm
import tensorflow as tf
def colorize(value, vmin=None, vmax=None, cmap=None):
"""
A utility function for TensorFlow that maps a grayscale image to a matplotlib
colormap for use with TensorBoard image summaries.
@DEKHTIARJonathan
DEKHTIARJonathan / git_create_orphan.sh
Created October 17, 2017 09:49 — forked from seanbuscay/git_create_orphan.sh
Create an orphan branch in a repo.
cd repository
git checkout --orphan orphan_name
git rm -rf .
rm '.gitignore'
echo "#Title of Readme" > README.md
git add README.md
git commit -a -m "Initial Commit"
git push origin orphan_name