Skip to content

Instantly share code, notes, and snippets.


Luke Hoban lukehoban

View GitHub Profile
lukehoban / lambda_test.go
Created Feb 25, 2020
Untyped Lambda Calculus, Chruch Numerals, Y Combinator in Golang
View lambda_test.go
package main
import (
type V func(v V) V
lukehoban / waitForJob.ts
Last active Aug 4, 2020
Pulumi program which waits on Jobs during a Kubernetes deployment
View waitForJob.ts
import * as pulumi from "@pulumi/pulumi";
import * as k8s from "@pulumi/kubernetes";
import * as k8sOutput from "@pulumi/kubernetes/types/output";
import * as k8sapi from 'kubernetes-client';
const job = new k8s.batch.v1.Job("job", {
spec: {
template: {
spec: {
containers: [{
lukehoban / index.ts
Created Jun 20, 2019
Passing credentials to a Pulumi dynamic provider
View index.ts
import * as splunk from "./splunk"
async function getSecretValue(): Promise<string> {
return "abcd"
getSecretValue().then(secret => {
new splunk.SavedSearch("foo", {});
lukehoban / index.ts
Last active Nov 16, 2020
Simple Aurora Serverless + Lambda VPC example with Pulumi
View index.ts
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
import * as awsx from "@pulumi/awsx";
import * as random from "@pulumi/random";
// Construct a VPC
const vpc = new awsx.ec2.Vpc("vpc");
// Create an Aurora Serverless MySQL database
const dbsubnet = new aws.rds.SubnetGroup("dbsubnet", {
View managedkubernetes.ts
import * as awsx from "@pulumi/awsx";
import * as eks from "@pulumi/eks";
import * as k8s from "@pulumi/kubernetes";
// Create an AWS VPC and EKS cluster
const vpc = new awsx.Vpc("vpc", { usePrivateSubnets: false });
const cluster = new eks.Cluster("cluster", {
vpcId: vpc.vpcId,
subnetIds: vpc.subnetIds,
lukehoban / apigatewaydomain.ts
Last active Feb 26, 2021
API Gateway Domain Mapping in Pulumi
View apigatewaydomain.ts
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
// The services we want to host on our domain...
const api1 = new aws.apigateway.x.API("api1", {
routes: [
{method: "GET", path: "/", eventHandler: async(ev) => {
return {
statusCode: 200,
body: JSON.stringify({hello: "world"}),
lukehoban / thumbnailer.js
Created Jun 18, 2018
Serverless + Containers with Pulumi
View thumbnailer.js
const cloud = require("@pulumi/cloud-aws");
const aws = require("@pulumi/aws");
// A bucket to store videos and thumbnails.
const bucket = new cloud.Bucket("bucket");
const bucketName =;
// A task which runs a containerized FFMPEG job to extract a thumbnail image.
const ffmpegThumbnailTask = new cloud.Task("ffmpegThumbTask", {
build: "./docker-ffmpeg-thumb",
lukehoban / helloworld.js
Created Jun 18, 2018
A simple Pulumi program
View helloworld.js
const cloud = require("@pulumi/cloud-aws");
const endpoint = new cloud.API("hello");
endpoint.static("/", "www");
endpoint.get("/source", (req, res) => res.json({name: "AWS"}));
exports.url = endpoint.publish().url;
View expression.str
interface IHashtable
double lookup(string i);
void set(string i, double d);
class Hashtable()
var o = {};
View ClosureCompiler.svc.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using System.ServiceModel.Activation;
using System.Net;
using System.IO;
using System.Web;