python toy.py
curl -X PUT localhost:8080/[name]
#!/usr/bin/env bash | |
# Demonstration of asymmetric cryptography, using Amazon KMS as the | |
# asymmetric key store and OpenSSL for client-side symmetric encryption. | |
# | |
# THIS SHOULD NOT BE CONSIDERED A SECURE IMPLEMENTATION. | |
set -euo pipefail | |
get-public-key() { |
from math import pi | |
from .shape import Shape, Circle, Rectangle | |
def area(shape: Shape) -> float: | |
""" | |
Calculate the area of the given shape | |
""" | |
match shape: |
#!/usr/bin/env bash | |
map() { | |
local fn="$1" | |
local input | |
while read -r input; do | |
"${fn}" "${input}" | |
done | |
} |
import argparse | |
import sys | |
from enum import Enum | |
class Viewport(Enum): | |
All = "all" | |
WorkingDirectory = "here" | |
OwnedByMe = "mine" | |
# NOTE The property decorator doesn't work on default and choices, |
{ pkgs ? import <nixpkgs> {}, name, packages ? {}}: | |
with pkgs; | |
let | |
# We need bash and coreutils to display the container "run" message; | |
# dockerTools.buildImage expects a list of derivations, not a set | |
required = { inherit bash coreutils; }; | |
contents = builtins.attrValues (required // packages); | |
prettyPrint = import ./prettyPrint.nix {}; |
#!/usr/bin/env bash | |
set -euo pipefail | |
readonly WORDS="${WORDS-/usr/share/dict/words}" | |
readonly MINIMUM_LENGTH="${MINIMUM_LENGTH-3}" | |
limit-alphabet() { | |
local alphabet="$1" | |
grep -E "^[${alphabet}]{${MINIMUM_LENGTH},}$" |
import os | |
from keystoneauth1 import identity, session | |
from neutronclient.v2_0 import client | |
def _neutron(): | |
creds = { | |
"auth_url": os.environ["OS_AUTH_URL"] + "/v3", | |
"username": os.environ["OS_USERNAME"], | |
"password": os.environ["OS_PASSWORD"], | |
"project_name": os.environ["OS_PROJECT_NAME"], |
#lang racket/base | |
(require racket/contract | |
racket/match | |
racket/math) | |
(define numerator/c exact-integer?) | |
(define denominator/c (and/c exact-integer? (not/c zero?))) | |
(define Q/c (->i ((msg (symbols 'p 'q '->exact))) |
#!/usr/bin/env bash | |
declare INDEX="$(cloud-init query ds.meta_data.meta.index)" | |
declare TOTAL="$(cloud-init query ds.meta_data.meta.total)" | |
echo "Hello, World! This is instance $(( INDEX + 1 )) of ${TOTAL}." \ | |
| tee /root/hello.txt |