Skip to content

Instantly share code, notes, and snippets.

View thewraven's full-sized avatar

Juan Carlos García Martínez thewraven

View GitHub Profile
package agent
import (
"moon"
"net/http"
"github.com/gin-gonic/gin"
)
type Worker struct {
@thewraven
thewraven / battery.go
Created February 20, 2017 18:52
Linux battery status - useful for zsh customization
package main
import (
"fmt"
"math"
"os/exec"
"strconv"
"strings"
)
@thewraven
thewraven / nested_filter.go
Created February 3, 2017 14:59
Example of a filter using a function to access nested fields
package main
import (
"fmt"
r "gopkg.in/dancannon/gorethink.v3"
)
type User struct {
ID string `json:"id,omitempty"`
@thewraven
thewraven / nestedArray.go
Last active July 18, 2018 14:07
Updating a nested field into an array using r.Branch
package main
import (
"fmt"
r "gopkg.in/dancannon/gorethink.v3"
)
type Commentary struct {
From string `gorethink:"from"`