Skip to content

Instantly share code, notes, and snippets.

@mlafeldt
mlafeldt / recipe.rb
Created January 9, 2015 10:47
Package Go tools with fpm-cookery (automatically uses godep dependencies if present)
class ChefRunner < FPM::Cookery::Recipe
GOPACKAGE = "github.com/mlafeldt/chef-runner"
name "chef-runner"
version "0.8.0"
revision 1
source "https://#{GOPACKAGE}/archive/v#{version}.tar.gz"
sha256 "a7de23f989f8353ecf838b551a8ceff09b83c8aeff2553b2c31d57615f8fcc53"
description "The fastest way to run Chef cookbooks"
@staltz
staltz / introrx.md
Last active June 29, 2024 15:58
The introduction to Reactive Programming you've been missing
@egonelbre
egonelbre / astar_nodequeue.go
Last active June 29, 2023 09:43
Go A* implementation
package astar
import "container/heap"
type NodeQueue []Node
func NewNodeQueue() NodeQueue {
return make(NodeQueue, 0, 1000)
}
@tobstarr
tobstarr / types.go
Created February 28, 2014 09:59
Cloudformation Golang DSL
package main
import (
"encoding/json"
"strings"
)
// base types
type Hash map[string]interface{}
type List []interface{}
@karalabe
karalabe / main.go
Last active October 23, 2023 18:21
Access Google services through service accounts in Go
package main
import (
"code.google.com/p/goauth2/oauth/jwt"
"code.google.com/p/google-api-go-client/storage/v1beta2"
"fmt"
"log"
"regexp"
)
@zxvdr
zxvdr / ssh
Created January 2, 2014 23:41
SSH proxy
package main
import (
"bytes"
"code.google.com/p/go.crypto/ssh"
"fmt"
"log"
"net"
"os"
)
@s0enke
s0enke / gist:7821956
Last active December 30, 2015 11:19
as puppet is declarative and the catalogue is a graph, we can just include the realization of virtual resources anywhere in code. even at the stage where the virtual resource gets declared
# this leads to the realization of both declared resources:
# soenke♥kellerautomat:~/projects/playground (master)$ puppet apply manifests/init.pp
# virtual resource 2
# /Stage[main]/Some_module/Virtual_resource_declarer2[virtual resource 2]/Virtual_resource[virtual resource 2]/Notify[virtual resource 2]/message: defined 'message' as 'virtual resource 2'
# virtual resource 1
# /Stage[main]/Some_module/Virtual_resource_declarer1[virtual resource 1]/Virtual_resource[virtual resource 1]/Notify[virtual resource 1]/message: defined 'message' as 'virtual resource 1'
# Finished catalog run in 0.61 seconds
node default {
Versioning is an anti-pattern
=============================
We often say "use the right tool for the job", but when managing change
in software systems, we always use versioning. Hypermedia APIs are
actually hindered by introducing versioning and manage change in a
different way. With that in mind, there are also a lot of options for
managing change in a Hypermedia API. We'd like to change our service and
break as few clients as possible. Versioning is only one way to manage
change, though... and my contention is that it's not appropriate for
package main
import (
"encoding/json"
"errors"
"fmt"
"reflect"
"regexp"
"strconv"
"strings"
@wofeiwo
wofeiwo / fcgiclient.go
Created September 15, 2012 09:08
Golang FastCGI Client
// Copyright 2012 Junqing Tan <ivan@mysqlab.net> and The Go Authors
// Use of this source code is governed by a BSD-style
// Part of source code is from Go fcgi package
// Fix bug: Can't recive more than 1 record untill FCGI_END_REQUEST 2012-09-15
// By: wofeiwo
package fcgiclient
import (