Skip to content

Instantly share code, notes, and snippets.

View PerWiklander's full-sized avatar

Per Wiklander PerWiklander

  • Wiklander Consulting
  • Stockholm, Sweden
View GitHub Profile
@PerWiklander
PerWiklander / Dispatcher.scala
Last active February 21, 2018 02:55
Facebook Flux implementation for scalajs-react
package flux
import utils.Loggable
import scala.concurrent.Future
class Dispatcher[Payload <: AnyRef] extends Loggable {
type Callback = (Payload) => Unit

Keybase proof

I hereby claim:

  • I am perwiklander on github.
  • I am perwiklander (https://keybase.io/perwiklander) on keybase.
  • I have a public key ASDRshJJr1jeKLkVHin6yB-Vu7bvkdrCvqZVRJ-qarjV8go

To claim this, I am signing this object:

@PerWiklander
PerWiklander / ItemSelector.scala
Created June 24, 2015 19:59
Traits to simplify making scalajs-react widgets
import scalaz.effect.IO
trait ItemSelector[ItemType] extends StatefulWidget[
ItemSelectorProps[ItemType],
ItemSelectorState[ItemType]
]
{
override def initialState = P => ItemSelectorState(P.selected)
}
case class ItemSelectorProps[ItemType](
@PerWiklander
PerWiklander / StringArrayColumnPrinter.java
Created May 3, 2012 19:29
String array column printer
package biz.wiklander.tools;
import java.util.Arrays;
public class StringArrayColumnPrinter {
public static void main(final String[] args) {
final String[] words = new String[] {
"one",
"duck",
package scalatags.Text
import scalatags.Text.Aggregate
import scalatags.Text.attrs._
trait ClassSet extends Aggregate {
final def compositeAttr[A](k: Attr, f: (A, List[A]) => A, e: => Modifier) = new CompositeAttr(k, f, e)
val classSwitch = compositeAttr[String](cls, (h, t) => (h::t).mkString(" ").trim, cls:="")