Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@savaki
savaki / main.go
Created December 31, 2017 16:53
performance of kafka-go consumer group reader
package main
import (
"context"
"crypto/tls"
"crypto/x509"
"flag"
"fmt"
"io/ioutil"
"log"
@savaki
savaki / main.go
Last active August 22, 2022 09:27
comparison of confluent-kafka-go vs sarama-cluster consumer performance
package main
import (
"crypto/tls"
"crypto/x509"
"flag"
"fmt"
"io/ioutil"
"log"
"os"
@savaki
savaki / gist:afd87416d85439066702e8051f04878b
Created November 1, 2017 15:29
toy event source example
package main
import (
"context"
"fmt"
"log"
"time"
"github.com/altairsix/eventsource"
)
@savaki
savaki / drawing.go
Created April 30, 2015 01:59
Re: A Rust Contributor Tries Their Hand at Go
package main
import "os"
var (
Red = rgb(255, 0, 0)
Blue = rgb(0, 0, 255)
)
func rgb(red, green, blue int) Color {
package main
import (
"fmt"
"os/exec"
)
func main() {
// in this example, the offending docker code has been placed in a shell script
command := fmt.Sprintf("/bin/bash sample.sh")
package main
import (
"fmt"
"os/exec"
)
func main() {
command := fmt.Sprintf("echo 'this works'")
package main
import (
"fmt"
"os/exec"
)
func main() {
tag := "ec2-xxx-xxx-xxx-xxx.us-west-1.compute.amazonaws.com:5000/sample/app:1.0.20"
command := fmt.Sprintf("docker run -i --rm -t %s /bin/bash -c 'cat /etc/hosts'", tag)
<html>
<head>
<style type="text/css">
table table {
width: 600px !important;
}
table div + div { /* main content */
width: 65%;
float: left;
}