See https://github.com/sbt/sbt/wiki/sbt-1.x-plugin-migration for the list with sbt 1.x migration status.
| plugin | star |
|---|---|
| playframework/playframework | 9597 |
| scala-js/scala-js | 3053 |
| sbt/sbt-assembly | 1092 |
| mpeltonen/sbt-idea | 1085 |
| <script> | |
| $.as.route.page('settings', () => { | |
| if(!S.user.is){ return $.as.route('hi') } | |
| $.as('#settings', S.user); | |
| ;(() => { | |
| $('#pet').on('keyup', function(){ $('.pet').text(this.value.length + ' letters.') }); | |
| $('#kiss').on('keyup', function(){ $('.kiss').text(this.value.length + ' letters.') }); | |
| S.user.get('settings').get('pet').on(function(l){ $('#pet').val(Gun.text.random(l, '*')) }); |
See https://github.com/sbt/sbt/wiki/sbt-1.x-plugin-migration for the list with sbt 1.x migration status.
| plugin | star |
|---|---|
| playframework/playframework | 9597 |
| scala-js/scala-js | 3053 |
| sbt/sbt-assembly | 1092 |
| mpeltonen/sbt-idea | 1085 |
| const isEqual = function(inputs = []) { | |
| // Checks an element if js object. | |
| const isObject = function(data) { | |
| return Object.prototype.toString.call(data) === '[object Object]'; | |
| }; | |
| // Sorts given object by its keys. | |
| const sortObjectByKey = function(obj) { | |
| if (!obj) return {}; | |
| return Object.keys(obj).sort().reduce((initialVal, item) => { |
| to check if the server works - https://webrtc.github.io/samples/src/content/peerconnection/trickle-ice | |
| stun: | |
| stun.l.google.com:19302, | |
| stun1.l.google.com:19302, | |
| stun2.l.google.com:19302, | |
| stun3.l.google.com:19302, | |
| stun4.l.google.com:19302, | |
| stun.ekiga.net, | |
| stun.ideasip.com, |
| package wcatest | |
| import org.scalajs.dom | |
| import org.scalajs.dom.crypto.{CryptoKey, _} | |
| import org.scalajs.dom.raw.Promise | |
| import scala.concurrent.Future | |
| import scala.scalajs.concurrent.JSExecutionContext.Implicits.runNow | |
| import scala.scalajs.js | |
| import scala.scalajs.js.JSApp |
| package controllers | |
| import play.api.http.{ContentTypes, ContentTypeOf} | |
| import upickle.Js | |
| import upickle.default._ | |
| import play.api.mvc._ | |
| import scala.concurrent.Future | |
| import scala.concurrent.ExecutionContext.Implicits.global |
| /*************************************************************************************************** | |
| * Copyright (c) 2015 Rüdiger Herrmann | |
| * All rights reserved. This program and the accompanying materials are made available under the | |
| * terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available | |
| * at http://www.eclipse.org/legal/epl-v10.html | |
| * | |
| * Contributors: | |
| * Rüdiger Herrmann - initial API and implementation | |
| **************************************************************************************************/ | |
| package com.codeaffine.jgit.example; |
Java 8 introduced lambdas to the Java language. While the design choices differ in many regards from Scala's functions, the underlying mechanics used to represent Java lambdas is flexible enough to be used as a target for the Scala compiler.
Java does not have canonical heirarchy of generic function types (ala scala.FunctionN), but instead allows a lambda to be used as a shorthand for an anonymous implementation of an Functional Interface
Here's an example of creating a predicate that closes over one value:
| // create the xbm image from a given node | |
| createSnapshotAndWriteXbm(pane, "epaperImage"); | |
| // display the image on the e-paper display | |
| try { | |
| Process p1 = new ProcessBuilder("/bin/bash", "-c", "/home/pi/gratis/PlatformWithOS/driver-common/xbm2bin < /home/pi/epaper/yotaclock.xbm > /dev/epd/display").start(); | |
| p1.waitFor(1, TimeUnit.SECONDS); | |
| Process p2 = new ProcessBuilder("/bin/bash", "-c", "echo U > /dev/epd/command").start(); | |
| p2.waitFor(1, TimeUnit.SECONDS); | |
| } catch (InterruptedException | IOException e) { |
| package com.guigarage.incubator.wobble; | |
| import javafx.application.Application; | |
| import javafx.geometry.Point2D; | |
| import javafx.scene.Group; | |
| import javafx.scene.Scene; | |
| import javafx.scene.paint.Color; | |
| import javafx.scene.shape.*; | |
| import javafx.stage.Stage; |