import io.circe.generic.extras.JsonKey
import sttp.client3._
import sttp.client3.circe._
import shapeless._
import io.circe._
import io.circe.generic.semiauto._
import io.circe.generic.auto._
import io.circe.generic.extras._, io.circe.syntax._
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 allSvgElements: SortedSet[String] = svg11Elements ++ svg12TinyElementsWithAttributes.keySet | |
val svgFactories = for { | |
elementName <- allSvgElements.toSeq.sorted // <- | |
} yield q""" | |
object ${Term.Name(elementName)} extends ElementFactory[${Type.Name("SVGElement")}] { | |
@inline protected def tagName = $elementName | |
} | |
""" |
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
#!/usr/bin/env ruby | |
# encoding: utf-8 | |
$stdout.sync = true | |
print "Scanning for FIXMEs. Generating diff…" | |
diff_bad = `HGRCPATH="" hg diff -r "default:$HG_NODE" --exclude 'glob:**.xml' --ignore-space-change --nodates --noprefix` | |
print "\rParsing and preparing output… " | |
diff = diff_bad.encode('utf-8', 'binary', :invalid => :replace, :undef => :replace) # because .properties files |
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
"Case class tuple codec": { | |
"prefix": "scircetuple", | |
"body": [ | |
"import io.circe._", | |
"case class ${1:MyCaseClass}(${2:_1}: ${3:Double}, ${4:_2}: ${5:String})", | |
"object ${1} {", | |
" implicit val codec: Codec[${1}] = Codec.from(", | |
" implicitly[Decoder[(${3}, ${5})]].map((${1}.apply _).tupled),", | |
" implicitly[Encoder[(${3}, ${5})]].contramap(r => (r.${2}, r.${4}))", | |
" )", |
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
{ | |
"Case class tuple codec": { | |
"prefix": "scircetuple", | |
"body": [ | |
"import io.circe._", | |
"case class ${1:MyCaseClass}(${2:_1}: ${3:Double}, ${4:_2}: ${5:String})", | |
"object ${1} {", | |
" implicit val codec: Codec[${1}] = Codec.from(", | |
" implicitly[Decoder[(${3}, ${5})]].map((${1}.apply _).tupled),", | |
" implicitly[Encoder[(${3}, ${5})]].contramap(r => (r.${2}, r.${4}))", |