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
# Fish shell | |
# REUSE ENVIRONMENT VARIABLES FROM ~/.bash_profile | |
bash -c '. ~/.bash_profile; env' | while read e | |
set var (echo $e | sed -E "s/([a-zA-Z0-9_]+)=(.*)\$/\1/") | |
set value (echo $e | sed -E "s/([a-zA-Z0-9_]+)=(.*)\$/\2/") | |
# remove surrounding quotes if existing | |
set value (echo $value | sed -E "s/^\"(.*)\"\$/\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 base64 | |
import ecdsa | |
def generate_vapid_keypair(): | |
""" | |
Generate a new set of encoded key-pair for VAPID | |
""" | |
pk = ecdsa.SigningKey.generate(curve=ecdsa.NIST256p) | |
vk = pk.get_verifying_key() |
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 | |
import tensorflow.keras as keras | |
import numpy as np | |
model = keras.Sequential([keras.layers.Dense(units=1, input_shape=[1])]) | |
model.compile(optimizer='sgd', loss='mean_squared_error') | |
xs = np.array([-1.0, 0.0, 1.0, 2.0, 3.0, 4.0], dtype=float) | |
ys = np.array([-3.0, -1.0, 1.0, 3.0, 5.0, 7.0], dtype=float) |
OlderNewer