Skip to content

Instantly share code, notes, and snippets.

@ajstarks
ajstarks / gist:11200992
Created April 23, 2014 02:31
Output of go build -gcflags=-w for hello.go (Go 1.2.1)
output of go build -gcflag=-w when compiling hello.go (Go 1.2.1)
# command-line-arguments
walk [100232bf8]
. NAME-fmt.Println u(1) a(1) l(4) x(0+0) class(PFUNC) tc(1) used(1) FUNC-funcSTRUCT-(FIELD-
. . NAME-fmt.a·3 u(1) a(1) l(4) x(0+0) class(PPARAM) f(1) ARRAY-[]INTER-interface {} ...INTER-interface {} "esc:0x0") STRUCT-(FIELD-
. . NAME-fmt.n·1 u(1) a(1) l(4) x(24+0) class(PPARAMOUT) f(1) int int, FIELD-
. . NAME-fmt.err·2 u(1) a(1) l(4) x(32+0) class(PPARAMOUT) f(1) error error)
walk [100255d40]
. LITERAL-"hello, world" u(1) a(1) l(8) tc(1) string
@ajstarks
ajstarks / gist:11201007
Created April 23, 2014 02:32
Output of go build -gcflags=-w for hello.go (Go 1.3beta1)
# command-line-arguments
walk [100363848]
. NAME-main.autotmp_0000 u(1) a(1) l(8) x(0+0) class(PAUTO) esc(N) tc(1) used(1) string
walk [1003620d0]
. LITERAL-"hello, world" u(1) a(1) l(8) tc(1) string
walk [100364300]
. AS u(2) l(8) tc(1)
. . NAME-main.autotmp_0000 u(1) a(1) l(8) x(0+0) class(PAUTO) esc(N) tc(1) used(1) string
. . LITERAL-"hello, world" u(1) a(1) l(8) tc(1) string
walk [10033dd78]
sudo python -m smtpd -n -c DebuggingServer localhost:25
@ajstarks
ajstarks / gist:3211380054f996fa0828
Created June 21, 2014 14:35
OpenVG character map
package main
import (
"bufio"
"github.com/ajstarks/openvg"
"os"
"fmt"
)
func main() {
@ajstarks
ajstarks / makeslides.go
Created July 5, 2014 08:48
Slide generation example
package main
import (
"os"
"github.com/ajstarks/deck/generate"
)
func main() {
deck := generate.NewSlides(os.Stdout, 0, 0)
deck.StartDeck() // start the deck
@ajstarks
ajstarks / slidegen.go
Last active August 29, 2015 14:03
Slide generation experiments
package main
import (
"fmt"
"github.com/ajstarks/deck/generate"
"image"
"bufio"
_ "image/jpeg"
_ "image/png"
"strings"
func cube(d *generate.Deck, x, y, w, h float64, color string) {
xc := make([]float64, 4)
yc := make([]float64, 4)
w2 := w/2
h5 := h * .2
yh := y+h
xc[0], xc[1], xc[2], xc[3] = x-w2, x, x+w2, x
yc[0], yc[1], yc[2], yc[3] = yh-h5, yh, y-h5, yh-(y5*2)
// cube makes a cube with its front-facing bottom edge at x,y, lit from the top
func cube(d *generate.Deck, x, y, w, h float64, color string) {
xc := make([]float64, 4)
yc := make([]float64, 4)
w50 := w/2
h20 := h * .2
h40 := h20 * 2
yh := y+h
// pbox -- porportional box
package main
import (
"encoding/xml"
"fmt"
"github.com/ajstarks/svgo"
"io"
"os"
)
@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"/>