- Theme is "Build Your Website in Scala in a Day". The goal would be for each participant to literally create and deploy a website in a Scala web framework in one day. No spectators; everyone builds a site! It can be your personal homepage, a hobby site, a business site, or anything else, so long as you fully intend to deploy (in alpha condition) at the end of the day.
- The event would be oriented toward developers who already have a reasonable knowledge of Scala, but have never used it to build a website.
- The event would be held on a Friday in 6-8 weeks, in Philadelphia. Friday because I want it to be a little more professional and business-oriented than Scalathon. Employers who actually need a website can send employees, for example.
- It would feature 2 or 3 frameworks (to be determined, based on interest/availability of core developers to attend). There would be maybe 7-10 participants p
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
| /* | |
| Copyright 2012-2021 Viktor Klang | |
| Licensed under the Apache License, Version 2.0 (the "License"); | |
| you may not use this file except in compliance with the License. | |
| You may obtain a copy of the License at | |
| http://www.apache.org/licenses/LICENSE-2.0 | |
| Unless required by applicable law or agreed to in writing, software |
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
| scala> def implicitlyEitherImpl[A: c.TypeTag, B: c.TypeTag](c: reflect.makro.Context): c.Expr[Either[A, B]] = { | |
| | def i[X](implicit X: c.TypeTag[X]): c.Tree = c.inferImplicitValue(X.tpe, silent = false) | |
| | i[A] match { | |
| | case c.mirror.EmptyTree => | |
| | i[B] match { | |
| | case c.mirror.EmptyTree => | |
| | sys.error("Neither A nor B are available implicitly") | |
| | case b => | |
| | c.reify(Right[A, B](c.Expr[B](b).eval)) | |
| | } |
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
| package net.liftweb.sandbox | |
| import org.scalatest.FunSuite | |
| import net.liftweb.json._ | |
| import org.scalatest.matchers.ShouldMatchers | |
| /** | |
| * @author IL | |
| * @see <a href="https://groups.google.com/forum/?fromgroups#!topic/liftweb/GK5DbzCtWdA">forum</a> | |
| */ |
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
| val unions = Seq(4->3, 3->8, 6->5, 9->4, 2->1, 5->0, 7->2, 6->1, 1->0) | |
| val parents = (0 to 9).toArray | |
| val depths = Array.fill(10)(1) | |
| def connected(p: Int, q: Int) = root(p) == root(q) | |
| def union(p: Int, q: Int) { | |
| val i = root(p) | |
| val j = root(q) | |
| val (sm, lg) = if (depths(i) < depths(j)) (i, j) else (j, i) |
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
| /*©2013 Viktor Klang*/ | |
| package akka.util | |
| import java.util.concurrent.atomic.AtomicReference | |
| import scala.concurrent.{ Future, ExecutionContext } | |
| import scala.annotation.tailrec | |
| class Cache[K, V](__ec: ExecutionContext, throughput: Int) extends AtomicReference[Map[K, V]] { | |
| implicit val executor = SerializedSuspendableExecutionContext(throughput)(__ec) | |
| @tailrec final def update(f: Map[K, V] ⇒ Map[K, V]): Map[K, V] = { | |
| val v = get | |
| val nv = f(v) |
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
| class EndlessList { | |
| /** | |
| * Gets a "page" (e.g., 10 items) of content entities from the database. | |
| */ | |
| def getPage(page: Int): (Seq[Content], Boolean) = { | |
| val realPage: Int = if (page < 1) 1 else page | |
| val limit = 10 | |
| val contents = Content.findAll( | |
| (/* conditions */), |
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 sbt._ | |
| import sbt.Keys._ | |
| object MyBuild extends Build { | |
| import Dependencies._ | |
| import BuildSettings._ | |
| lazy val main = Project("root", file(".")) | |
| .settings(mainWebSettings: _*) | |
| .settings( |
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
| <snippet> | |
| <content><![CDATA[ | |
| define(function(require) { | |
| var defineComponent = require('flight/lib/component'); | |
| return defineComponent(${1}); | |
| function ${1}() { | |
| this.defaultAttrs({ |
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
| curl -XDELETE "http://localhost:9200/bluekiwi"; echo | |
| curl -XPUT "http://localhost:9200/bluekiwi/doc/1" -d' | |
| { | |
| "group":1, | |
| "title":"test", | |
| "content":"nothing", | |
| "tags":["tag1","tag2"], | |
| "authorId":1, | |
| "creatorId":1 |