Skip to content

Instantly share code, notes, and snippets.

@ajstarks
ajstarks / gist:0c4af5aac10488be17de
Created July 18, 2015 12:19
Go1.5 Beta2 build and test failure: linux/arm (Raspberry Pi 2)
pi@raspberrypi ~/go/src $ time ./all.bash
##### Building Go bootstrap tool.
cmd/dist
##### Building Go toolchain using /home/pi/go1.4.
bootstrap/internal/obj
bootstrap/asm/internal/flags
bootstrap/compile/internal/big
bootstrap/internal/gcprog
bootstrap/internal/obj/arm
@ajstarks
ajstarks / gist:96ce2254ec447925fad6
Created July 12, 2015 11:13
Go 1.5beta1 build (Mac OS X 10.10.4)
$ time ./all.bash
##### Building Go bootstrap tool.
cmd/dist
##### Building Go toolchain using /Users/ajstarks/go1.4.
bootstrap/internal/obj
bootstrap/asm/internal/flags
bootstrap/compile/internal/big
bootstrap/internal/gcprog
bootstrap/internal/obj/arm
// Copyright 2015 Google Inc. All Rights Reserved.
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
@ajstarks
ajstarks / uni.go
Last active August 29, 2015 14:22
Make unicode tables
// uni: make glyph tables
package main
import (
"flag"
"fmt"
"os"
"github.com/ajstarks/svgo"
)
@ajstarks
ajstarks / gurl.go
Created January 23, 2015 02:13
gurl - get URL
// gurl - get the contents of a url to stdout, -v show response on stderr
package main
import (
"errors"
"flag"
"fmt"
"io"
"net/http"
"os"
@ajstarks
ajstarks / fitlist.go
Created January 14, 2015 13:06
fitlist.go
package main
import (
"os"
"github.com/ajstarks/deck/generate"
)
@ajstarks
ajstarks / dp.xml
Created January 6, 2015 03:26
data -> picture
<slide>
<text xp="30" yp="48" sp="5" align="right">Data</text>
<text xp="70" yp="48" sp="5" align="left">Picture</text>
<rect xp="45" yp="50" wp="28" hp="4" color="gray"/>
<polygon xc="58 70 58" yc="55 50 45" color="gray"/>
</slide>
@ajstarks
ajstarks / gist:9095aaef22f21ba22104
Last active August 29, 2015 14:11
Programming Pictures: Read/Parse/Draw pattern

The other side of Go: Programming Pictures, the Read, Parse, Draw Pattern

Go has proven to be extremely versatile and well suited to back-end tasks, but sometimes you need a picture, and I've found that Go works well for generating visuals as well. This post will explore one method for generating pictures (specifically vector graphics) from data using the SVGo package.

The SVGo package API

@ajstarks
ajstarks / gist:8f431dc8fca958bd543a
Created November 16, 2014 15:05
compx description for a call graph
<components gutter="50" top="50" left="50" gc="steelblue">
<comp id="io" name="io" row="0" col="1" width="120" height="40" shape="plain">
<connect mark="d" dest="errors" sloc="e" dloc="w"/>
<connect mark="d" dest="sync" sloc="s" dloc="n"/>
</comp>
<comp id="errors" name="errors" row="0" col="2" width="120" height="40" shape="plain"/>
<comp id="sync" name="sync" row="1" col="1" width="120" height="40" shape="plain">
<connect mark="d" dest="sa" sloc="w" dloc="n" dir="ccw"/>
// pbox -- porportional box
package main
import (
"encoding/xml"
"fmt"
"github.com/ajstarks/svgo"
"io"
"os"
)