Skip to content

Instantly share code, notes, and snippets.

@RensDimmendaal
RensDimmendaal / seam-carving-object-removal.jl
Last active September 15, 2020 01:39
seam carving for object removal in julia & pluto.jl
### A Pluto.jl notebook ###
# v0.11.14
using Markdown
using InteractiveUtils
# This Pluto notebook uses @bind for interactivity. When running this notebook outside of Pluto, the following 'mock version' of @bind gives bound variables a default value (instead of an error).
macro bind(def, element)
quote
local el = $(esc(element))
@RensDimmendaal
RensDimmendaal / rich-logging.py
Last active June 16, 2021 13:33
rich logging
#logger.py
import logging
from rich.logging import RichHandler
logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)
# the handler determines where the logs go: stdout/file
shell_handler = RichHandler()
@RensDimmendaal
RensDimmendaal / azure-pipelines.yaml
Last active June 18, 2021 06:11
azure pipelines
‎‎​
@RensDimmendaal
RensDimmendaal / git-update-after-failed-pre-commit.md
Last active June 28, 2021 17:41
git update after failed pre-commit

Git update after failed pre-commit

Do your commits fail because of pre-commit?

Do those hooks tend to fix the problems they detect? E.g. python's black and isort?

Are you frustrated by having to find out which items were changed and should be updated? Did you ever accidentally add items because you did a lazy git add . when you shouldn't have?

@RensDimmendaal
RensDimmendaal / jupyter-notebook-top-cell.md
Created July 6, 2021 12:32
jupyter notebook top cell

Title

Author:

Date:

Goal:

Conclusion:

split cell here

def explode_list_of_dicts(df,col):
exploded_rows = df.explode(col)
exploded_cols = exploded_rows[col].apply(pd.Series)
return pd.concat([
exploded_rows.drop(col,axis=1),
exploded_cols
],
axis=1
)
@RensDimmendaal
RensDimmendaal / roman-numerals-altair-embeddings-plot.py
Last active November 1, 2021 02:52
Snippets for the data centric ai roman numerals competition
import base64
from pathlib import Path
from typing import Sequence, Union
import altair as alt
import numpy as np
import pandas as pd
import tensorflow as tf
import umap
from tensorflow.python.keras.preprocessing.image_dataset import (
@RensDimmendaal
RensDimmendaal / roman-numerals-altair-embeddings-plot.py
Created August 24, 2021 15:56
Roman Numerals Altair Embeddings
import base64
from pathlib import Path
from typing import Sequence, Union
import altair as alt
import numpy as np
import pandas as pd
import tensorflow as tf
import umap
from tensorflow.python.keras.preprocessing.image_dataset import (