Skip to content

Instantly share code, notes, and snippets.

View theophoric's full-sized avatar
💭
👾

theophoric theophoric

💭
👾
View GitHub Profile
@theophoric
theophoric / struct_field_setting.go
Created March 11, 2014 00:13
setting dynamic content into struct
package main
import (
"fmt"
"reflect"
)
type Node struct {
Name string
Code int
@theophoric
theophoric / http_errors.go
Created March 10, 2014 05:41
testing errors
package main
import (
"errors"
"fmt"
)
type HttpError struct {
code int
error
package main
import (
"bytes"
"encoding/hex"
"fmt"
"io"
"io/ioutil"
"net/http"
/*
An interface is a category of type that defines a set of methods. An interface is valid as long as it or the value it holds ( e.g. a struct ) implements those methods
*/
package main
import (
find . -name '*erb' | \
xargs ruby -e 'ARGV.each { |i| puts "html2haml -r #{i} #{i.sub(/erb$/,"haml")}"}' | \
bash