Skip to content

Instantly share code, notes, and snippets.

View spg's full-sized avatar

Simon-Pierre Gingras spg

View GitHub Profile
// ------- Supposons le fichier path/to/my/velocity/file.vm -----
// <html>
// $val1
// $val2
// $val3
// </html>
// ==== Option 1 =====
public class VelocityWrapper {
private final Template template;
private final VelocityContext velocityContext;
private VelocityWrapper(
VelocityEngine velocityEngine,
String templateLocation,
VelocityContext velocityContext) {
this.template = velocityEngine.getTemplate(templateLocation);
Loading module: project
Top URL: http://127.0.0.1:8888/Project.html?gwt.codesvr=127.0.0.1:9997
User agent: Chrome
Remote host: localhost:56017
Tab key:
Session key: /C*w?/+:=~z/OH.3
DEBUG: Validating units:
INFO: Ignored 2 units with compilation errors in first pass.
Compile with -strict or with -logLevel set to TRACE or DEBUG to see all errors.
DEBUG: Rebinding com.projectname.client.application.resourceworkspace.ResourceWorkspaceView.Binder
@spg
spg / gist:5700772
Last active December 18, 2015 00:59
// ===== USAGE
private void fetchevent() {
eventService.getEvent(id, new MethodCallbackImpl<Event>() {
@Override
public String getErrorMessage() {
return "Could not fetch event " + id;
}
@Override
public void onSuccess(Event event) {
@spg
spg / gist:5706518
Last active December 18, 2015 01:48
import org.fusesource.restygwt.client.Method;
import org.fusesource.restygwt.client.MethodCallback;
import com.google.gwt.user.client.Window;
public abstract class MethodCallbackImpl<T> implements MethodCallback<T> {
@Override
public void onSuccess(Method method, T result) {
onSuccess(result);
}
@spg
spg / gist:5709821
Last active December 18, 2015 02:18
ce test là passe de mon côté
import java.util.ArrayList;
import java.util.List;
import javax.inject.Inject;
import org.jukito.JukitoModule;
import org.jukito.JukitoRunner;
import org.junit.Test;
import org.junit.runner.RunWith;
@spg
spg / gist:5709997
Last active December 18, 2015 02:19
import java.util.ArrayList;
import java.util.List;
import javax.inject.Inject;
import org.jukito.JukitoModule;
import org.jukito.JukitoRunner;
import org.junit.Test;
import org.junit.runner.RunWith;
@spg
spg / gist:5814325
Created June 19, 2013 13:27
StoriesResource and CurrentUserProvider
package com.sceneverse.shozon.server.rest;
import javax.inject.Inject;
import javax.inject.Provider;
import org.jukito.JukitoModule;
import org.jukito.JukitoRunner;
import org.junit.Test;
import org.junit.runner.RunWith;
@spg
spg / gist:5935434
Last active December 19, 2015 09:49
Running ChromeDriver against a DevMode GWT application
@Provides
@Singleton
protected WebDriver getDefaultWebDriver() throws IOException {
ChromeOptions chromeOptions = new ChromeOptions();
// to find the location of your gwtDev.plugin: go to chrome://plugins -> + Details
chromeOptions.addArguments("--load-plugin=/Users/Simon/Library/Application " +
"Support/Google/Chrome/Default/Extensions/jpjpnpmbddbjkfaccnmhnkdgjideieim/1.0.11357_0/Darwin-gcc3/gwtDev.plugin");
ChromeDriver chromeDriver = new ChromeDriver(chromeOptions);
@spg
spg / gist:7031827
Created October 17, 2013 20:40
Headless Appengine maven plugin auth with p/w from STDIN
<configuration>
<email>[email protected]</email>
<oauth2>false</oauth2>
<noCookies>true</noCookies>
<passin>true</passin>
</configuration>
command line:
mvn appengine:update <<< "thePassw00rd\?"