Skip to content

Instantly share code, notes, and snippets.

@buth
buth / cloud-config.yml
Created July 15, 2015 18:17
Autmoatically format and mount a drive with CoreOS Cloud-Config
#cloud-config
coreos:
units:
- name: format-drive.service
command: start
content: |
[Unit]
Description=Formats the drive
After=dev-xvdc.device
@buth
buth / Dockerfile
Created September 2, 2015 21:13
Install PhantomJS
ENV PHANTOMJS_VERSION=1.9.8
RUN \
cd /usr/local && \
curl -fLO https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-$PHANTOMJS_VERSION-linux-x86_64.tar.bz2 && \
tar --strip-components 1 -xjf phantomjs-$PHANTOMJS_VERSION-linux-x86_64.tar.bz2 phantomjs-$PHANTOMJS_VERSION-linux-x86_64/bin/phantomjs && \
rm phantomjs-$PHANTOMJS_VERSION-linux-x86_64.tar.bz2
@buth
buth / dm.bash
Created October 28, 2015 18:42
Bash function for setting the Docker machine environment.
dm() {
status=$(docker-machine status dev)
if [ $? -ne 0 ]; then
echo "Got an error trying to get VM status"
return
fi
case $status in
Stopped)
@buth
buth / iterator.go
Last active May 2, 2024 05:38
Generic Iterator interface and MongoDB implementation
package iterator
type Iterator interface {
Next() (value interface{}, done bool, err error)
}
{
"properties" : {
"name" : "Ayer",
"geometry" : {
"lat" : 42.56,
"lng" : -71.58
},
"city" : "Ayer",
"state" : "MA",
"zipcode" : "01432"

Keybase proof

I hereby claim:

  • I am buth on github.
  • I am buth (https://keybase.io/buth) on keybase.
  • I have a public key ASDNSWn2sg3l9w5AP0Uc9DFz0Q8VQheJxXrruxNI66HUKwo

To claim this, I am signing this object: