⌘T | go to file |
⌘⌃P | go to project |
⌘R | go to methods |
⌃G | go to line |
⌘KB | toggle side bar |
⌘⇧P | command prompt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package app | |
import ( | |
"fmt" | |
"time" | |
) | |
type SessionClock interface { | |
SessionDuration() time.Duration |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.google.inject.Provider; | |
import com.google.inject.util.Providers; | |
import org.jmock.Expectations; | |
import org.jmock.integration.junit4.JUnitRuleMockery; | |
import org.junit.Before; | |
import org.junit.Rule; | |
import org.junit.Test; | |
/** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Datastore datastore = new Datastore(); | |
datastore.findAll(Person.class,where("name").is("john"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Collection; | |
import java.util.Iterator; | |
/** | |
* A simple collection similar to Go's built-in notion of "slices". | |
* <p/> | |
* These are essentially bounded array objects with an immutable underlying store. Appending and | |
* inserting elements requires a new backing store to be allocated, but slicing out a contiguous | |
* subset just creates a new Slice that references the existing backing store. | |
* <p/> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Injector injector = Guice.createInjector(new AbstractModule() { | |
@Override | |
protected void configure() { | |
install(new SitebricksModule() { | |
@Override | |
protected void configureSitebricks() { | |
at("/r/customer").serve(CustomerService.class); | |
} | |
}); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface CreditCard { | |
void charge(Double amount); | |
} | |
interface CreditCardFactory { | |
CreditCard create(String customerId); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.clouway.calculator; | |
import org.jmock.Expectations; | |
import org.jmock.Mockery; | |
import org.testng.annotations.BeforeMethod; | |
import org.testng.annotations.Test; | |
import java.util.ArrayList; | |
import java.util.List; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public final class CalendarUtil { | |
@SuppressWarnings("unused") | |
CalendarUtil() { | |
} | |
public static Date january(int year, int day) { | |
return newDate(year, 1, day); | |
} |