Skip to content

Instantly share code, notes, and snippets.

View jpaulorio's full-sized avatar

João Paulo Leonidas Fernandes Dias da Silva jpaulorio

  • ThoughtWorks
  • Mason - OH - USA
  • 22:27 (UTC -04:00)
View GitHub Profile
@jpaulorio
jpaulorio / port-forward.sh
Created August 22, 2023 03:43
Utility shell script to easily forward a local port to a pod's port running in a K8s cluster
#!/bin/bash
namespace=$1
localPort=$2
appName=$3
errored=false
if [ -z "$namespace" ]; then
echo $'\nK8s namespace not informed!'
echo $'\nHere\'s a list of namespaces for the current K8s context:\n\n'
### Keybase proof
I hereby claim:
* I am jpaulorio on github.
* I am jpaulorio (https://keybase.io/jpaulorio) on keybase.
* I have a public key ASDBa17_wqDZloPgR9Dr7MIA17NX6SmgKrFfXsTgJieXPQo
To claim this, I am signing this object:
(defn split-tree-input
([values]
(when (seq values)
[(cons (first values) (split-tree-input values 1 1))
(cons (first values) (split-tree-input values 1 2))]))
([values level skip]
(when (seq values)
(concat (take level (drop skip values))
(split-tree-input (drop level values) (* 2 level) (* 2 skip))))))

Keybase proof

I hereby claim:

  • I am jpaulorio on github.
  • I am jpaulorio (https://keybase.io/jpaulorio) on keybase.
  • I have a public key whose fingerprint is 41BE BF11 9382 1EEC 189A E0B7 4A34 C3B5 18B3 6018

To claim this, I am signing this object:

@jpaulorio
jpaulorio / infix-arithmetic.clj
Last active August 21, 2016 16:04
Two functions and a macro that implement infix notation arithmetic for simple arithmetic operations (+ - * /)
;two functions that implement infix notation arithmetic for simple arithmetic operations (+ - * /)
;my-infix-eval will reduce the given infix expression evaluating the highest precedence operation one at a time
;(my-infix-eval "(1 + 3 * 4 - 3 / 4)")
;=> 49/4
;my-infix will translate de given infix expression into clojure polish notation
;(my-infix "(1 + 3 * 4 - 3 / 4)")
;=> (- (+ 1 (* 3 4)) (/ 3 4))