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
RED="\[\033[0;31m\]" | |
YELLOW="\[\033[0;33m\]" | |
GREEN="\[\033[0;32m\]" | |
BLUE="\[\033[0;34m\]" | |
LIGHT_RED="\[\033[1;31m\]" | |
LIGHT_GREEN="\[\033[1;32m\]" | |
WHITE="\[\033[1;37m\]" | |
LIGHT_GRAY="\[\033[0;37m\]" | |
COLOR_NONE="\[\e[0m\]" |
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 code.webapp | |
import scala.collection.JavaConversions.seqAsJavaList | |
import org.apache.wicket.behavior.AttributeAppender | |
import org.apache.wicket.datetime.markup.html.form.DateTextField | |
import org.apache.wicket.extensions.validation.validator.RfcCompliantEmailAddressValidator | |
import org.apache.wicket.markup.html.basic.{ MultiLineLabel, Label } | |
import org.apache.wicket.markup.html.form.{ TextField, TextArea, SubmitLink, RadioGroup, Radio, PasswordTextField, FormComponent, Form, DropDownChoice, CheckGroup, Button } | |
import org.apache.wicket.markup.html.link.{ Link, BookmarkablePageLink } | |
import org.apache.wicket.markup.html.link.ExternalLink |
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 code.pages | |
import org.apache.wicket.authroles.authorization.strategies.role.annotations.AuthorizeInstantiation | |
import org.apache.wicket.markup.html.form.Button | |
import org.apache.wicket.markup.html.form.Form | |
import org.apache.wicket.markup.html.WebMarkupContainer | |
import org.apache.wicket.spring.injection.annot.SpringBean | |
import org.springframework.stereotype.Service | |
import code.model.Evento | |
import code.services.EventosService |
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
val opcoesCha = servico.find() | |
// #1 - regular Scala+Wicket code | |
val chaCozinha = new WebMarkupContainer("chaCozinha") | |
val chaBar = new WebMarkupContainer("chaBar") | |
val chaBarnela = new WebMarkupContainer("chaBarnela") | |
add(chaCozinha, chaBar, chaBarnela) | |
chaCozinha.setDefaultModel(new CompoundPropertyModel(opcoesCha)) | |
chaBar.setDefaultModel(new CompoundPropertyModel(opcoesCha)) |
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
List lst = null; | |
lst = new ArrayList(10); | |
lst = myService.findAll(); | |
// Programmers... PLEASE... STOP ... DOING... THIS!! |
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
<html> | |
<head> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script> | |
<script> | |
function showDiff() { | |
var s1 = $("#first").val(); | |
var s2 = $("#second").val(); | |
var d1 = toDate(s1); | |
var d2 = toDate(s2); |
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
trait Routes { | |
self: DSLRouter ⇒ | |
def initRoutes { | |
"/login" -> classOf[Login] | |
"/index" -> classOf[Index] | |
} | |
} |
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 MyRouteBuilder extends RouteBuilder { | |
val tweetMsg = (e: Exchange) ⇒ { | |
val tweet = new StatusUpdate("@%s ei, se minha palestra for aceita, voce vai aprender como usar Scala, Apache Camel e Twitter!".format(status.getFromUser())) | |
tweet.setInReplyToStatusId(e.getIn.getBody.asInstanceOf[Tweet].getId()) | |
e.getIn().setBody(tweet) | |
} | |
"twitter://search?delay=10&type=polling&keywords=%23TDC2012%20scala%20camel%20twitter" ==> { | |
when(_.in.asInstanceOf[Tweet].getFromUser() != "brunoborges") { |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<module xmlns="urn:jboss:module:1.0" name="org.springframework.spring"> | |
<resources> | |
<resource-root path="cglib-nodep-2.2.2.jar"/> | |
<resource-root path="aopalliance-1.0.0.jar"/> | |
<resource-root path="spring-aop-3.1.1.RELEASE.jar"/> | |
<resource-root path="spring-asm-3.1.1.RELEASE.jar"/> | |
<resource-root path="spring-beans-3.1.1.RELEASE.jar"/> | |
<resource-root path="spring-context-3.1.1.RELEASE.jar"/> | |
<resource-root path="spring-context-support-3.1.1.RELEASE.jar"/> |
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
<build> | |
<plugins> | |
<plugin> | |
<groupId>org.apache.maven.plugins</groupId> | |
<artifactId>maven-jar-plugin</artifactId> | |
<version>2.4</version> | |
<configuration> | |
<archive> | |
<manifestEntries> | |
<Dependencies>com.mycompany.mymodule</Dependencies> |
OlderNewer