Skip to content

Instantly share code, notes, and snippets.

View apparentlymart's full-sized avatar
⌨️
I may be slow to respond.

Martin Atkins apparentlymart

⌨️
I may be slow to respond.
View GitHub Profile
@apparentlymart
apparentlymart / ec2-example.pad
Last active August 29, 2015 14:23
Example configs for Terraform-based build tool (codename Padstone)
provider "aws" {
region = "us-west-2"
}
provider "aws" {
region = "us-west-1"
alias = "us-west-1"
}
temporary_resource "aws_instance" "source" {
// ..
@apparentlymart
apparentlymart / README.md
Last active August 29, 2015 14:26
AngularJS-Server with Browserify example

angularjs-server with browserify example

This is a basic example of using AngularJS-server with browserify. Since browserify requires bundling, unlike the plain example in the AngularJS-Server readme we need to provide a bundle to both the server-side Angular context and to the browser.

The two bundles can be created using browserify:

@apparentlymart
apparentlymart / write_vfat.go
Created December 20, 2015 06:24
Make VFAT filesystem from Go
package main
import (
"encoding/binary"
"fmt"
"io"
"os"
)
const bytesPerSector = 512
@apparentlymart
apparentlymart / blink.ala
Last active December 22, 2015 03:18
Alamatic Examples
@apparentlymart
apparentlymart / gist:7283209
Created November 2, 2013 20:36
Prototype circuit definition language. Just brainstorming so far.
import max1234
part MAX1 is max1234
interface I2C:
pin DATA
pin CLOCK
interface SPIBus:
@apparentlymart
apparentlymart / clock.ala
Created November 11, 2013 01:49
Alamatic Clock Example
import time
import coll
enum HourType:
#: A 12-hour time in the morning.
AM
#: A 12-hour time in the afternoon/evening.
PM
#: A 24-hour time
@apparentlymart
apparentlymart / closures.c
Created January 4, 2014 04:07
Fat function pointers in C, to implement closures and object-bound methods
#include <stdio.h>
// we'd generate one of these for each distinct function signature
typedef struct {
void (*func)();
void *env;
} Callable;
// we'd generate an environment struct for each function that needs one
@apparentlymart
apparentlymart / .padstone.hcl
Last active May 23, 2016 03:38
Padstone v2: Multiple targets, like a Makefile
# Variables are set on the command line:
# padstone build version=v0.0.1 ami
variable "version" {
default = "dev"
}
provider "aws" {
region = "us-west-2"
}
@apparentlymart
apparentlymart / NOTES.md
Last active July 26, 2016 16:57
AWS Describe/Get actions as Terraform Data Sources

AWS Describe and Get actions as Terraform Data Sources

Beyond the read-only resources that existed in Terraform before data resources were an official feature, I'd like to make room for a new pattern for re-usable modules where they accept only the minimum set of ids they need as variables and look up other data via data sources.

Here's a motivating example:

variable "aws_subnet_id" {
    description = "Id of the subnet where the EC2 instance will be created"
}
@apparentlymart
apparentlymart / keybase.md
Created September 21, 2016 23:40
Keybase Claim

Keybase proof

I hereby claim:

  • I am apparentlymart on github.
  • I am apparentlymart (https://keybase.io/apparentlymart) on keybase.
  • I have a public key whose fingerprint is BBE3 1AF5 8D12 1501 A495 FE10 6D98 B19B CF7A CB7A

To claim this, I am signing this object: