yarn install
yarn parcel
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
val greet = taskKey[Unit]("Says hello to you") | |
// Reverses the value of `name` and calls `greet` | |
val greetReverse = Command.command("greetReverse") { state => | |
val extracted = Project.extract(state) | |
val newState = extracted.append(Seq(name := name.value.reverse), state) | |
Project.runTask(greet, newState) |
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
{ | |
search(query: "user:insert_user_here topic:insert_topic_here", type: REPOSITORY, first: 50) { | |
nodes { | |
... on Repository { | |
name | |
pullRequests(states: OPEN, orderBy: {field: CREATED_AT, direction: DESC}, first: 10) { | |
nodes { | |
title | |
author { | |
avatarUrl |
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
(function() { | |
function wrap(s, maxLength) { | |
return s.split(' ').reduce(function(acc, x) { | |
var i = acc.length - 1; | |
var last = acc[i] == '' ? x : (acc[i] + ' ' + x); | |
if (last.length > maxLength) { | |
acc.push(x); | |
} else { | |
acc[i] = last; |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title></title> | |
<style> | |
body, #map { | |
width: 100%; | |
height: 100%; |
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 shapeless._ | |
import shapeless.labelled._ | |
import shapeless.ops.function._ | |
import shapeless.ops.hlist._ | |
import shapeless.ops.record._ | |
import shapeless.record._ | |
import shapeless.syntax.singleton._ | |
import shapeless.syntax.std._ | |
import shapeless.syntax.std.function._ | |
import shapeless.syntax.std.traversable._ |
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
scala> import org.joda.time._ | |
import org.joda.time._ | |
scala> val j = Json.obj("date" -> "2012-08-16 17:52:20") | |
j: play.api.libs.json.JsObject = {"date":"2012-08-16 17:52:20"} | |
scala> implicit val dateReads = Reads.jodaDateReads("yyyy-MM-dd HH:mm:ss") | |
dateReads: play.api.libs.json.Reads[org.joda.time.DateTime] = play.api.libs.json.DefaultReads$$anon$22@3e886411 | |
scala> (j \ "date").as[DateTime] |
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
lazy val allClasses = taskKey[Stream[String]]("Classes in classpath") | |
lazy val findClass = inputKey[Stream[String]]("Find classes matching name") | |
findClass := { | |
import complete.DefaultParsers._ | |
val any = ".*" | |
val parts: Seq[String] = spaceDelimited("<arg>").parsed | |
val caseSensitive: Boolean = parts.exists(_.matches(s"$any[A-Z]$any")) | |
val regex: String = (if (caseSensitive) "" else "(?i)") + |
NewerOlder