Skip to content

Instantly share code, notes, and snippets.

View jeremyrempel's full-sized avatar

Jeremy Rempel jeremyrempel

View GitHub Profile
This file has been truncated, but you can view the full file.
======================
Proton: 1688329964 GE-Proton8-6
SteamGameId: 2108330
Command: ['/mnt/ssd/SteamLibrary/steamapps/common/F1 23/F1_23.exe']
Options: {'forcelgadd'}
depot: 0.20230509.49493
pressure-vessel: 0.20230509.0 scout
scripts: 0.20230509.0
sniper: 0.20230509.49493 sniper 0.20230509.49493
Kernel: Linux 6.4.3-arch1-1 #1 SMP PREEMPT_DYNAMIC Tue, 11 Jul 2023 05:13:39 +0000 x86_64
Computer Information:
Manufacturer: ASUSTeK COMPUTER INC.
Model: TUF GAMING Z690-PLUS WIFI D4
Form Factor: Desktop
No Touch Input Detected
Processor Information:
CPU Vendor: GenuineIntel
CPU Brand: 12th Gen Intel(R) Core(TM) i7-12700K
CPU Family: 0x6
CPU Model: 0x97
class MainRepo(
val provideOkHttp: () -> OkHttpClient,
val provideGson: () -> Gson
) {
fun fetchSomething() {
thread {
val okHttp = provideOkHttp()
val gson = provideGson()
}
}
@InstallIn(SingletonComponent::class)
@Module
object NetworkModule {
@Singleton
fun provideOkHttp(): OkHttpClient {
// verify not main thread
assert(Looper.getMainLooper() != Looper.myLooper())
return OkHttpClient.Builder().build()
@InstallIn(SingletonComponent::class)
@Module
object NetworkModule {
@Singleton
fun provideOkHttp(): OkHttpClient {
// verify not main thread
assert(Looper.getMainLooper() != Looper.myLooper())
return OkHttpClient.Builder().build()
class ApplicationInitializer @Inject constructor(
private val provideOkHttp: Provider<OkHttpClient>,
private val provideGson: Provider<Gson>
) {
fun initTracking() {
thread {
val okhttp = provideOkHttp.get()
val gson = provideGson.get()
package javax.inject;
public interface Provider<T> {
T get();
}
@InstallIn(SingletonComponent::class)
@Module
object NetworkModule {
@Singleton
fun provideOkHttp(): OkHttpClient {
return OkHttpClient.Builder().build()
}
@Singleton
class ApplicationInitializer @Inject constructor(
private val okHttpClient: OkHttpClient,
private val gson: Gson
) {
fun initTracking() {
thread {
// init async
}
}
class MyApplication : Application() {
lateinit var componentManager: ApplicationComponentManager
@Inject
lateinit var appInit: ApplicationInitializer
override fun onCreate() {
super.onCreate()
val component = DaggerApplicationComponentManager
.applicationModule(ApplicationModule(this))