Skip to content

Instantly share code, notes, and snippets.

public static class Module extends JukitoModule {
@Override
protected void configureTest() {
// Configure whatever you want here
bind(UserInformationService.class).to(FakeUserInformationService.class);
bind(UserInformationService.class).to(RealUserInformationService.class);
}
}
class Endpoint {
private final UserInformationService userInformationService;
private final ResponseFactory responseFactory;
Endpoint(UserInformationService userInformationService, ResponseFactory responseFactory) {
this.userInformationService = userInformationService;
this.responseFactory = responseFactory;
}
public Response getUsername(int id) {
@Test
public void 2001_isCommon() {
boolean result = isLeapYear(2001);
assertThat(result).isFalse();
}
@Test
public void 1996_isLeap() {
boolean result = isLeapYear(1996);
public class HomeView extends ViewImpl implements HomePresenter.MyView {
interface Binder extends UiBinder<Widget, HomeView> {
}
//First we declare our choices in an enum
private enum Choices {
VADER("Darth Vader"),
LUKE("Luke Skywalker"),
LEIA("Princess Leia"),
BOBA_FETT("Boba Fett");
<!-- Don't forget the xmlns:chzn="urn:import:com.arcbees.chosen.client.gwt" -->
<chzn:MultipleChosenValueListBox ui:field="multipleValues" width="500px"/>
<chzn:ChosenListBox placeholderText="Choose your character...">
<g:item value=""></g:item>
<g:item value="Darth Vader">Darth Vader</g:item>
<g:item value="Luke Skywalker">Luke Skywalker</g:item>
<g:item value="Princess Leia">Princess Leia</g:item>
<g:item value="Boba Fett">Boba Fett</g:item>
</chzn:ChosenListBox>
<inherits name="com.google.common.collect.Collect"/>
<inherits name="com.google.gwt.query.Query"/>
<inherits name='com.arcbees.chosen.Chosen'/>
@olafleur
olafleur / pom.xml
Last active October 1, 2015 17:28
Dependencies
<gwtquery.version>1.4.3</gwtquery.version>
<guava-gwt.version>18.0</guava-gwt>
<gwtchosen.version>3.0</gwtchosen.version>
...
<dependency>
<groupId>com.googlecode.gwtquery</groupId>
<artifactId>gwtquery</artifactId>
<version>{gwtquery.version}</version>
@olafleur
olafleur / gist:f0a1690d550d7a40d503
Created September 17, 2014 03:12
Récupérer du contenu JSON d'une API REST
/*
Exemple de données reçues : (http://api.openweathermap.org/data/2.5/weather?q=L%C3%A9vis)
{
"coord":{"lon":-71.18,"lat":46.8},
"sys":{"type":1,"id":3871,"message":0.1173,"country":"Canada","sunrise":1410949553,"sunset":1410994323},
"weather":[{"id":801,"main":"Clouds","description":"few clouds","icon":"02n"}],
"base":"cmc stations",
"main":{"temp":282.16,"pressure":1011,"humidity":93,"temp_min":277.15,"temp_max":285.37},
"wind":{"speed":3.12,"deg":267.501},
"clouds":{"all":20},
@olafleur
olafleur / googleappenginecodelab.md
Last active August 29, 2015 14:01
Google App Engine CodeLab