Skip to content

Instantly share code, notes, and snippets.

"""
From https://stackoverflow.com/a/63784887/4126114
Usage:
In jupyter cell:
some_variable = "text"
%%writetemplate filename.txt
test: {some_variable}
"""
from IPython.core.magic import register_line_cell_magic
@register_line_cell_magic
@shadiakiki1986
shadiakiki1986 / t211109_ipywidgets_interact_on_dropdown_updated_from_radio.ipynb
Last active November 9, 2021 19:18
t211109_ipywidgets_interact_on_dropdown_updated_from_radio.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@shadiakiki1986
shadiakiki1986 / try-seq_alignment-pypi-package.ipynb
Created September 3, 2021 13:34
try seq_alignment pypi package.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@shadiakiki1986
shadiakiki1986 / sklearn-preprocessor-image-centering-improves-svm-rbf-against-translation-jitter.ipynb
Last active August 30, 2021 08:44
sklearn preprocessor - image centering - improves SVM-RBF against translation jitter.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@shadiakiki1986
shadiakiki1986 / svm-rbf-sensitivity-to-translation.ipynb
Last active August 30, 2021 06:22
SVM-RBF sensitivity to translation.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@shadiakiki1986
shadiakiki1986 / try-fairface-dataset.ipynb
Created August 25, 2021 21:54
try fairface dataset.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@shadiakiki1986
shadiakiki1986 / README.md
Created July 29, 2021 16:36
s3 object as a fileobj for reading tar without full download
@shadiakiki1986
shadiakiki1986 / test-dbxcli-extras.ipynb
Last active February 18, 2022 22:46
test dbxcli-extras.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@shadiakiki1986
shadiakiki1986 / nested_sizeof.py
Last active July 1, 2021 17:35
python get memory size of object
# Recursively get size of objects
# https://stackoverflow.com/a/59228005/4126114
# https://stackoverflow.com/a/38515297/4126114
# Published at https://gist.github.com/shadiakiki1986/6d2b641264b054bc63b224a726a1ead8
def nested_apply(x, func, max_depth, depth_current=0):
s1 = func(x)
if depth_current >= max_depth: return s1
wrap_napply = lambda v: nested_apply(v, func, max_depth, depth_current+1)