Skip to content

Instantly share code, notes, and snippets.

View wwitzel3's full-sized avatar

Wayne Witzel III wwitzel3

View GitHub Profile
// WARNING: This function is called every time the Octant worker loop runs (so every 1-sec)
// You will want/need to implement your own PF manager that you setup in main()
// You will also want to implement your own throttled worker loop to update the data from the remote service.
func handlePrint(request *service.PrintRequest) (plugin.PrintResponse, error) {
if request.Object == nil {
return plugin.PrintResponse{}, errors.Errorf("object is nil")
}
client := request.DashboardClient
diff --git a/internal/api/terminal_manager.go b/internal/api/terminal_manager.go
index 0799e02..4f0d196 100644
--- a/internal/api/terminal_manager.go
+++ b/internal/api/terminal_manager.go
@@ -9,11 +9,12 @@ import (
"context"
"fmt"
"sync"
+ "time"
@wwitzel3
wwitzel3 / build.go
Created November 6, 2019 19:05
Use Go for build script instead of Makefile (platform agnostic)
/*
Copyright (c) 2019 the Octant contributors. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
// go run build.go build
// go run build.go go-install
package main
diff --git a/web/web.go b/web/web.go
index 2819367b..0998d7fc 100644
--- a/web/web.go
+++ b/web/web.go
@@ -1,9 +1,10 @@
package web
import (
+ "mime"
"net/http"
package main
import (
"net"
)
func main() {
ln, err := net.Listen("tcp", "127.0.0.1:7777")
if err != nil {
panic(err)
package main
import (
"fmt"
// "reflect"
"github.com/google/go-cmp/cmp"
)
type Foo struct {
A *int
@wwitzel3
wwitzel3 / kube-registry.yaml
Created July 13, 2018 20:59 — forked from coco98/kube-registry.yaml
Docker registry on minikube
apiVersion: v1
kind: ReplicationController
metadata:
name: kube-registry-v0
namespace: kube-system
labels:
k8s-app: kube-registry
version: v0
spec:
replicas: 1
@wwitzel3
wwitzel3 / postgres_array.go
Created June 29, 2018 00:11 — forked from adharris/postgres_array.go
PostgreSQL demo of Array types using Golang
package main
import (
"database/sql"
"errors"
"fmt"
_ "github.com/bmizerany/pq"
"os"
"regexp"
"strings"
@wwitzel3
wwitzel3 / awx_win10_docker.md
Created February 20, 2018 02:45
awx dev on Windows using WSL and Docker for Windows
  • Install WSL / Ubuntu
  • Install Docker for Windows
  • Allow non-TLS
  • Configure docker client
import shutil
BASE='/ufrc/camctrp/working/gullettj'
PART1 = open('/ufrc/camctrp/working/gullettj/nepal/nepal_tracula_list.txt', 'r').readlines()
PART2 = open('/ufrc/camctrp/working/gullettj/nepal/nepal_dwi_list.txt', 'r').readlines()
MOVES = [
['{base}/nepal/{part1}/dwi/{part2}_dwi_merged.nii.gz', '{base}/nepal/{part1}/dwi/{part1}_ses-01_bvec_merged'],
['{base}/nepal/{part1}/dwi/{part2}_bvec_merged', '{base}/nepal/{part1}/dwi/{part1}_ses-01_bvec_merged'],