- Selecting unknown users
- Selecting known users
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
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
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
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 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
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
<configuration debug="true"> | |
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> | |
<layout class="ch.qos.logback.classic.PatternLayout"> | |
<Pattern>%d{HH:mm:ss.SSS,Europe/Sofia} %-5level %logger{35} - %msg%n</Pattern> | |
</layout> | |
</appender> | |
<logger name="com.clouway" level="DEBUG"> |
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 main | |
import ( | |
"github.com/codegangsta/martini" | |
"github.com/gorilla/websocket" | |
"log" | |
"net" | |
"net/http" | |
"sync" | |
) |