Skip to content

Instantly share code, notes, and snippets.

View kevinkyyro's full-sized avatar

Kevin Kyyro kevinkyyro

View GitHub Profile
@kevinkyyro
kevinkyyro / comments.md
Last active August 18, 2023 00:56
Useful JQ programs

I use split-newlines-and-parse-stringified-json.jq to make json, usually from logs, more readable:

It recursively:

  • splits strings containing newlines into arrays
  • expands escaped tabs into spaces
  • expands stringified json
$ echo '{
 "foo": 42,
@kevinkyyro
kevinkyyro / keybase.md
Created February 23, 2018 19:19
keybase.md

Keybase proof

I hereby claim:

  • I am kevinkyyro on github.
  • I am kevinkyyro (https://keybase.io/kevinkyyro) on keybase.
  • I have a public key ASBAAx4oNwNHywAC6PXU1Qj5skjcTDoKjQgxqxTzzrc-Hgo

To claim this, I am signing this object:

@kevinkyyro
kevinkyyro / Presentation.sc
Created October 12, 2016 18:04
A code-based presentation of "Don't Fear the Implicits" by Daniel Westheide
// https://speakerdeck.com/dwestheide/dont-fear-the-implicits-everything-you-need-to-know-about-typeclasses
object `Preview: implicits can be used for...` {
trait Dependencies[T] {
import scala.concurrent.{ExecutionContext, Future}
def map[S](f: T => S)(implicit executor: ExecutionContext): Future[S]
}
@kevinkyyro
kevinkyyro / NinetyNine.scala
Last active October 5, 2016 21:47
S-99: Ninety-Nine Scala Problems
// http://aperiodic.net/phil/scala/s-99/
// https://gist.github.com/kevincairo/e91ef4e289a1892065d7eb1aef805f0a
import scala.annotation.tailrec
import scala.util.Random.nextInt
import scala.util.Try
def list(range: Range): List[Int] = range.toList
def rand(range: Range): Int = range(nextInt(range.length))
def repeat[A](n: Int): A => List[A] = List.fill(n)(_: A)
def repeatr[A](r: Range): A => List[A] = repeat(rand(r))
@kevinkyyro
kevinkyyro / bloodvessels
Last active November 21, 2016 13:23
The_Force shaders
float square(float t) {
return step(0.0, sin(t));
}
void main () {
vec2 uv = uv();
vec2 uvN = uvN();
vec3 c = black;
float t = time / 24.;