This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
go mod init hof.io/inception | |
go mod tidy | |
go run main.go |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"bytes" | |
"fmt" | |
"os" | |
"text/template" | |
) | |
var tmpl = ` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -euo pipefail | |
COOKIE="user=verdverm&..." | |
USERNAME="verdverm" | |
BASEURL="https://news.ycombinator.com/upvoted" | |
PAGE=0 | |
mkdir -p html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func (v Value) Attributes() map[string]Attribute { | |
attrs := map[string]Attribute{} | |
// return empty | |
if v.path == nil || v.path.attrs == nil { | |
return attrs | |
} | |
// collect attribues | |
for _, a := range v.path.attrs.attr { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type: | |
name: Todo | |
relations: | |
- name: tags | |
type: TodoTag | |
relation: many-to-many | |
- name: links | |
type: TodoLink |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func findLovers() { | |
stmt := ` | |
MATCH | |
(u1:User)-[:LOVES]->(u2:User)-[:LOVES]->(u1) | |
WHERE u1.name <= u2.name // <- THIS WAS MISSING | |
RETURN u1.name, u2.name | |
ORDER BY u1.name, u2.name | |
` | |
res := []struct { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"github.com/jmcvetta/neoism" | |
"github.com/verdverm/neo4j-tutorials/common/reset" | |
) | |
var ( | |
db *neoism.Database |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func sympathWalk(path string) { | |
// for now... (so i don't have to change everything below) | |
p := path | |
// is the directory / file a symlink? | |
f, err := os.Lstat(p) | |
if err == nil && f.Mode()&os.ModeSymlink == os.ModeSymlink { | |
realPath, err := filepath.EvalSymlinks(p) | |
if err != nil { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM google/golang:1.3 | |
RUN go get github.com/revel/cmd/revel | |
VOLUME ["/gopath/src"] | |
WORKDIR /gopath/src | |
CMD revel run github.com/revel/revel/samples/chat |