This file contains hidden or 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
class Bippy(override val toString: String) | |
trait A { implicit def lowPriority: Bippy = new Bippy("A") } | |
object B extends A { implicit def highPriority: Bippy = new Bippy("B") } | |
object C { implicit def highPriority: Bippy = new Bippy("C") } | |
object Test { | |
def main(args: Array[String]): Unit = { | |
import B._, C._ | |
println( implicitly[Bippy] ) // Prints: A |
This file contains hidden or 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) |
This file contains hidden or 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 | |
) |
This file contains hidden or 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" |
This file contains hidden or 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))) |
This file contains hidden or 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 |
This file contains hidden or 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 |
This file contains hidden or 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 |
This file contains hidden or 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 ", "})" | |
} |
This file contains hidden or 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 | |
# |
NewerOlder