Skip to content

Instantly share code, notes, and snippets.

View tommilimmot's full-sized avatar

Tommi Lehto tommilimmot

  • Helsinki
View GitHub Profile
@tommilimmot
tommilimmot / scala unwrap collection
Last active December 7, 2017 21:00
scala: pass List/Collection of arguments to Function with argument type (String, String) *, such as play.api.libs.ws.WS.WSRequestHolder.withQueryString()
val argumentList = List("arg1"->"val1", "arg2"->"val2", "arg3"->"val3")
// repl> argumentList: List[(String, String)] = List((arg1,val1), (arg2,val2), (arg3,val3))
// from play 2.1 scala api
// def withQueryString(parameters: (String, String)*): WSRequestHolder
// can't pass List[(String, String)] to function because it expects type (String, String)
// unwrap collection (List) with : _*
play.api.libs.ws.WS.url("http://localhost").withQueryString(argumentList : _*).get
@tommilimmot
tommilimmot / css notes
Last active December 21, 2015 12:08
CSS notes
box-sizing: border-box;
// adviced to be used globally nowadays - bootstrap3 uses it by default, for instance
// on IE8 or older max-/min-height/width won't work - e.g. can't have responsive image resizing on IE8