// To test for a key without retrieving the value, use an underscore in place of the first value:
_, ok := m["route"]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
/// Slick | |
// schema | |
case class Album( | |
artist : String, | |
title : String, | |
id : Long = 0L) | |
class AlbumTable(tag: Tag) extends Table[Album](tag, "albums") { | |
def artist = column[String]("artist") |
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 io.circe._, io.circe.parser._ | |
import cats._ | |
import cats.data.Xor | |
val raw = """ | |
{ | |
"key" : "value", | |
"lorem" : "ipsum" | |
} | |
""" |
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
#!/bin/bash | |
URL="$1" | |
MAX_RUNS="$2" | |
SUM_TIME="0" | |
SUM_SIZE="0" | |
i="0" | |
while [ $i -lt $MAX_RUNS ]; do | |
TIME=`curl $URL -o /dev/null -s -w %{time_total}` |
Random.generate OnResult (Random.int 1 6)
Call the given generator to produce a value of type Int, then use the msg constructor "OnResult" on the generated Int to produce a message and finally pass that message to my update function to get the next state of the program and your next command.
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
///################## | |
/// Create Form Component | |
class CreateTask extends React.Component { | |
handleSuccess: function() { | |
this.context.router.push('/trips'); | |
}, | |
handleSubmit: function(data) { | |
const _this = this; |