Skip to content

Instantly share code, notes, and snippets.

View prototype-bootstrap-conflict-fix.js
if (Prototype.BrowserFeatures.ElementExtensions) {
var disablePrototypeJS = function (method, pluginsToDisable) {
var handler = function (event) {
event.target[method] = undefined;
setTimeout(function () {
delete event.target[method];
}, 0);
};
pluginsToDisable.each(function (plugin) {
jQuery(window).on(method + '.bs.' + plugin, handler);
View CyrillicTestComponent.html
<!doctype html>
<html>
<head>
<title>Entry</title>
</head>
<body>
<wo:form>
<wo:textfield value="$inputStringFromTextField" /> <wo:submit action="$submit" />
</wo:form>
</body>
View KVCAsync.java
package strimillinn.xperimental.async;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@Retention( RetentionPolicy.RUNTIME )
public @interface KVCAsync {}
View DateTrunc.java
void performFetch() {
addDateTruncAttribute( editingContext, "SomeEntity", "checkInTimeTruncated", "check_in_time" );
addDateTruncAttribute( editingContext, "SomeEntity", "requestedTruncated", "requested" );
EOQualifier q = EOQualifier.qualifierWithQualifierFormat( "checkInTimeTruncated>=requestedTruncated", null );
// ...finish your fetch using the qualifier
}
static void addDateTruncAttribute( EOEditingContext ec, String entityName, String attributeName, String columnName ) {
EOAttribute attribute = new EOAttribute();
View DatetimeFormatterWrapper.java
package is.rebbi.core.formatters;
import java.text.FieldPosition;
import java.text.Format;
import java.text.ParsePosition;
import java.time.format.DateTimeFormatter;
import java.time.temporal.TemporalAccessor;
import java.util.Objects;
public class DateTimeFormatterWrapper extends Format {
View OCRExecutor.java
package strimillinn.core.ocr;
import java.io.File;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.atomic.LongAdder;
import org.apache.cayenne.query.SelectQuery;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
View CreateServerRuntime.java
public static ServerRuntime createServerRuntime() {
return ServerRuntime
.builder()
.addConfig( "cayenne-project.xml" )
.addModule( b -> b.bind( DataSourceFactory.class ).to( AppDataSourceFactory.class ) )
.build();
}
private static class AppDataSourceFactory implements DataSourceFactory {
View 1. Starting a new maven project.md

Getting started with WO Development using Maven

This tutorial focuses on getting started with Maven in Eclipse/Development. Maven and the Maven integration plugin are bundled with Eclipse so you don't need to install anything additional.

We don't cover Maven building on the CLI nor do we discuss concepts or how any of this actually works. This just gets the darned thing up and running, we can talk concepts and understanding later. So:

Let's set it up

1. Let Maven know WO/Wonder exists

Maven needs to know where to fetch the WO/Wonder frameworks and jars. If you're starting fresh, that means copying settings.xml (seen below in this gist) into ~/.m2/settings.xml. Now Maven knows where WOCommunity keeps it's stuff.

View Migrating an existing Fluffy Bunny Application project to Maven standard layout.md

Preparing

To prepare, turn off automatic builds in Eclipse (otherwise, Eclipse is going to be really, really "helpful" by creating folders, modifying .classpath etc.). Keep automatic builds off until you've at least finished step 2 (changing your configuration files.

Once you've changed the configuration files, close the project and open it again, then turn on the Eclipse builds again.

1. Creating folders and moving stuff around

Here are the modifications you have to do to your project's layout, expressed in bash (as if your working directory is your project's root).