Skip to content

Instantly share code, notes, and snippets.

View mojavelinux's full-sized avatar

Dan Allen mojavelinux

View GitHub Profile
<h:form>
<f:event type="postValidate" listener="#{minMax.validate}"/>
<h:inputText id="min" value="#{bean.min}"
binding="#{minMax.minInput}"/> <h:message for="min"/>
<h:inputText id="max" value="#{bean.max}"
binding="#{minMax.maxInput}"/> <h:message for="max"/>
<h:commandButton value="Submit"/>
</h:form>
/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
*
* The contents of this file are subject to the terms of either the GNU
* General Public License Version 2 only ("GPL") or the Common Development
* and Distribution License("CDDL") (collectively, the "License"). You
* may not use this file except in compliance with the License. You can obtain
* a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html
package org.jboss.seam.bean;
import java.lang.annotation.Annotation;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import javax.enterprise.event.Observes;
import javax.enterprise.inject.spi.AnnotatedConstructor;
@mojavelinux
mojavelinux / archiveusertimeline.groovy
Created March 31, 2010 14:52
A script to archive a user's twitter timeline incrementally
#!/usr/bin/env groovy
import groovyx.net.http.RESTClient
import groovy.xml.MarkupBuilder
import org.apache.commons.lang.StringEscapeUtils
def cli = new CliBuilder(usage: "archiveusertimeline [OPTION]")
cli.u(longOpt: "user", args: 1, required: true, "User to archive")
cli.p(longOpt: "pwd", args: 1, required: true, "Password of user")
ClassLoader cl = new SecureClassLoader() {
@Override
protected URL findResource(final String name) {
final Asset a = archive.get(name);
if (a == null) {
return null;
}
try {
return new URL(null, "archive:/" + name, new URLStreamHandler() {
package org.jboss.seam.faces.component;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import javax.enterprise.util.Nonbinding;
import javax.inject.Qualifier;
/**
#!/bin/bash
# Program locations
xmlstarlet=/usr/bin/xmlstarlet
git=/usr/bin/git
phase1_dir=import-phase1
phase2_dir=import-phase2
get_modules=$(svn list --xml http://anonsvn.jboss.org/repos/seam/modules/ | xmlstarlet sel -T -t -m "//name" -c . -n)
get_parent=1
#!/usr/bin/env groovy
def modifyFile(file, Closure processText) {
def text = file.text
file.write(processText(text))
}
def phase2_dir = 'import-phase2'
def root = new File(phase2_dir)
apply plugin: 'java'
setBuildDir('target')
repositories {
mavenCentral()
mavenRepo urls: ["http://repository.jboss.org/nexus/content/groups/public/"]
}
dependencies {
@mojavelinux
mojavelinux / StartupBean.java
Created October 20, 2010 03:41
A sample CDI extension for eagerly instantiating @ApplicationScoped beans annotated @startup
@ApplicationScoped
@Startup
public class StartupBean
{
@PostConstruct
public void onStartup()
{
System.out.println("Application starting up.");
}
}