Skip to content

Instantly share code, notes, and snippets.

View edujtm's full-sized avatar
🐢
Studying

Eduardo José Tomé de Macedo edujtm

🐢
Studying
View GitHub Profile
import { InjectionToken } from "@angular/core";
export const BUNDLE_URLS = new InjectionToken<string[]>('BUNDLE_URLS');
export interface BundleConfig {
bundleName: string;
bundleUrl: string;
loadOnStartup?: boolean;
}
@edujtm
edujtm / fix-pods-ssl.patch
Created April 4, 2022 15:01
Fix POD Files OpenSSL
---
doc/apps/cms.pod | 12 ++++++------
doc/apps/smime.pod | 12 ++++++------
doc/ssl/SSL_COMP_add_compression_method.pod | 4 ++--
doc/ssl/SSL_CTX_add_session.pod | 4 ++--
doc/ssl/SSL_CTX_load_verify_locations.pod | 4 ++--
doc/ssl/SSL_CTX_set_client_CA_list.pod | 4 ++--
doc/ssl/SSL_CTX_set_session_id_context.pod | 4 ++--
doc/ssl/SSL_CTX_set_ssl_version.pod | 4 ++--
doc/ssl/SSL_CTX_use_psk_identity_hint.pod | 2 +-
@edujtm
edujtm / dagger-subcomponent-example.kt
Created July 16, 2020 00:36
Gonna try implementing this later, might have errors
// The primary component has the dependency graph for the authentication classes
// and the login activity
@Component(modules = [
LoginModule::class,
AuthModule::class,
LoggedInComponent.InstallModule::class
])
interface ApplicationComponent {
val androidModule = module {
single<Auth> {
AuthManager(context = androidContext())
}
single<PlaylistHttpApi> {
// Needs the YouTube wrapper class
YoutubePlaylistApi()
}
@edujtm
edujtm / coroutines.kt
Created July 11, 2019 01:13
Reddit answer to threading question
import kotlinx.coroutines.*
// this will execute on background thread
suspend fun getDataFromDatabase() : Array<Int> = withContext(Dispatchers.IO) {
delay(1000)
println("Thread name inside context: ${Thread.currentThread().name}")
Array(10) { i -> i }
}
fun main(args : Array<String>) = runBlocking {
@edujtm
edujtm / javascript.json
Created March 24, 2019 21:39
Some VS Code snippets for React.
{
"Create Reducer Template": {
"prefix": "rreducer",
"body": [
"const INITIAL_STATE = {};",
"",
"export default (state = INITIAL_STATE, action) => {",
" switch (action.type) {",
" default:",
" return state;",
@edujtm
edujtm / BoundaryCallbackExample.kt
Last active March 6, 2019 00:09
The BoundaryCallback example from the Google talk on the Android Paging Library for future reference.
class ItemBoundaryCallback(private val service: MyApi,
private val database: MyDatabase) : PagedList.BoundaryCallback<Item> {
val isLoading = false
override fun onItemAtEndLoaded(itemAtEnd: Item) {
if (isLoading) return
isLoading = true
networkExecutor.execute {
val response = service
.getTopAfter(itemAtEnd.name, NETWORK_PAGE_SIZE)
@edujtm
edujtm / bulbasample.json
Last active February 26, 2019 01:04
A sample bulbasaur json from the pokeapi that I'm trying to parse using Gson
{
"id": 1,
"species": {
"name": "bulbasaur",
"someUrl": "https://pokeapi.co/api/v2/pokemon-species/bulbasaur/",
},
"height": 7,
"stats": [
{
"power": 10,