Skip to content

Instantly share code, notes, and snippets.

TJ Holowaychuk tj

Block or report user

Report or block tj

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View asya
...e$e.$...e$ ...e$e.$...e
!$6lkasd!$6lkasd!$6l !$6lkasd!$6lkasd!
;,a1wert;,a1wert;,a1wert ;,a1wert;,a1wert;,a1we
.asxzcvb.asxzcvb.asxzcvb.as .asxzcvb.asxzcvb.asxzcvb.
1qaswedfqas1wedfqas1wedfqas1wedfqas1wedfqas1edfqas1ewdfqa
:lkjhgfdlkj:hgfdlkj:hgfdlkj:hgfdlkj:hgfdlkj:gfdhlkj:gfdhlk
3edcvfr4edc3vfr4edc3vfr4edc3vfr4edc3vfr4edc3fr4vedc3fr4ved
1234ewqa2341ewqa2341ewqa2341ewqa2341ewqa2341wqa2341weqa234
o[piuytr[piouytr[piouytr[piouytr[piouytr[pioytru[pioytru[p
z/xcvbnm/xczvbnm/xczvbnm/xczvbnm/xczvbnm/xczbnmv/xczbnmv/x
View in.go
package main
func main() {
log := NewLogger()
log.Info("Foo")
log.Info("Bar")
log.Error("Boom")
}
func NewLogger() Logger {
@tj
tj / snippets.coffee
Last active Sep 1, 2018
Atom snippets for Go
View snippets.coffee
'.source.go':
'Options':
'prefix': 'options'
'body': '''
// Option function.
type Option func(*$1)
// New with the given options.
func New(options ...Option) *$1 {
View output
#!/bin/sh
eval `go build -work -a 2>&1` && find $WORK -type f -name "*.a" | xargs -I{} du -hxs "{}" | gsort -rh | sed -e s:${WORK}/::g
View index.md

Setup

Static files and 404 pages.

{{ mkdir "build" }}
{{ copy "static/*" "build" }}
{{ render "404" | write "build/404.html" }}
View input.go
// grab time spent
sum := Agg("duration_sum", Sum("duration"))
// grab time spent per label
labels := Agg("labels",
Terms("issue.labels.keyword", 100),
Aggs(sum))
// grab time spent per day, and per label
View preact.go
// Package preact provides bindings to the preact library.
package preact
import "github.com/gopherjs/gopherjs/js"
var preact = js.Global.Get("preact")
// Attrs of an element.
type Attrs map[string]interface{}
View status.html
{{ define "content" }}
{{ partial "back" (dict "url" "//apex.sh") }}
<section class="Content full center">
<div class="Container small">
<div class="Title center margin">
<span class="text">Status</span>
<span class="subtext">Apex service status.</span>
</div>
View images.css
.Images.three {
--size: 450px;
--size-ratio: .75;
--size-small: calc(var(--size) * var(--size-ratio));
--inset: 150px;
--bottom: 25px;
display: flex;
justify-content: center;
align-items: flex-end;
}
You can’t perform that action at this time.