Skip to content

Instantly share code, notes, and snippets.

View a_test.go
package ginkgo_test_test
import (
"fmt"
"math/rand"
"time"
. "github.com/onsi/ginkgo"
)
View gist:f4b40b008801de09e8ff58b27cb27559
Verifying my Blockstack ID is secured with the address 1nuD8osXNvQVLVBSvBmx4aQBx6QaLhg5q https://explorer.blockstack.org/address/1nuD8osXNvQVLVBSvBmx4aQBx6QaLhg5q
@jimmidyson
jimmidyson / oc.plugin.zsh
Last active Oct 14, 2016
OpenShift ZSH Plugins
View oc.plugin.zsh
# Autocompletion for oc, the command line interface for OpenShift
#
# Author: https://github.com/jimmidyson
if [ $commands[oc] ]; then
source <(oc completion zsh)
fi
@jimmidyson
jimmidyson / prometheus.yml
Last active Feb 28, 2016
Prometheus Kubernetes manifest
View prometheus.yml
apiVersion: v1
kind: Pod
metadata:
name: prometheus
spec:
containers:
- env:
- name: KUBERNETES_NAMESPACE
valueFrom:
fieldRef:
View gist:5f6100c4f46845d972e5
### Keybase proof
I hereby claim:
* I am jimmidyson on github.
* I am jimmidyson (https://keybase.io/jimmidyson) on keybase.
* I have a public key whose fingerprint is 5B55 57A0 9422 9FB7 ED62 4B8C 8F47 C801 8D2A D863
To claim this, I am signing this object:
View recreate_openshift_cert.sh
oadm ca create-server-cert \
--cert=openshift.local.config/master/master.server.crt \
--key=openshift.local.config/master/master.server.key \
--hostnames=[ANY_OTHER_HOSTNAMES_HERE,]kubernetes.default.svc,kubernetes.default.svc.cluster.local,localhost,openshift.default.svc.cluster.local,127.0.0.1
View benchmark.txt
# go test -bench=. -benchmem -benchtime=30s
testing: warning: no tests to run
PASS
BenchmarkSetNs 100000 464509 ns/op 14876 B/op 163 allocs/op
BenchmarkSysFs 100000 459523 ns/op 14735 B/op 157 allocs/op
ok github.com/jimmidyson/benchmark-setns 122.377s
View 4-fabric8-plugin.xml
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>fabric8-maven-plugin</artifactId>
<version>2.2.4</version>
<executions>
<execution>
<id>json</id>
<phase>generate-resources</phase>
<goals>
<goal>json</goal>
View 3-docker-plugin.xml
<plugin>
<groupId>org.jolokia</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>0.12.0</version>
<configuration>
<images>
<image>
<name>${docker.image}</name>
<build>
<from>fabric8/java</from>
View 2-camel-route.java
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.cdi.ContextName;
@ContextName("myCdiRestCamelContext")
public class MyRoutes extends RouteBuilder {
@Override
public void configure() throws Exception {
restConfiguration().component("netty4-http").host("0.0.0.0").port(8080);