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
it('Profile endpoint 500. 500', async () => { | |
after(() => { | |
nock.cleanAll(); | |
}); | |
const agent = request.agent(app); | |
nock('https://oauth2.googleapis.com') | |
.post('/token') | |
.reply(200, { access_token: 'access_token' }) |
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.android.build.gradle.AppExtension | |
import org.gradle.api.Plugin | |
import org.gradle.api.Project | |
import org.gradle.api.tasks.compile.JavaCompile | |
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile | |
internal class MyPlugin : Plugin<Project> { | |
override fun apply(project: Project) { | |
project.afterEvaluate { | |
val androidExtension = project.extensions.getByType(AppExtension::class.java) |
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 com.guliash.dagger; | |
import dagger.Component; | |
import dagger.Subcomponent; | |
import javax.inject.Inject; | |
import javax.inject.Scope; | |
import javax.inject.Singleton; | |
public class Main { |
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 com.guliash.dagger; | |
import dagger.Component; | |
import javax.inject.Scope; | |
public class Main { | |
public static void main(String[] args) { | |
} |
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 com.guliash.dagger; | |
import dagger.Component; | |
import javax.inject.Scope; | |
public class Main { | |
public static void main(String[] args) { | |
} |
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
@Test | |
public void retryWhenWithoutComposingErrors() { | |
TestSubscriber subscriber = new TestSubscriber(); | |
Observable.just(1) | |
.retryWhen(errors -> Observable.never()) | |
.subscribe(subscriber); | |
subscriber.assertCompleted(); | |
} |
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
public class Main { | |
public static void main(String[] args) { | |
A a = new A(); | |
DaggerComponentA.create().inject(a); | |
B b = new B(); | |
a.injector.injectMembers(b); | |
System.out.println(b.string); |
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
@Component(modules = MyModule.class) | |
public interface ComponentA { | |
OkHttpClient a(); | |
SubcomponentB subcomponentB(); | |
SubcomponentC subcomponentC(); | |
} |
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
void onDestroy() { | |
if (getActivity.isFinishing()) { | |
//разрушаемся навсегда | |
} else if (getActivity.isChangingConfigurations()) { | |
//разрушаемся не навсегда | |
} else { | |
//разрушаемся навсегда | |
//кажется тут остаются варианты - удалили из бэк стека или вызвали remove у транзакции | |
//Или уничтожился процесс - тогда кеш презентеров все равно теряется | |
} |
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.io.OutputStream; | |
import java.io.FileOutputStream; | |
import java.io.IOException; | |
import java.io.FileInputStream; | |
import java.io.InputStream; | |
import java.io.PrintWriter; | |
import java.util.Arrays; | |
import java.util.InputMismatchException; | |
import java.io.IOException; | |
import java.util.TreeSet; |
NewerOlder