View gist:0d6df08b163dc1f525145ea032c7faed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sum by (namespace) ( | |
kube_pod_status_phase{phase="Pending",namespace="<your_namespace>"} * on(pod) group_left | |
(time() - kube_pod_created{namespace="<your_namespace>"}) > 300 | |
) |
View mscala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# | |
# scala runner which can handle lots of variation automatically | |
# Paul Phillips <psp@brb.fyi> | |
set -euo pipefail | |
declare SCALA2_VERSION="2.13.10" | |
declare SCALA3_VERSION="3.2.0" | |
declare AMM_VERSION="2.5.5" |
View oddity.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WHITESPACE ODDITY | |
by Paul Phillips, in eternal admiration of David Bowie, RIP | |
Bound Ctrl to Major mode | |
Bound Ctrl to Major mode | |
Read inputrc and set extdebug on | |
Bound Ctrl to Major mode (Ten, Nine, Eight, Seven, Six) | |
Connecting readline, options on (Five, Four, Three) | |
Check the syntax, may terminfo be with you (Two, One, Exec) |
View integer-division.z3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(declare-fun a () Int) | |
(declare-fun b () Int) | |
(declare-fun c () Int) | |
;; (assert (= a (div -7 -3))) | |
;; (assert (= b (div 7 -3))) | |
;; (assert (= c (div -7 3))) | |
;; (assert (= a (mod -7 -3))) | |
;; (assert (= b (mod 7 -3))) | |
;; (assert (= c (mod -7 3))) |
View The Signs of Soundness
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Hello scala, my old friend | |
I've come to take you home again | |
Because a feature slowly creeping | |
left me plagued with doubts and weeping | |
and the version that was tagged in the repo | |
just has to go | |
it lacks the signs of soundness | |
On sleepless nights I hacked alone | |
applying ant and other tools of stone |
View .gitignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
*.history | |
*[-_]history | |
.CFUserTextEncoding | |
.DS_Store | |
.dropbox* | |
.eclipse | |
.localized | |
.lockfile | |
.viminfo |
View coronasuggestions.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a levels | |
advice | |
advice uk | |
africa | |
airborne | |
alabama | |
alaska | |
america | |
and asthma | |
and children |
View ummutable.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import scala.collection.mutable.ListBuffer | |
class Ummutable[T] private (buf: ListBuffer[T]) { | |
def this(xs: T*) = this(ListBuffer() ++= xs) | |
def append(ys: T*): this.type = { buf ++= ys ; this } | |
val xs: List[T] = buf.toIterable match { case xs: List[T] => xs } | |
override def toString = s"Ummutable(xs = ${xs mkString ", "})" | |
} |
View sbt-new
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# | |
# Intercepting the output of 'sbt new' directly fails | |
# because it asks interactive questions so we can't process | |
# line by line. An apparent OSX-specific bug in egrep | |
# fails on lookbehind clauses so we use ag. Capturing | |
# the interactive output with script succeeds, but script | |
# uses \r\n to terminate lines so we can't match the | |
# filename with '.*' or we get | |
# |
View gsdv.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# | |
# Use google's date range and "verbatim" simultaneously | |
# Paul Phillips <psp@brb.fyi> | |
# | |
NAME="$(basename "$0")" | |
read -r -d '' USAGE << EOM | |
usage: $NAME [-s days] [-e days] [search terms] |
NewerOlder