Skip to content

Instantly share code, notes, and snippets.

View jsloyer's full-sized avatar

Jeff Sloyer jsloyer

View GitHub Profile
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: clusteringresses.networking.internal.knative.dev
spec:
additionalPrinterColumns:
- JSONPath: .status.conditions[?(@.type=="Ready")].status
name: Ready
type: string
- JSONPath: .status.conditions[?(@.type=="Ready")].reason
#!/bin/bash
mkdir oidc-update
cd oidc-update
if [[ "$(hostname)" == "prod"* ]]; then
url=https://iam.ng.bluemix.net/kubernetes
else
url=https://iam.stage1.ng.bluemix.net/kubernetes
fi
apiVersion: v1
kind: Pod
metadata:
name: kube-addon-manager
namespace: kube-system
labels:
component: kube-addon-manager
spec:
hostNetwork: true
containers:
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
@jsloyer
jsloyer / client.py
Last active February 1, 2016 15:25
import RPi.GPIO as GPIO
import time
import os, json
import ibmiotf.application
import uuid
GPIO.setmode(GPIO.BCM)
GPIO.setup(18, GPIO.IN, pull_up_down=GPIO.PUD_UP)
GPIO.setup(17, GPIO.OUT)
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
GPIO.setup(18, GPIO.IN, pull_up_down=GPIO.PUD_UP)
GPIO.setup(17, GPIO.OUT)
GPIO.output(17, True)
app.use(cookieParser());
var sessionStore = memoryStore;
//in future PR switch to redis or cloudant as a session store
app.use(expressSession({ secret: process.env.SECRET || "blah",
store: sessionStore,
resave: false,
saveUninitialized: false
}));
<html>
<h1>
{{ .title }}
</h1>
</html>
func main() {
router := gin.Default()
router.LoadHTMLGlob("templates/*")
router.GET("/", func(c *gin.Context) {
c.HTML(http.StatusOK, "index.tmpl", gin.H{
"title": "Main website",
})
})
package main
import (
"github.com/gin-gonic/gin"
"net/http"
"os"
)