Skip to content

Instantly share code, notes, and snippets.

View dblooman's full-sized avatar

David Blooman dblooman

View GitHub Profile
err = drain.Drain(clientset, []*corev1.Node{node}, &drain.DrainOptions{
IgnoreDaemonsets: true,
DeleteLocalData: true,
GracePeriodSeconds: -1,
Force: true,
Logger: ilog.New(),
// Timeout of 0 means infinite. The draining is pretty quick, so I expect it to complete within
// the execution duration of the lambda.
Timeout: 0,
})
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: foo-bar
spec:
rules:
- host: foo.bar
- http:
paths:
- path: /
{
"AWSTemplateFormatVersion": "2010-09-09",
"Parameters": {
"CPUAlarmHighEvalPeriods": {
"Type": "String",
"Default": "1"
},
"CPUAlarmHighThreshold": {
"Type": "String",
"Default": "80"
exports.config = {
//
// ==================
// Specify Test Files
// ==================
// Define which test specs should run. The pattern is relative to the directory
// from which `wdio` was called. Notice that, if you are calling `wdio` from an
// NPM script (see https://docs.npmjs.com/cli/run-script) then the current working
// directory is where your package.json resides, so `wdio` will be called from there.
require 'json'
response = `aws ec2 describe-volumes --region eu-west-1`
json = JSON.parse response
json["Volumes"].each do |vol|
if vol["State"] == "available"
`aws ec2 delete-volume --volume-id #{vol["VolumeId"]} --region eu-west-1`
@dblooman
dblooman / kata.rb
Last active February 16, 2016 15:18
def class_name(names)
names.tr!("_", " ")
items = names.split("/")
items.map { |i| i.split.map(&:capitalize).join("") }.join("::")
end
puts class_name "upload/creator_details"
# -> Upload::CreatorDetails
puts class_name "upload/base"
@dblooman
dblooman / wide.json
Last active November 24, 2015 13:07
{
"head": [
"<link rel=\"stylesheet\" media=\"(min-width: 1008px)\" href=\"//news.test.files.bbci.co.uk/tools/mozart/wide.css\">"
],
"bodyInline": "<div class=\"navigation navigation--wide\">\n <ul class=\"navigation-wide-list\" role=\"navigation\" aria-label=\"News\" data-panel-id=\"js-navigation-panel-primary\">\n <li class=\"selected\">\n <a\n href=\"/news\"\n \n class=\"navigation-wide-list__link \"\n >\n <span>Home</span>\n </a>\n <span class=\"off-screen\">selected</span>\n </li>\n <li >\n <a\n href=\"/news/uk\"\n data-panel-id=\"js-navigation-panel-UK\"\n class=\"navigation-wide-list__link \"\n >\n <span>UK</span>\n </a>\n \n </li>\n <li >\n
.off-screen{position:absolute !important;clip:rect(1px 1px 1px 1px);clip:rect(1px, 1px, 1px, 1px);padding:0 !important;border:0 !important;height:1px !important;width:1px !important;overflow:hidden}.feature-phone-off-block{display:block}.display-feature-phone-only{display:none}.tabs ul{padding:0 8px 0 4px}.tabs a{font-size:16px;font-size: 1rem;line-height:1.25;letter-spacing:0;font-weight:700;padding-top:1px;padding-top: 0.0625rem;padding-bottom:3px;padding-bottom: 0.1875rem;padding:8px 16px 4px}.tabs a:hover,.tabs a:focus{color:#1167a8}.tabs li.open a{background:#fff;color:#222;padding:6px 16px;top:0}.tabs li.open a:hover,.tabs li.open a:focus{color:#1167a8}#index-tabs{margin-left:auto;margin-right:auto;width:992px;display:block}.panels .panel{position:absolute;top:0;left:-5000%;width:100%}.panels .panel.open{display:block;left:0;position:relative}.index-panel.closed{display:none;visibility:hidden}.navigation-wide-list{height:35px}.navigation--wide .navigation-wide-list li:first-child .navigation-wide-list__
{
"head": [
"<style>body { font-family: \"Helvetica\", \"Arial\", sans-serif; margin: 0; } #header { background-color: #bb1919; color: white; font-size: 48px; padding: 10px 0; font-family: \"Gill Sans\"; text-align: center; }</style>"
],
"bodyInline": [],
"bodyLast": []
}
{
"head": [
"<script src=\"https://cdnjs.cloudflare.com/ajax/libs/require.js/2.1.20/require.min.js\"></script>"
],
"bodyInline":
"",
"bodyLast": [
""
]