Skip to content

Instantly share code, notes, and snippets.

Hypertext Brad Protocol -- HBP/1.1
Status of this Memo
This document specifies an Internet standards track protocol for the
Brad, and requests discussion and suggestions for
improvements. Please refer to the current edition of the "Internet
Official Brad Standards" (BSTD 1) for the standardization state
and status of this protocol. Distribution of this memo is unlimited.
FROM scratch
COPY demo /
CMD ["/demo"]
{
"rewrites": [
{"source": "/", "destination": "/api/index"},
{"source": "/:splat*", "destination": "/api"}
]
}
package resume_test
import (
"context"
"log"
)
func ExampleBackup() {
backup := func(ctx context.Context, object string) error {
job, err := resume.Call(ctx, "start", backupStart, object)
# github.com/golangci/golangci-lint/pkg/golinters
../../pkg/mod/github.com/golangci/golangci-lint@v1.27.0/pkg/golinters/gomodguard.go:47:36: unknown field 'k' in struct literal of type gomodguard.BlockedModule
../../pkg/mod/github.com/golangci/golangci-lint@v1.27.0/pkg/golinters/gomodguard.go:51:43: cannot use m (type gomodguard.BlockedModule) as type map[string]gomodguard.BlockedModule in append
#!/usr/bin/env roundup
describe "redis-cli(1)"
# Start the redis server on port 9999
port=9999
printf "PORT $port\n" | ./redis-server - &
redis_pid=$!
# Give redis time to start listening
package question
func whatsTheEquivalentOfThisWithHandleCheckQuestionMark(w io.Writer) (rN int, err error) {
w = LimitedWriter{w, 23}
n, err := io.WriteString(w, "some data 1") // 11 bytes written
rN += n
if err != nil {
return err
}
@bmizerany
bmizerany / myapp.rb
Created July 25, 2008 23:28 — forked from pedro/rackup.ru
Running Sinatra in a rackup file
require "rubygems"
require "sinatra"
get '/' do
'hi'
end
<script>
function ready() {
function benchmark(n, f) {
var sum = 0.0;
var total = n;
while (n--) {
var u = 'https://google.com?q=1' + Math.random().toString(36).substring(7);
var s = performance.now();
f(u);
var e = performance.now();
<script>
var i = 100000
var r = []
var a = document.createElement('a')
while (i--) {
var s = performance.now()
a.href = 'https://www.google.com?q=asdf'
var h = a.hostname
var e = performance.now()
r.unshift(e - s)