Skip to content

Instantly share code, notes, and snippets.

@Provides
Noodile provideNoodile(@Named("fooClaster") Claster foo, @Named("barClaster") Claster bar) {
...
}
// need to duplicate this function for fooClaster and barClaster? or can i specify that a fooClaster uses this with @Named("foo") Jeebus?
@Provides
Claster provideJeebus(Jeebus j) {
Claster c = new Claster(j);
// do a bunch of setup logic that doesn't change between Jeebi
Apache Maven 3.2.2 (45f7c06d68e745d05611f7fd14efb6594181933e; 2014-06-17T06:51:42-07:00)
Maven home: /usr/local/Cellar/maven/3.2.2/libexec
Java version: 1.6.0_65, vendor: Apple Inc.
Java home: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
Default locale: en_US, platform encoding: MacRoman
OS name: "mac os x", version: "10.9.4", arch: "x86_64", family: "mac"
[INFO] Error stacktraces are turned on.
[DEBUG] Reading global settings from /usr/local/Cellar/maven/3.2.2/libexec/conf/settings.xml
[DEBUG] Reading user settings from /Users/sarbs/.m2/settings.xml
[DEBUG] Using local repository at /Users/sarbs/.m2/repository
public class Foo {
private Handler mHandler;
private Runnable mJob;
private BroadcastReceiver mBR1 = new BroadcastReceiver() {
public Object mUnreachable;
@Override
public void onReceive(Intent i) {
Object goesAway = new Object();
@tophyr
tophyr / master-AsyncChainLoaderHelper.java
Last active August 29, 2015 14:00
Git merge troubles
public Result<T> getSync() {
T ret;
try {
try {
try {
ret = m_Loader.doLoad();
return Result.success(ret);
} catch (NoResultException e) {
if (m_Loader.getChainLoader() == null)
throw new UnsupportedOperationException("If there is no chained loader, doLoad() must return a result.");
package in.curtech.android.common;
import android.content.BroadcastReceiver;
/**
* Extension of {@code BroadcastReceiver} meant to be used in conjunction with
* {@link OrderEnabledLocalBroadcastManager}
*
* @author Kiran Rao
*/
@tophyr
tophyr / dscput
Created April 23, 2014 00:49
dsc
#!/bin/bash
dsc $1 $2 $($(dirname $0)/dsc_local) $3 put json "$4"
public void DoStuff()
{
SendData("https://blah", "blah").ContinueWith(task => DoEvenMoreStuff());
}
private async Task SendData(string url, string data)
{
WebRequest req = WebRequest.Create(url);
using (StreamWriter writer = new StreamWriter(await req.GetRequestStreamAsync())) // why await here?
{
~/Projects/okhttp $/usr/libexec/java_home
/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home
~/Projects/okhttp $JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home mvn --version
Apache Maven 3.1.1 (0728685237757ffbf44136acec0402957f723d9a; 2013-09-17 08:22:22-0700)
Maven home: /usr/local/Cellar/maven/3.1.1/libexec
Java version: 1.7.0_51, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.9", arch: "x86_64", family: "mac"
~/Projects/okhttp $JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home mvn clean verify
~/Projects/okhttp $java -version
java version "1.7.0_51"
Java(TM) SE Runtime Environment (build 1.7.0_51-b13)
Java HotSpot(TM) 64-Bit Server VM (build 24.51-b03, mixed mode)
~/Projects/okhttp $mvn --version
Apache Maven 3.1.1 (0728685237757ffbf44136acec0402957f723d9a; 2013-09-17 08:22:22-0700)
Maven home: /usr/local/Cellar/maven/3.1.1/libexec
Java version: 1.6.0_65, vendor: Apple Inc.
Java home: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
Default locale: en_US, platform encoding: MacRoman
parallels@vulcan:~$ cd Projects/okhttp/
parallels@vulcan:~/Projects/okhttp$ ls
benchmarks checkstyle.xml CONTRIBUTING.md LICENSE.txt okcurl okhttp-apache pom.xml samples
CHANGELOG.md concurrency.md deploy_website.sh mockwebserver okhttp okhttp-protocols README.md website
parallels@vulcan:~/Projects/okhttp$ mvn clean verify
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.squareup.okhttp:benchmarks:jar:2.0.0-SNAPSHOT
[WARNING] 'build.plugins.plugin.version' for org.codehaus.mojo:exec-maven-plugin is missing. @ line 68, column 13
[WARNING]