Skip to content

Instantly share code, notes, and snippets.

Kubernetes the Exoscale way

Prerequisites

  • exo CLI
  • cs
  • jq

Creating the infrastructure

Private network

@mping
mping / columns.md
Last active February 14, 2020 10:54
Markdown columns side by side

Document Title

The usual Markdown Cheatsheet does not cover some of the more advanced Markdown tricks, but here is one. You can include verbatim HTML in your Markdown document. This is particularly useful for tables. Check this out:

Version 1Version 2
@mping
mping / test.js
Last active May 13, 2019 21:25
geojson > svg through d3
const json = {
"routes": [{
"legs": [{
"summary": "Avenida Infante Dom Henrique, Autoestrada do Norte",
"weight": 11481.1,
"duration": 10976.2,
"steps": [{
"intersections": [{
"out": 0,
"entry": [true],
@mping
mping / capslock_ijkl_fn.json
Last active January 18, 2019 13:27
karabiner://karabiner/assets/complex_modifications/import?url=file:/Users/mping/Devel/workspace/capslock_ijkl_fn.json
{
"title": "Caps Lock (Fn) + IJKL",
"rules": [
{ "description": "Caps Lock to fn",
"manipulators": [{"type": "basic", "from": {"key_code": "caps_lock", "modifiers": {"optional": ["any"]}}, "to": [{"key_code": "fn"}]}] },
{ "description": "Fn + I/J/K/L to Arrow Keys",
"manipulators": [{"type": "basic", "from": {"key_code": "i", "modifiers": {"mandatory": ["fn"], "optional": ["any"]}}, "to": [{"key_code": "up_arrow"}] },
{"type": "basic", "from": {"key_code": "j", "modifiers": {"mandatory": ["fn"], "optional": ["any"]}}, "to": [{"key_code": "left_arrow"}]},
{"type": "basic", "from": {"key_code": "k", "modifiers": {"mandatory": ["fn"], "optional": ["any"]}}, "to": [{"key_code": "down_arrow"}]},
{"type": "basic", "from": {"key_code": "l", "modifiers": {"mandatory": ["fn"], "optional": ["any"]}}, "to": [{"key_code": "right_arrow"}]}] },
@mping
mping / partition-while.clj
Created December 10, 2018 13:43
partition-while
(defn partition-while
"Given a coll, partition the coll whenever `(f a b)` returns `false`.
Example: `(partition-when #(<= 0 (Math/abs (- %1 %2)) 1) [1 2 3 5 6 8 10 10])
returns `[[1 2 3] [5 6] [8] [10 10]]`
"
([f coll] (partition-while f coll [] []))
([f [_ & t :as c] result intermediate]
(let [[a b & _] c]
(cond
(nil? a) result
@mping
mping / CljKeyStore.clj
Created December 3, 2018 21:13
Kafka props in clojure
(ns com.heroku.sdk.CljKeyStore
"Dynamically generated class to allow creating custom key stores by directly passing the certs and keys
instead of relying on env vars"
(:gen-class
:name com.heroku.sdk.CljKeyStore
:extends com.heroku.sdk.EnvKeyStore
:methods [#^{:static true} [fromTrustWithRandomPassword [String] com.heroku.sdk.EnvKeyStore]
#^{:static true} [fromKeyAndCertWithRandomPassword [String String] com.heroku.sdk.EnvKeyStore]]
:constructors {[String String] [String String],
[String String String] [String String String]}))
@mping
mping / 00_notes.md
Created September 22, 2018 18:34 — forked from Deraen/00_notes.md
Compojure-api and Buddy
  • (:identity req) is auth backend independent way to access user data
  • login and logout implementation depends on auth backend
  • :current-user doesn't imply that authentication is required, route should also have :auth-rules if authentication is required
@mping
mping / commit.md
Last active June 9, 2018 11:47 — forked from abravalheri/commit.md
RFC: Git Commit Message Guidelines

Commit Message Guidelines

Goals

  • allow generating CHANGELOG.md by script
  • allow ignoring commits by git bisect (not important commits like formatting)
  • provide better information when browsing the history

Proposal

@mping
mping / profiles.clj
Last active April 19, 2018 08:06
~/.lein/profiles.clj
{:user {:plugins [[cider/cider-nrepl "0.16.0"]
[lein-midje "3.1.3"]
[lein-cloverage "1.0.9"]
[com.jakemccrary/lein-test-refresh "0.21.1"]
[lein-ancient "0.5.5"]
[jonase/eastwood "0.2.5"]
[lein-kibit "0.0.8"]
[lein-pprint "1.1.2"]]}}