Skip to content

Instantly share code, notes, and snippets.

Avatar

Christian Edward Gruber cgruber

View GitHub Profile
@cgruber
cgruber / AbstractPump$InjectAdapter
Last active Dec 10, 2015
Generated Classes for Dagger for comparison between old and new generation code.
View AbstractPump$InjectAdapter
//Code generated by dagger-compiler.
package coffee;
import dagger.internal.Binding;
import dagger.internal.Linker;
import dagger.MembersInjector;
import java.util.Set;
/**
View gist:cb3b053f4a2a0f9d9c6f
class Foo {
@AutoFactory
Foo(@Provider bar, String aString) {...}
}
@Generated(...AutoFactoryProcessor.class)
final class FooFactory {
...
public Foo create(String s) { ... }
}
@cgruber
cgruber / gist:5b3a4f10d88d04154e89
Last active Aug 29, 2015
Component exporting to dependent components
View gist:5b3a4f10d88d04154e89
interface SingletonsToExport {
SomeService someService();
OkHttpClient httpClient();
GooglePlayThingamabob playThingy();
}
@Singleton
@Component(...)
interface ApplicationComponent extends SingletonsToExport {
void inject(MyApplication app);
@cgruber
cgruber / JUNG_PROJECT_CLA.md
Last active Feb 5, 2016
The JUNG Project Individual CLA
View JUNG_PROJECT_CLA.md

JUNG Individual Contributor License Agreement

In order to clarify the intellectual property license granted with Contributions from any person or entity, the JUNG Project must have a Contributor License Agreement ("CLA") on file that has been signed by each Contributor, indicating agreement to the license terms of the JUNG Project. This license is for your protection as a Contributor as well as the protection of the JUNG Project and its owners; it does not change your rights to use your own Contributions for any other purpose.

You accept and agree to the following terms and conditions for Your present and future

@cgruber
cgruber / pom.xml
Last active Sep 11, 2017
Example enforcer rule to exclude commons-collections 3.2.1 from the build
View pom.xml
<!-- Avoid the M.A.D. Gadget vulnerability in certain apache commons-collections versions -->
<project>
<!-- ... -->
<build>
<plugins>
<plugin>
<artifactId>maven-enforcer-plugin</artifactId>
<executions>
<execution>
<goals><goal>enforce</goal></goals>
View keybase.md

Keybase proof

I hereby claim:

  • I am cgruber on github.
  • I am geekinasuit (https://keybase.io/geekinasuit) on keybase.
  • I have a public key ASBhmg2ZlIRVTG6CyDjfgLgX15_AAANhg4mnzF9Clyd6LAo

To claim this, I am signing this object:

@cgruber
cgruber / cgruber-iCLA.md
Last active Sep 6, 2019
Individual Contributor License Agreement for Christian Gruber's personal projects.
View cgruber-iCLA.md

Christian Gruber's Individual Contributor License Agreement

In order to clarify the intellectual property license granted with Contributions from any person or entity, Christian Gruber (Christian) must have a Contributor License Agreement ("CLA") on file that has been signed by each Contributor, indicating agreement to the license terms below. This license is for your protection as a Contributor as well as the protection of Christian; it does not change your rights to use your own Contributions for any other purpose.

You accept and agree to the following terms and conditions for Your present and

@cgruber
cgruber / jackson_yaml_configuration.kt
Last active Sep 16, 2020
Exposing DumperOptions in Jackson's YAML handling.
View jackson_yaml_configuration.kt
// See article for context: http://www.geekinasuit.com/2020/09/jackson-yaml-and-kotlin-data-classes.html
// Licensed under the MIT license described here: https://choosealicense.com/licenses/mit/
// Copyright (c) Square, Inc.
val jacksonMapper = YAMLMapper(MyYAMLFactory()).apply {
registerModule(KotlinModule())
setSerializationInclusion(JsonInclude.Include.NON_EMPTY)
}
)
@cgruber
cgruber / bazel_test_env.sh
Last active Sep 25, 2020
Bazel test environment variables (sanitized)
View bazel_test_env.sh
# A quick list of bazel test environment variables (as of Bazel 3.5.0)
# http://tiny.cc/bazel_test_env
#
# Some cautions and notes:
# - not a real shell file - just set it as .sh because they're written as shell env vars here.
# - This comes from java_test and kt_jvm_test. It might not reflect go_test, etc.
# - Your username is "yourusername" here.
# - the real hash of your project in bazel is replaced by deadbeefdeadbeefdeadbeefdeadbeef
# - local target/binary/package paths have been replaced by "your/package" and
# "your/package/SomeTest" as appropriate