I hereby claim:
- I am everson on github.
- I am everson (https://keybase.io/everson) on keybase.
- I have a public key ASAsYPxrdc6JJE63Cbr0LQG_8jNZ77yj68vhdOKTd_1n9go
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
// returns a new array where every object is the result of the passed function applied to corresponding element in the original array | |
Array.prototype.map = function(fn){ | |
var nArr=[]; | |
for(i=0; i<this.length; i++){ | |
nArr[i] = fn(this[i]) | |
}; | |
return nArr | |
} | |
// to use it, define a function taking one argument and processing it: |
".playerDeckCard" #> cards.map ( card => | |
".card [data-keyname]" #> card.keyname.is & | |
".card [data-cardname]" #> card.name.is & | |
... | |
) |
package lib | |
import sys.process.{Process, stringToProcess} | |
class Shell { | |
var elems = Vector[String]() | |
var cwd = "/tmp" | |
def >(str: String) = elems :+= str | |
def run() = elems.map( cmd => { |
package myproject | |
package snippet | |
import net.liftweb._ | |
import common.Logger | |
import http._ | |
import js._ | |
import JsCmds._ | |
import JE._ |
import Html exposing (text) | |
import Mouse exposing (position) | |
main = (map text position) |
#!/bin/sh | |
exec scala "$0" "$@" | |
!# | |
/* | |
* Copyright (c) 2011-15 Miles Sabin | |
* | |
* 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 |
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
type Id = Int | |
def insertA():Either[Exception, Id] = {println("running A"); Right(1)} | |
def insertB(a: Id):Either[Exception, Id] = {println("running B with " + a); Left(new Exception("Oops"))} | |
def insertC(b: Id):Either[Exception, Id] = {println("running C with " + b); Right(3)} | |
for { | |
a <- insertA().right | |
b <- insertB(a).right | |
c <- insertC(b).right |
import scalaz._ | |
import Scalaz._ | |
val isThisCool: Boolean @@ CoolStuff = Tag(true) | |
def requiresCoolStuff(in: Boolean @@ CoolStuff) = in | |
// type checks | |
requiresCoolStuff(isThisCool) |