This file contains hidden or 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 ( | |
"context" | |
"flag" | |
"fmt" | |
"log" | |
"net/http" | |
"sort" | |
"strings" |
This file contains hidden or 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 ctrlutil | |
import ( | |
"context" | |
"k8s.io/apimachinery/pkg/api/meta" | |
"k8s.io/apimachinery/pkg/runtime" | |
"k8s.io/apimachinery/pkg/runtime/schema" | |
"sigs.k8s.io/controller-runtime/pkg/client" | |
) |
This file contains hidden or 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 ( | |
"context" | |
"encoding/json" | |
"errors" | |
"fmt" | |
"log" | |
"sync" |
This file contains hidden or 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" | |
// [[1, 2, 7], [3, 6, 7]] | |
// given a src and dest stop, what is the minimum number of hops? | |
// src: 2 dst:3 | |
// r0 8->3 | |
// r1 7->8 | |
// r2 1->2->7 |
This file contains hidden or 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 ( | |
"context" | |
"fmt" | |
"net/http" | |
"google.golang.org/api/option" | |
"google.golang.org/api/run/v1" | |
_ "k8s.io/client-go/plugin/pkg/client/auth" |
This file contains hidden or 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 ( | |
"context" | |
"crypto/x509" | |
"encoding/base64" | |
"fmt" | |
"net/http" | |
"golang.org/x/oauth2" |
This file contains hidden or 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 ( | |
"context" | |
"log" | |
"net/http" | |
"golang.org/x/oauth2" | |
"golang.org/x/oauth2/google" | |
"google.golang.org/api/option" |
This file contains hidden or 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
#!/bin/bash | |
set -euo pipefail | |
files=$( grep -hRE '\.(tar\.gz|zip)' plugins/* | \ | |
sed -E 's/^\s+(-\ )?uri:\s//g' | \ | |
sed -E 's/"//g' | \ | |
sort | \ | |
uniq ) | |
for f in $files; do |
This file contains hidden or 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
# prepend --- to every doc | |
sed -i '1i---' *.md | |
# append --- to first empty line (\n\n) | |
# (use GNU sed) | |
sed -i '0,/^$/s//---\n/' *.md |
This file contains hidden or 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 handler (directory named 'api/') is recognized | |
// by ZEIT Now v2 Lambda platform. | |
package handler | |
import ( | |
"net/http" | |
) | |
func init() { log.SetFlags(log.Lmicroseconds) } |
NewerOlder