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
| processor : 0 | |
| vendor_id : GenuineIntel | |
| cpu family : 6 | |
| model : 85 | |
| model name : Intel Xeon Processor (Skylake, IBRS) | |
| stepping : 4 | |
| microcode : 0x1 | |
| cpu MHz : 2099.998 | |
| cache size : 16384 KB | |
| physical id : 0 |
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
| def isScalaNative: Boolean = | |
| System.getProperty("java.vm.name") == "Scala Native" |
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
| object ZipArchive { | |
| def unZip(source: File, targetFolder: File): Unit = { | |
| val zipFile = new ZipFile(source) | |
| try | |
| zipFile.entries.asScala.foreach { entry => | |
| val target = new File(targetFolder, entry.getName) | |
| if (entry.isDirectory) target.mkdirs() | |
| else { | |
| target.getParentFile.mkdirs() | |
| val in = zipFile.getInputStream(entry) |
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 pine._ | |
| import better.files._ | |
| // Place file in src/ | |
| object PrefixClasses extends App { | |
| File.currentWorkingDirectory.glob("*.html").foreach { file => | |
| val newContent = HtmlParser.fromString(file.contentAsString).map { | |
| case t: Tag[_] => t.`class`.update(_.map(cls => | |
| if (cls.startsWith("sk-")) cls else "sk-" + cls)) | |
| case n => n |
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
| $ bloop test pineJVM --verbose | |
| [D] Scheduled compilation of 'pineJVM' starting at 19:44:29.349. | |
| [D] No changes | |
| [D] Scheduled compilation of 'pineJVM-test' starting at 19:44:29.356. | |
| [D] Full compilation, no sources in previous analysis. | |
| [D] All sources are invalidated. | |
| [D] Recompiling all 11 sources: invalidated sources (11) exceeded 50.0% of all sources | |
| Compiling 11 Scala sources to /home/tim/dev/pine/.bloop/pineJVM/scala-2.12/test-classes ... | |
| [D] Getting ch.epfl.scala:compiler-bridge_2.12:1.1.1+49-1c290cbb:compile for Scala 2.12.4-bin-typelevel-4 | |
| [D] Getting ch.epfl.scala:compiler-bridge_2.12:1.1.1+49-1c290cbb:compile for Scala 2.12.4-bin-typelevel-4 |
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 scala.collection.mutable | |
| import scala.collection.JavaConverters._ | |
| import org.eclipse.jgit.diff.{HistogramDiff, Sequence, SequenceComparator} | |
| val histogramDiff = new HistogramDiff() | |
| histogramDiff.setFallbackAlgorithm(null) | |
| val deltas = histogramDiff.diff( | |
| new DataListComparator[Char], |
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
| object CodeGenFunctions extends js.Object { | |
| def fn() = println("hello") | |
| } | |
| // JavaScript output | |
| function $s_Lminicol_CodeGenFunctions$__fn__Lminicol_CodeGenFunctions$__V($this) { | |
| $m_Lminicol_package$(); | |
| console.log("hello") | |
| } |
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 org.scalajs.dom.document | |
| object Session { | |
| val CookieName = "SessionId" | |
| val key: String = CookieName | |
| var username: Option[String] = Option(JsGlobals.username) | |
| def get: Option[String] = | |
| document.cookie.split(";").toList.flatMap { part => |
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 scala.concurrent.Future | |
| import scala.concurrent.ExecutionContext.Implicits.global | |
| /** | |
| * A Service is an abstraction for a small processing unit that takes a request | |
| * and responds asynchronously. The communication is therefore entirely | |
| * message-driven. The messages are epxected to be immutable. A service can | |
| * have an internal state that will not be exposed. Services can be composed | |
| * and requests may be forwarded to other services. The concept is inspired by | |
| * Akka's actors. |
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 com.badlogic.gdx.ApplicationAdapter; | |
| import com.badlogic.gdx.Gdx; | |
| import com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application; | |
| import com.badlogic.gdx.backends.lwjgl3.Lwjgl3ApplicationConfiguration; | |
| import com.badlogic.gdx.graphics.Color; | |
| import com.badlogic.gdx.graphics.g2d.BitmapFont; | |
| import com.badlogic.gdx.scenes.scene2d.Stage; | |
| import com.badlogic.gdx.scenes.scene2d.ui.Label; | |
| import com.badlogic.gdx.graphics.g2d.Batch; |