A tweet-sized debugger for visualizing your CSS layouts. Outlines every DOM element on your page a random (valid) CSS hex color.
One-line version to paste in your DevTools
Use $$
if your browser aliases it:
~ 108 byte version
/* | |
Copyright (c) 2017 Chris Patuzzo | |
https://twitter.com/chrispatuzzo | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is | |
furnished to do so, subject to the following conditions: |
// requires Scala 2.10.0-M7 | |
def kind[A: scala.reflect.TypeTag]: String = { | |
import scala.reflect.runtime.universe._ | |
def typeKind(sig: Type): String = sig match { | |
case PolyType(params, resultType) => | |
(params map { p => | |
typeKind(p.typeSignature) match { | |
case "*" => "*" | |
case s => "(" + s + ")" | |
} |
/* | |
* Original author's work: @see https://gist.github.com/carymrobbins/7b8ed52cd6ea186dbdf8 | |
* - 2019-07-18 Added support for Option and Map types | |
* - 2019-11-25 Fixed Option types spacing | |
*/ | |
object ClassUtils { | |
/** | |
* Pretty prints a Scala value similar to its source represention. | |
* Particularly useful for case classes. |