This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
#: Name : slides2pdf | |
#: Date : 2020-10-05 | |
#: Author : Alexandre Boucaud | |
#: Version : 1.0.0 | |
#: Description : Convert HTML slides to PDF with decktape | |
#: Options : See usage() function. | |
## Initialize defaults | |
WEBSITE="https://github.com/astefanutti/decktape" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from my_service import config | |
def create_application(): | |
engine = Engine(url=config.get_config().DB_URL) | |
... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
from scipy.ndimage import binary_dilation | |
def isolate_galaxy(image, seg_map, galaxy_value, | |
n_dilation = 5, | |
use_background_pixels = False, | |
noise_factor = 0.0): | |
""" | |
Isolate a galaxy in an image by replacing its neighbors with background noise |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tensorflow as tf | |
class GAN(tf.keras.model): | |
def __init__(self, discriminator, generator, latent_dim): | |
super(GAN, self).__init__() | |
self.discriminator = discriminator | |
self.generator = generator | |
self.latent_dim = latent_dim | |
def compile(self, d_optimizer, g_optimizer, loss_fn): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git push -o ci.skip |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://github.com/sharkdp/hyperfine | |
hyperfine --warmup 3 'fd -e jpg -uu' 'find -iname "*.jpg"' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# from https://bernd.dev/2020/04/trim-videos-instantly/ | |
INFILE="video.mp4" | |
OUTFILE="shortenedclip.mp4" | |
START="00:00:12.35" # Start Time in hh:mm:ss.msec format | |
DURATION="00:01:05.4" # Duration in hh:mm:ss.msec format | |
################## Alternative format ################## | |
# START="12.35" # Start time in s.msec format # |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ffmpeg -f gif -i dancing-baby.gif dancing-baby.mp4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://pandas.pydata.org/pandas-docs/stable/reference/style.html | |
# https://towardsdatascience.com/style-pandas-dataframe-like-a-master-6b02bf6468b0 | |
import pandas as pd | |
# Option examples | |
pd.set_option('precision', 4) | |
pd.set_option('max_rows', 10) | |
pd.set_option('max_columns', 7) | |
pd.set_option("display.max_colwidth", -1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import matplotlib.pyplot as plt | |
N = 10 | |
colors = plt.cm.viridis(np.linspace(0.25, 1.0, N)) | |
x = np.linspace(0, 1, 30) | |
powers = np.arange(N) + 1 | |
for power, color in zip(powers, colors): |
NewerOlder