This file contains 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
@Provides | |
ThirdPartyFoo provideThirdPartyFoo() { | |
return new ThirdPartyFoo(); | |
} |
This file contains 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
@Provides | |
@Singleton | |
Foo provideFoo(FooImpl fooImpl) | |
return fooImpl; | |
} |
This file contains 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
// module is a test module that overrides production settings | |
Guice.createInjector(module).injectMembers(target); |
This file contains 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
class MyTest { | |
@Module(injects = MyTest.class, includes = TestModule.class) | |
static class MyTestModule { | |
} | |
} |
This file contains 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
type Paste struct { | |
// Generated | |
Id string `datastore:"id"` | |
Timestamp time.Time `datastore:"timestamp"` | |
// Required | |
Content string `datastore:"content,noindex"` | |
Email string `datastore:"email"` | |
// Optional/Best-effort | |
Title string `datastore:"title"` | |
Language string `datastore:"language"` |
This file contains 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
func GenerateRandomString(length int) string { | |
const chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcdefghijklmnopqrstuvwxyz" | |
rand.Seed(time.Now().Unix()) | |
str := make([]string, length) | |
for i := 0; i < length; i++ { | |
index := rand.Intn(len(chars)) | |
str[i] = chars[index : index+1] | |
} | |
return strings.Join(str, "") | |
} |
This file contains 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
body, pre, code { | |
background-color: #002B36; | |
color: #839496; | |
font-family: "Source Code Pro", monospace; | |
} | |
.form-control { | |
background-color: #073642; | |
color: #eee8d5; | |
font-family: "Source Code Pro", monospace; |
This file contains 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
<assembly | |
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd"> | |
<id>capsule-full</id> | |
<formats> | |
<format>jar</format> | |
</formats> | |
<baseDirectory>/</baseDirectory> | |
<dependencySets> |
This file contains 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
<dependency> | |
<groupId>co.paralleluniverse</groupId> | |
<artifactId>capsule</artifactId> | |
<version>0.7.0</version> | |
<scope>compile</scope> | |
<optional>true</optional> | |
</dependency> | |
... |
This file contains 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
server { | |
listen 80; | |
server_name example.com www.example.com; | |
root /path/to/example.com; | |
index index.php index.html index.htm; | |
location / { | |
try_files $uri $uri/ /index.php?q=$uri&$args; | |
} |