Skip to content

Instantly share code, notes, and snippets.

View rayheberer's full-sized avatar
🏠
Working from home

Ray Heberer rayheberer

🏠
Working from home
View GitHub Profile
builtin_data <- data()$results[, "Item"]
builtin_df_names <- builtin_data %>%
purrr::set_names() %>%
purrr::map(purrr::possibly(get, otherwise = NULL)) %>%
purrr::keep(is.data.frame) %>%
purrr::map(names) %>%
purrr::compact()
colors <- c("red", "green", "yellow")
vehicles <- c("bicycle", "car", "submarine", "airplane")
colored_vehicles <- purrr::cross2(colors, vehicles) %>%
purrr::map_chr(~paste(.[[1]], .[[2]]))
colors <- c("red", "green", "yellow")
vehicles <- c("bicycle", "car", "submarine", "airplane")
colored_vehicles <- colors %>%
purrr::map(function(color) {
purrr::map_chr(vehicles, ~paste(color, .))
}) %>%
purrr::flatten() %>%
unlist()
animals <- c("lion", "tiger", "rhinoceros")
animal_nchars <- animals %>%
purrr::set_names() %>%
purrr::map(nchar)
Blood of Eden is made up of humans that left earth before the resurrection. Their "eden" is the earth itself, and they seek "revenge for the 10 billion"
The 10 billion are the humans who were left on Earth when the resurrection - presumably following some extinction event - occurred.
John orchestrated the extinction in order to ascend to godhood. By killing all life in the solar system, he created the 9 resurrection beasts.
Alecto is the resurrection beast of Earth, which John made into his cavalier and performed perfect Lyctorhood with.
So John is basically a super-lyctor powered by the soul of a planet, rather than of another human.
import plotly.graph_objects as go
import plotly.express as px
def make_barpolar(vals, labels=None, colors=None, layout_options = None, **fig_kwargs):
# infer slice angles
num_slices = len(vals)
theta = [(i + 1.5) * 360 / num_slices for i in range(num_slices)]
width = [360 / num_slices for _ in range(num_slices)]
import tensorflow as tf
from tf.keras.regularizers import l2
def build_nn(input_shape,
hidden_units=(20, 20),
output_size=1,
output_activation=None,
hidden_activation=tf.nn.relu,
dropout=0.0,
regularization=0.0):
import tensorflow as tf
def build_nn(input_shape, hidden_units=(20, 20), output_size=1, output_activation=None):
inputs = tf.keras.Input(shape=input_shape)
hidden = inputs
for layer_units in hidden_units:
hidden = tf.keras.layers.Dense(layer_units, activation=tf.nn.relu)(hidden)
outputs = tf.keras.layers.Dense(output_size, activation=output_activation)(hidden)
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits import mplot3d
def plot_surface(domain, fn, grid_samples=100, title=None, **plot_kwargs):
x = np.linspace(domain[0][0], domain[0][1], grid_samples)
y = np.linspace(domain[1][0], domain[1][1], grid_samples)
X, Y = np.meshgrid(x, y)
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits import mplot3d
def plot_surface(domain, fn, title=None, grid_samples=100):
x = np.linspace(domain[0][0], domain[0][1], grid_samples)
y = np.linspace(domain[1][0], domain[1][1], grid_samples)
X, Y = np.meshgrid(x, y)