Skip to content

Instantly share code, notes, and snippets.

@mpage
mpage / gist:3189344
Created July 27, 2012 17:49
Possible race
it should behave like drain
should cause the warden to exit after all connections are closed
should break connections that are inactive
should break link requests
should break run requests
should break stream requests
should snapshot all containers
should recreate existing containers
should not place existing containers networks back into the pool
terminate called after throwing an instance of 'std::runtime_error'
::Membrane::SchemaParser.parse do
{
"base_dir" => String,
optional("local_route") => String,
"logging" => {
"level" => String,
optional("file") => String,
optional("syslog") => String,
jobs:
- name: dea
template: dea
instances: 0
resource_pool: deas
networks:
- name: default
- name: dea_next
template: dea_next
class User
SCHEMA = Membrane::SchemaParser.parse do
{ "foo" => String,
"bar" => [Integer],
}
end
end
class Org
SCHEMA = Membrane::SchemaParser.parse do
git log --author=mpage --oneline --shortstat --pretty=tformat: --numstat | awk '{ a += $1; d += $2 } END { printf "%d added, %d removed", a, d }'
> cd /tmp/
> git clone [email protected]:cloudfoundry/warden.git
Cloning into 'warden'...
Warning: Permanently added the RSA host key for IP address '192.30.252.129' to the list of known hosts.
remote: Counting objects: 7683, done.
remote: Compressing objects: 100% (3938/3938), done.
remote: Total 7683 (delta 3752), reused 7062 (delta 3233)
Receiving objects: 100% (7683/7683), 1.93 MiB | 1.70 MiB/s, done.
Resolving deltas: 100% (3752/3752), done.
> cd warden/
SELECT nextval(pg_get_serial_sequence('<table>', '<column>'))
FROM generate_series(0, <num_children>)
  1. General Background and Overview
@mpage
mpage / gist:084a26befcd76d697879
Created January 26, 2015 07:40
Evaluator for a simple ast. A little mind blowing.
import Data.Map
import Control.Monad
number = return
add = liftM2 (+)
multiply = liftM2 (*)
variable = findWithDefault 0
environment = fromList [("a",3), ("b",4), ("c",7)]
@mpage
mpage / gist:cc1c160d1cd17803576b
Created June 10, 2015 20:28
Terraform crash report
This file has been truncated, but you can view the full file.
2015/06/10 20:27:49 [INFO] Terraform version: 0.5.3 b62875a0f01db282a536404b876430ae8e4c1a48+CHANGES
2015/06/10 20:27:49 Detected home directory from env var: /home/vagrant
2015/06/10 20:27:49 [DEBUG] Discovered plugin: atlas = /home/vagrant/bin/terraform-provider-atlas
2015/06/10 20:27:49 [DEBUG] Discovered plugin: aws = /home/vagrant/bin/terraform-provider-aws
2015/06/10 20:27:49 [DEBUG] Discovered plugin: cloudflare = /home/vagrant/bin/terraform-provider-cloudflare
2015/06/10 20:27:49 [DEBUG] Discovered plugin: cloudstack = /home/vagrant/bin/terraform-provider-cloudstack
2015/06/10 20:27:49 [DEBUG] Discovered plugin: consul = /home/vagrant/bin/terraform-provider-consul
2015/06/10 20:27:49 [DEBUG] Discovered plugin: digitalocean = /home/vagrant/bin/terraform-provider-digitalocean
2015/06/10 20:27:49 [DEBUG] Discovered plugin: dme = /home/vagrant/bin/terraform-provider-dme
2015/06/10 20:27:49 [DEBUG] Discovered plugin: dnsimple = /home/vagrant/bin/terraform-provider-dnsimple