Skip to content

Instantly share code, notes, and snippets.

View GuiSim's full-sized avatar
🐼

Guillaume Simard GuiSim

🐼
  • Tola
  • Québec
View GitHub Profile
@GuiSim
GuiSim / Traktor Kontrol S4 MIDI input port 0.djayMidiMapping
Created June 12, 2017 07:51
Traktor S4 configuration file for DJay Pro
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>controls</key>
<array>
<dict>
<key>controlType</key>
<string>button</string>
<key>keyPath</key>
...
<servers>
...
<server>
<id>ossrh</id>
<username>YOUR_OSSRH_JIRA_USER</username>
<password>YOUR_OSSRH_JIRA_PASSWORD</password>
</server>
...
<profiles>
...
<build>
<plugins>
...
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.0.1</version>
<executions>
<execution>
...
<name>${project.groupId}:${project.artifactId}</name>
<description>Your artifact description</description>
<url>Link to your page or GitHub</url>
<licenses>
<license>
<name>MIT License</name>
<url>http://www.opensource.org/licenses/mit-license.php</url>
</license>
</licenses>
// Property with no value
Property 'service.endpoint' has a no value.
// Property with no @Named annotation
Property identified by key 'Key[type=io.pleo.prop.core.Prop<java.lang.String>, annotation=[none]]' has no @Named annotation.
// When a valid value was changed to an invalid one
Failed to parse property 'service.readTimeout' with value 'potato'. Keeping last valid value of 'PT1S'.
public static class MyServiceClass {
private AwsClient awsClient;
public MyServiceClass(@Named("aws.key") Prop<String> awsKey) {
this.awsClient = new AwsClient(awsKey.get());
awsKey.addCallback(() -> this.awsClient = new AwsClient(awsKey.get()));
}
}
public static class MyServiceClass {
private AwsClient awsClient;
public MyServiceClass(@Named("aws.key") Prop<String> awsKey)
{
this.awsClient = new AwsClient(awsKey.get());
}
}
List<Module> modules = ... // Get your Guice modules
AutoPropModule autoPropModule = new AutoPropModule("io.pleo", // Package prefix
modules, // Modules to scan
new ArchaiusPropFactory(),
new JacksonParserFactory());
modules.add(autoPropModule);
Injector injector = Guice.createInjector(modules);
public class MyServiceClient {
@Inject
public MyServiceClient(@Named("service.endpoint") Prop<String> endpoint,
@Named("service.readTimeout") Prop<Duration> readTimeout,
HttpClient httpClient) {
this.endpoint = endpoint;
this.readTimeout = readTimeout;
this.httpClient = httpClient;
}

Keybase proof

I hereby claim:

  • I am guisim on github.
  • I am guisim (https://keybase.io/guisim) on keybase.
  • I have a public key whose fingerprint is DD4C B4C6 9502 C419 FAD2 E477 B9D0 A623 7AF2 4BEB

To claim this, I am signing this object: