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 / 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 / save_nb.py
Created June 18, 2018 19:47
Save Notebook
from IPython.display import HTML
javascript = """
<script type="text/Javascript">
var saveBTN = document.getElementById("save_checkpoint");
saveBTN.click();
</script>
"""
HTML(javascript)
@DEKHTIARJonathan
DEKHTIARJonathan / allow_skype
Last active March 3, 2019 21:56
Skype Allow
Issue Solving with Skype due to: https://github.com/Nummer/Destroy-Windows-10-Spying
157.55.235.0-157.55.235.255_Block
157.55.56.0-157.55.56.255_Block
64.4.23.0-64.4.23.255_Block
65.55.223.0-65.55.223.255_Block
or use this commands (admin rights necessary):
netsh advfirewall firewall delete rule name="157.55.235.0-157.55.235.255_Block"
netsh advfirewall firewall delete rule name="157.55.56.0-157.55.56.255_Block"
@DEKHTIARJonathan
DEKHTIARJonathan / jupyter_autosave.py
Created January 18, 2018 22:53
Auto Save Jupyter Notebook at the end
from IPython.display import HTML
javascript = """
<script type="text/Javascript">
var saveBTN = document.getElementById("save_checkpoint");
saveBTN.click();
</script>
"""
HTML(javascript)
@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 / get_placeholders.py
Created January 11, 2018 14:47
Get Placeholders in Graph
from tensorflow.python.framework import ops
def get_placeholders(graph):
"""Get placeholders of a graph.
For example:
```python
a = tf.placeholder(dtype=tf.float32, shape=[2, 2], name='a')
a = tf.placeholder(dtype=tf.int32, shape=[3, 2], name='b')
# would give [<tf.Tensor 'a:0' shape=(2, 2) dtype=float32>,
# <tf.Tensor 'b:0' shape=(3, 2) dtype=int32>]
@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
@DEKHTIARJonathan
DEKHTIARJonathan / convert.py
Created November 29, 2016 19:42
python convert_protomean.py proto.mean out.npy
import caffe
import numpy as np
import sys
if len(sys.argv) != 3:
print "Usage: python convert_protomean.py proto.mean out.npy"
sys.exit()
blob = caffe.proto.caffe_pb2.BlobProto()
data = open( sys.argv[1] , 'rb' ).read()
@DEKHTIARJonathan
DEKHTIARJonathan / script.sql
Created November 22, 2016 12:10
Delete if exists table in Oracle
BEGIN
EXECUTE IMMEDIATE 'DROP TABLE table_name';
EXCEPTION
WHEN OTHERS THEN NULL;
END;
/
@DEKHTIARJonathan
DEKHTIARJonathan / reset.sql
Created November 20, 2016 15:11
Reset a PostgreSQL Database
DROP SCHEMA public CASCADE;
CREATE SCHEMA public;