This file contains 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
(ns com.freiheit.clojure.appengine.appengine-local | |
(:use | |
[compojure.http routes servlet helpers] | |
clojure.contrib.test-is | |
compojure.server.jetty | |
[clojure.contrib def str-utils duck-streams]) | |
(:require | |
[clojure.contrib.logging :as log]) | |
(:import | |
[com.google.appengine.api.labs.taskqueue.dev LocalTaskQueue] |
This file contains 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
(defproject compojureongae "0.2.0" | |
:description "Example app for deployoing Compojure on Google App Engine" | |
:namespaces [compojureongae.core] | |
:dependencies [[compojure "0.4.0-RC3"] | |
[ring/ring-servlet "0.2.1"] | |
[hiccup "0.2.4"] | |
[appengine "0.2"] | |
[com.google.appengine/appengine-api-1.0-sdk "1.3.4"] | |
[com.google.appengine/appengine-api-labs "1.3.4"]] | |
:dev-dependencies [[swank-clojure "1.2.0"] |
This file contains 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 A | |
class A2 extends A | |
class B | |
trait M[X] | |
// | |
// Upper Type Bound | |
// | |
def upperTypeBound[AA <: A](x: AA): A = x |
This file contains 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 caseclasses | |
case class A() | |
//This compiles Just Fine | |
object A | |
class Z { |
This file contains 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
// Vals en el constructor son propiedades: | |
// p = Person("fede","silva", 10 ) | |
// p.first | |
case class Person( val first:String, val last:String, val age:Int ) | |
// Como si fuera statics: | |
// Person.key | |
object Person extends Mapper[Person] { | |
def key = first |
This file contains 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._ | |
class Plugins(info: ProjectInfo) extends PluginDefinition(info) { | |
val appenginePlugin = "net.stbbs.yasushi" % "sbt-appengine-plugin" % "2.1" from "http://github.com/downloads/Yasushi/sbt-appengine-plugin/sbt-appengine-plugin-2.1.jar" | |
val scalatePlugin = "net.stbbs.yasushi" % "sbt-scalate-plugin" % "1.0" | |
} |
This file contains 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._ | |
class SplendidoWebProject(info:ProjectInfo) | |
extends AppengineProject(info) | |
with JRebel | |
with net.stbbs.yasushi.ScalatePlugin { | |
val scalaj_collection = "org.scalaj" %% "scalaj-collection" % "1.0" |
This file contains 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
f@Hedwig:~/Workshop/clients/splendido/maqueta (git:wip-content:M?)$ sbt | |
[info] Building project splendido-web 1.0 against Scala 2.8.0 | |
[info] using SplendidoWebProject with sbt 0.7.4 and Scala 2.7.7 | |
> | |
> ~ prepare-webapp | |
[info] | |
[info] == precompile == | |
[info] Running net.stbbs.yasushi.ScalatePrecompiler /Users/f/Workshop/clients/splendido/maqueta/target/gen /Users/f/Workshop/clients/splendido/maqueta/src/main/resources/templates /Users/f/Workshop/clients/splendido/maqueta/src/main/resources/index.ssp /Users/f/Workshop/clients/splendido/maqueta/src/main/resources | |
Oct 6, 2010 3:41:17 AM net.stbbs.yasushi.ScalatePrecompiler$ main | |
INFO: Precompiling Scalate Templates into Scala soruces... |
This file contains 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 splendido | |
import pragmagica.util.servlet._ | |
import java.util.Date | |
class App extends ApplicationFilter { | |
override def routes = super.routes + | |
( "^/$".r , (c) => new Index(c) ) + | |
( "^/contacto".r , (c) => new Contacto(c) ) |
This file contains 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> // Problem: Some java apis return nulls. | |
scala> System.getenv("PROBABLY_NOT_DEFINED_RUBISH_NAME") | |
res0: java.lang.String = null | |
scala> System.getenv("PROBABLY_NOT_DEFINED_RUBISH_NAME").split(",") | |
java.lang.NullPointerException | |
at .<init>(<console>:7) | |
at .<clinit>(<console>) | |
at RequestResult$.<init>(<console>:9) |