Skip to content

Instantly share code, notes, and snippets.

Avatar

Vito Botta vitobotta

View GitHub Profile
View gist:b6bd3384b8788c270209076765170f85
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
View x.js
import { Controller } from "stimulus"
import ImageUpload from "../classes/image_upload"
export default class extends Controller {
static targets = [ "draftTextarea" ]
connect() {
console.log(12331)
// if (this.draftTextareaTarget.dataset.initialised != "true") {
this.initEditor()
@vitobotta
vitobotta / reflex.rb
Last active Apr 26, 2020
StimulusReflex working with route constraints
View reflex.rb
# frozen_string_literal: true
class StimulusReflex::Reflex
...
def request
@request ||= begin
uri = URI.parse(url)
path = ActionDispatch::Journey::Router::Utils.normalize_path(uri.path)
query_hash = Rack::Utils.parse_nested_query(uri.query)
@vitobotta
vitobotta / NginxIngress.ts
Last active Mar 25, 2020
Installing Nginx ingress controller with Pulumi
View NginxIngress.ts
import * as k8s from '@pulumi/kubernetes'
import * as pulumi from '@pulumi/pulumi'
import * as config from './config'
export interface NginxIngressArgs {
version?: pulumi.Input<string>,
namespace?: pulumi.Input<string>,
serviceType?: pulumi.Input<string>,
ingressClass?: pulumi.Input<string>,
@vitobotta
vitobotta / ZalandoPostgresCluster.ts
Last active Mar 27, 2020
Zalando Postgres Operator with Pulumi
View ZalandoPostgresCluster.ts
import * as k8s from '@pulumi/kubernetes'
import * as pulumi from '@pulumi/pulumi'
import { ZalandoPostgresOperator } from "./ZalandoPostgresOperator"
export interface ZalandoPostgresClusterArgs {
operator: pulumi.Input<ZalandoPostgresOperator>,
namespace: pulumi.Input<string>,
teamId: pulumi.Input<string>,
storageClass: pulumi.Input<string>,
storageSize: pulumi.Input<string>,
View gist:614c76f9f02d607e430264eea5c2c74b
import { Controller } from "stimulus"
import Tagify from '@yaireo/tagify'
import Rails from '@rails/ujs'
export default class extends Controller {
static targets = ["input"]
render() {
const tagify = new Tagify(this.inputTarget, {
whitelist: [],
View Dockerfile
######################
# Stage: Builder
FROM ruby:2.6.5-alpine as Builder
ARG FOLDERS_TO_REMOVE
ARG BUNDLE_WITHOUT
ARG RAILS_ENV
ENV BUNDLE_WITHOUT ${BUNDLE_WITHOUT}
ENV RAILS_ENV ${RAILS_ENV}
View gist:ebccf86eee3d12b9d922f4b0e0b1df12
panic: not a list, map, or tuple type
goroutine 648 [running]:
github.com/zclconf/go-cty/cty.Value.Index(0x2e93600, 0xc000c9a430, 0x26c29a0, 0xc0009a1a70, 0x2e93500, 0xc0001200d0, 0x261dd00, 0xc00088ddb0, 0x0, 0x18, ...)
/private/tmp/terraform-20191019-52821-1gyybtp/terraform-0.12.12/pkg/mod/github.com/zclconf/go-cty@v1.1.0/cty/value_ops.go:723 +0xb3e
github.com/hashicorp/terraform/lang.(*Scope).evalContext(0xc000b3cc80, 0xc0006c61a0, 0x2, 0x2, 0x2e75c40, 0xc0007a7640, 0x0, 0x0, 0x0, 0x100c588)
/private/tmp/terraform-20191019-52821-1gyybtp/terraform-0.12.12/src/github.com/hashicorp/terraform/lang/eval.go:247 +0xb41
github.com/hashicorp/terraform/lang.(*Scope).EvalContext(...)
/private/tmp/terraform-20191019-52821-1gyybtp/terraform-0.12.12/src/github.com/hashicorp/terraform/lang/eval.go:160
github.com/hashicorp/terraform/lang.(*Scope).EvalBlock(0xc000b3cc80, 0x2e91f00, 0xc0009a0180, 0x3dadbd0, 0x1, 0x1, 0x0, 0x0, 0x0, 0xc0007a7640, ...)
View gist:15bb7e1e0abe0a21a9abbe3f2e2c66f3
ssh_authorized_keys:
- github:vitobotta
hostname: master1
k3os:
dns_nameservers:
- 8.8.8.8
- 1.1.1.1
ntp_servers:
- 0.us.pool.ntp.org
- 1.us.pool.ntp.org
@vitobotta
vitobotta / openebs-label-volumes.sh
Created Jun 8, 2019
OpenEBS w/ Velero wrapper scripts
View openebs-label-volumes.sh
#!/usr/bin/env ruby
require 'json'
pvcs = JSON.parse(`kubectl get pvc --all-namespaces -o json`)["items"]
pvcs.each do |pvc|
namespace = pvc["metadata"]["namespace"]
pv = pvc["spec"]["volumeName"]
You can’t perform that action at this time.