Skip to content

Instantly share code, notes, and snippets.

View myrkvi's full-sized avatar

Vegard Berg myrkvi

View GitHub Profile
@Dinnerbone
Dinnerbone / gist:3736487
Created September 17, 2012 09:49
New Minecraft target selector syntax!

Syntax

All target selectors start with @. The following character is the selector type. For example, @p means 'closest player'.

Target selectors may have additional, optional arguments. You can specify these in [ ], using the syntax a=0. For example, @p[a=0,b=5,c=-500].

There is a special short syntax for just specifying x, y, z and r arguments; simply list their values separated by a comma, without x=. For example: @p[100,64,-100,5] for 5 range, x=100, y=64 and z=-100. Each of these are optional and skippable by leaving them empty. For example, to just specify y coordinate: @p[,64].

Global Arguments:

  • x - X coordinate for search center. Default is senders coordinate, or 0.
  • y - Y coordinate for search center. Default is senders coordinate, or 0.
@donatj
donatj / http.go
Last active September 12, 2018 19:34
Golang Basic Auth
package utils
import (
"net/http"
)
func BasicAuth(handler http.Handler, username, password string) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
if u, p, ok := r.BasicAuth(); !ok || !(u == username && p == password) {
w.Header().Set("WWW-Authenticate", "Basic realm=\"ZorkIrc\"")