Skip to content

Instantly share code, notes, and snippets.

@damienmarlier51
damienmarlier51 / junix_setup.py
Created September 11, 2022 05:00
Junix setup.py
from setuptools import setup
setup(
name="junix",
version="0.1.4",
author="Damien Marlier",
author_email="damien.marlier@hotmail.fr",
description="Utils to export images from Jupyter notebook",
packages=["junix"],
entry_points={"console_scripts": ["junix = junix.cli:export_images"]},
@damienmarlier51
damienmarlier51 / junix_cli.py
Created September 11, 2022 04:59
Junix cli
from typing import Optional
from junix import junix
import click
@click.command()
@click.option("-f", "--filepath", "filepath", required=True)
@click.option("-o", "--output_dir", "output_dir", default=None)
@click.option("-p", "--prefix", "prefix", default=None)
def export_images(
filepath: str, output_dir: Optional[str] = None, prefix: Optional[str] = None
@damienmarlier51
damienmarlier51 / is_sns_notification_valid.py
Last active June 6, 2020 06:03
Validate AWS SNS notification
from cryptography.hazmat.primitives.asymmetric import padding, rsa
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import hashes
from urllib.parse import urlparse
from cryptography import x509
import requests
import base64
def is_sns_notification_valid(body):
@damienmarlier51
damienmarlier51 / junix.py
Last active September 11, 2022 05:00
Junix Exporter
import base64
import json
import os
from typing import Dict, List, Optional
def get_images(notebook_dict: Dict) -> List[Dict]:
return [
{
@damienmarlier51
damienmarlier51 / ray_casting.py
Created June 3, 2018 15:14
Fast Ray Casting using tensorflow. When running the example, press right click on matplotlib graph to add a point to the polygon, press left click to close the polygon.
import numpy as np
import pandas as pd
import matplotlib
import matplotlib.cm as cm
import matplotlib.colors as cl
import matplotlib.pyplot as plt
import matplotlib.patches as patches
import itertools
import time
import sys