Skip to content

Instantly share code, notes, and snippets.

<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<script>
async function fetchSandwich() {
let apiUrl = 'https://***.execute-api.us-east-2.amazonaws.com/default/lambda_tutorial'
let response = await fetch(apiUrl);
let body = await response.json();
document.getElementById('sandwich-result').innerHTML = body.sandwich;
import json
import random
def lambda_handler(event, context):
""" Build a random cold-cut sandwich """
meats = [
'ham', 'salami', 'turkey', 'chicken', 'meatball', 'tempeh'
]
cheeses = [
@bennett39
bennett39 / epub.css
Last active January 26, 2019 00:06 — forked from bmaupin/epub.css
You Don't Know JS Ebooks
body {
text-align: justify;
}
code, pre {
font-family: "DejaVuSansMono", monospace;
}
h1, h2, h3, h4, h5, h6 {
text-align: left;
@bennett39
bennett39 / index.html
Last active September 2, 2018 19:52
Reverse a string
<label for="strQuery">Enter a string:</label>
<input type="text" id="strQuery">
<button type="submit" id="submit">Submit</button>
<p id="result"></p>
@bennett39
bennett39 / calculate-pi-to-nth-digit.markdown
Last active September 2, 2018 19:46
Calculate Pi to Nth Digit