Skip to content

Instantly share code, notes, and snippets.

apiVersion: v1
data:
# Docker for Mac uses vpnkit to handle LoadBalancer ingresses, but it doesn't show an external IP, so the default
# ArgoCD health check for the ingress service doesn't show as Healthy. This custom health check fixes that issue.
resource.customizations: |
extensions/Service:
health.lua: |
hs = {}
hs.status = "Progressing"
if obj.status ~= nil then
@deinspanjer
deinspanjer / testdash.go
Created March 13, 2018 17:13
A toy termui example to get the basic structure down
package main
import (
ui "github.com/gizak/termui" // use ui as an alias
"strconv"
"fmt"
"math/rand"
"container/ring"
)
@deinspanjer
deinspanjer / Handle the data changed event.yaml
Created January 30, 2018 13:12
This snippet shows how to register a handler for the data-changed event. - Shared with Script Lab
name: Handle the data changed event
description: This snippet shows how to register a handler for the data-changed event.
author: deinspanjer
host: EXCEL
api_set: {}
script:
content: |
$("#setup").click(() => tryCatch(setup));
$("#register-data-changed-handler").click(() => tryCatch(registerDataChangedHandler));
@deinspanjer
deinspanjer / Create a table.yaml
Created January 28, 2018 17:22
Creates a table with four columns and seven rows. - Shared with Script Lab
name: Create a table
description: Creates a table with four columns and seven rows.
author: deinspanjer
host: EXCEL
api_set: {}
script:
content: |
$("#create-table").click(createTable);
$("#delete-rows").click(deleteRows);
@deinspanjer
deinspanjer / find_cheap_spot_prices.sh
Created January 4, 2018 17:57 — forked from pahud/check_spot_price_now.md
check current spot price with aws-cli
aws ec2 describe-spot-price-history --instance-types $(aws ec2 describe-spot-price-history help | sed -En '/Where valid values are:/,/^$/s/^ +([^.]+[.])/\1/p') --start-time=$(echo "$(date +%s) - (4 * 7 * 24 * 60 * 60)" | bc) --product-descriptions="Linux/UNIX (Amazon VPC)" --query 'SpotPriceHistory[*].{ts:Timestamp, az:AvailabilityZone, price:SpotPrice, it:InstanceType}' --filters Name=spot-price,Values="0.0*" > /tmp/ec2-spot-prices.txt
/*
* Available context bindings:
* COLUMNS List<DataColumn>
* ROWS Iterable<DataRow>
* OUT { append() }
* FORMATTER { format(row, col); formatValue(Object, col) }
* TRANSPOSED Boolean
* plus ALL_COLUMNS, TABLE, DIALECT
*
* where:
package com.example;
import com.example.config.DemoConfig;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
package main_test
/*
To test:
* `go get github.com/docker/docker`
* `go get github.com/smartystreets/goconvey/convey`
* Edit the constants
@deinspanjer
deinspanjer / test_a_sayer.go
Created November 9, 2016 16:25 — forked from anonymous/test_a_sayer.go
Example of cross-package interfaces in golang
package a
import "fmt"
type Sayer interface {
Say() string
}
type Formal struct{}
<?xml version="1.0" ?>
<template encoding-version="1.0">
<description>A simple GenerateFlowFile -&gt; PublishKafka_0_10 works fine, but this doesn't.
I really thought I had figured out that the problem was just trying to store the Avro records so I put in the conversion to JSON, but it is still failing. The error message is:
2016-10-29 23:52:49,629 WARN [Timer-Driven Process Thread-1] o.a.n.p.kafka.pubsub.PublishKafka_0_10 PublishKafka_0_10[id=12b0a84d-0158-1000-ce29-967712bf5ab6] Timed out while waiting for acks from Kafka</description>
<groupId>12988df2-0158-1000-88e0-450d4f9737a0</groupId>
<name>ProblemWithPublishKafka10</name>
<snippet>