Skip to content

Instantly share code, notes, and snippets.

@DaniJG
DaniJG / .github_actions_databricks-cli-install_action.yaml
Last active December 11, 2023 21:04
Github actions for databricks
name: 'databricks-cli-install'
description: 'Install latest version of the databricks CLI'
runs:
using: "composite"
steps:
# this is the new CLI, distributed as a standalone executable that doesnt need Python: https://docs.databricks.com/dev-tools/cli/databricks-cli.html
- shell: bash
run: |
curl -fsSL https://raw.githubusercontent.com/databricks/setup-cli/main/install.sh | sh
@DaniJG
DaniJG / rancher-clean-apprevisions.sh
Created August 19, 2021 12:20
Script that can be used to remove outdated apprevisions
#! /bin/bash
# The scripts needs to run agains the Kubernetes cluster where rancher is installed, make sure to setup your context/credentials for kubectl
# If you run it with no arguments, it will ask you to confirm before looking at each cluster, and before removing app revisions in a given rancher project
# Alternatively run with "--force-yes" and will clean without asking
set -eu
# process arguments. See https://stackoverflow.com/a/24597113/1836935
forceYes=false
@DaniJG
DaniJG / nginx-controller-dashboards.md
Last active April 11, 2022 14:14
Grafana dashboard for the kubernetes NGINX controller

NGINX-controller grafana dashboards

Adapted from the official dashboard located in the official nginx-controller repo: https://github.com/kubernetes/ingress-nginx/tree/master/deploy/grafana/dashboards.

Haven't dig up why yet, but in my setup with Grafana 6.3.6 (where at least for the performance dashboard 6.6.0 is recommended) and the nginx-controller 0.25.1, the range vector selectors in time series of [1m] and [2m] where causing no data being returned.

I also missed being able to see the data per host (as in the host name declared by each Ingress) or the namespace that defined the Ingress. So I added new parameters and filters for these.

@DaniJG
DaniJG / global-events.js
Created February 22, 2019 22:21
Vue global events made easy with this mixin
import { mapKeys, mapValues, kebabCase, bind, forIn } from 'lodash';
// Allows components to trigger global events using the global vue instance
// by adding a new method this.globalEmit(...), which is equivalent to this.$root.$emit(...)
// To facilitate listening to these events, allows components to declare a new events object as part of its options
// Given an component like:
// computed: { ... }
// events: {
// onScrollToView(payload){
// // do something with payload
@DaniJG
DaniJG / server.js
Created November 25, 2016 17:44
Node render html as pdf
'use strict';
var express = require('express');
var phantom = require('phantom-render-stream');
var readable = require('stream').Readable
var app = express();
var router = express.Router();
//For full list of options, see: https://www.npmjs.com/package/phantom-render-stream
@DaniJG
DaniJG / FetchController.cs
Created November 21, 2016 17:11
ASP.Net Core 1.1 test setting cookie in controller action
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace TestApplication.Controllers
{
[Route("api/[controller]")]
public class FetchController : Controller