Skip to content

Instantly share code, notes, and snippets.

View jganoff's full-sized avatar

Jordan Ganoff jganoff

View GitHub Profile
SimpleEventForwardTest.java:
...
@Deployment
public static JavaArchive createTestDeployment()
{
JavaArchive archive = Archives.create("test.jar", JavaArchive.class);
archive.addPackages(false, Seam3JmsExtension.class.getPackage(), SimpleEventForwardTest.class.getPackage(), Destination.class.getPackage());
archive.addManifestResource(new ByteArrayAsset("<beans/>".getBytes()), ArchivePaths.create("beans.xml"));
package org.jboss.seam.jms.impl.inject;
import javax.enterprise.context.RequestScoped;
import javax.enterprise.inject.Any;
import javax.enterprise.inject.Instance;
import javax.enterprise.inject.Produces;
import javax.enterprise.inject.spi.InjectionPoint;
import javax.inject.Inject;
import javax.jms.JMSException;
import javax.jms.Queue;
package org.jboss.seam.examples.booking.booking;
import javax.enterprise.event.Observes;
import javax.enterprise.event.TransactionPhase;
import javax.inject.Inject;
import org.jboss.seam.examples.booking.model.Booking;
import org.slf4j.Logger;
public class ReservationNotifierBean implements ReservationNotifier
{
public interface Report<T extends ReportDataSource, I extends ReportInstance> {
I fill(T dataSource, Map<String, Object> parameters) throws ReportException;
}
package org.pentaho.hadoop.mapreduce.converter;
import org.pentaho.di.core.row.ValueMetaInterface;
/**
* Provides conversion between types
*
* @param <F> Type this converter can convert from
* @param <T> Type this converter can convert to
*/
@jganoff
jganoff / gist:2139471
Created March 20, 2012 18:38
Birthday Wish
puts "Happy Birthday, mojavelinux!"
@jganoff
jganoff / gist:3229953
Created August 1, 2012 19:29
Pentaho Big Data Plugin: Hadoop Configuration Testing with ShrinkWrap and VFS
// Create a test hadoop configuration "a"
FileObject ramRoot = VFS.getManager().resolveFile(HADOOP_CONFIGURATIONS_PATH);
FileObject aConfigFolder = ramRoot.resolveFile("hadoop-configurations/a");
aConfigFolder.createFolder();
assertEquals(FileType.FOLDER, aConfigFolder.getType());
// Create the properties file for the configuration as hadoop-configurations/a/config.properties
FileObject configFile = aConfigFolder.resolveFile("config.properties");
Properties p = new Properties();
p.setProperty("name", "Test Configuration A");
private boolean closeETLTabs(boolean save) throws KettleException {
Spoon spoonInstance = Spoon.getInstance();
int numTabs = spoonInstance.delegates.tabs.getTabs().size();
for (int i = numTabs - 1; i >= 0; i--) {
spoonInstance.tabfolder.setSelected(i);
// Logic copied directly out of SpoonTabsDelegate.tabClose(). That needs to be refactored badly.
Object control = spoonInstance.tabfolder.getSelected().getControl();
// Save the changes if we're requested to and the control object is a tab item
if (save && control instanceof TabItemInterface) {
TabItemInterface tabItem = (TabItemInterface) control;
@jganoff
jganoff / for-remote-topology-assembly.xml
Last active August 29, 2015 13:56
Kettle Storm topology jar with Janino support for the User Defined Java Class Step
<assembly>
<id>for-remote-topology</id>
<formats>
<format>jar</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<dependencySets>
<dependencySet>
<unpack>true</unpack>
<scope>runtime</scope>
@jganoff
jganoff / setup-node.sh
Last active August 29, 2015 14:13
PebbleJS in Node
# Clone PebbleJS' repo. This is the basis for all PebbleJS apps and includes
# libraries such as 'ajax', and 'ui'.
git clone git@github.com:pebble/pebblejs.git
# Tell Node where to find the PebbleJS modules
export NODE_PATH=$NODE_PATH:$(pwd)/pebblejs/js:$(pwd)/pebblejs/js/lib
# Pull down the XMLHttpRequest module into the current working directory.
# The 'ajax' module requires this.
npm install xmlhttprequest