git clone https://gist.github.com/dd6f95398c1bdc9f1038.git vault
cd vault
docker-compose up -d
export VAULT_ADDR=http://192.168.99.100:8200
Initializing a vault:
vault init
#!/bin/bash -e | |
echo ' | |
PATH=$HOME/go/bin:$PATH | |
export GOPATH=$HOME | |
export CDPATH=.:$HOME/src/golang.org/x:$HOME/go/src:$HOME/src/github.com:$HOME/src/github.com/nf:$HOME/src/github.com/adg | |
export EDITOR=vim | |
' >> ~/.profile | |
sudo apt-get update |
// What do you guys think about this as a way to possibly pass streams | |
// around from one module to another? I don't think it comes up in simple | |
// examples but I can see in complex cases where if you wanted a separation of | |
// concerns for a stream, that you might want them to be passed around. It | |
// kind of opens up a protocol for communication between modules. | |
// | |
// Essentially this is a widgetMaker module which is responsible for making | |
// widgets. And the widgetKing module wants to be notified every time a widget | |
// comes off the factory floor. |
package consumer | |
import ( | |
"errors" | |
"testing" | |
"github.com/bitly/go-nsq" | |
) | |
// tests nsq.HandlerFunc. just write the function in line in the test |
git clone https://gist.github.com/dd6f95398c1bdc9f1038.git vault
cd vault
docker-compose up -d
export VAULT_ADDR=http://192.168.99.100:8200
Initializing a vault:
vault init
FROM golang:1.4 | |
# install gpm | |
RUN git clone https://github.com/pote/gpm.git /tmp/gpm | |
WORKDIR /tmp/gpm | |
RUN ./configure && make install | |
# sets the working directory to the application source for convenience | |
ADD . /go/src/github.com/larryprice/myapp | |
WORKDIR /go/src/github.com/larryprice/myapp |
. | |
βββ books | |
βΒ Β βββ handlers.go | |
βΒ Β βββ models.go | |
βββ config | |
βΒ Β βββ db.go | |
βββ main.go |
/* | |
* Sample API with GET and POST endpoint. | |
* POST data is converted to string and saved in internal memory. | |
* GET endpoint returns all strings in an array. | |
*/ | |
package main | |
import ( | |
"encoding/json" | |
"flag" |
Since Twitter doesn't have an edit button, it's a suitable host for JavaScript modules.
Source tweet: https://twitter.com/rauchg/status/712799807073419264
const leftPad = await requireFromTwitter('712799807073419264');
# import config. | |
# You can change the default config with `make cnf="config_special.env" build` | |
cnf ?= config.env | |
include $(cnf) | |
export $(shell sed 's/=.*//' $(cnf)) | |
# import deploy config | |
# You can change the default deploy config with `make cnf="deploy_special.env" release` | |
dpl ?= deploy.env | |
include $(dpl) |