This file contains 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
<?php | |
function removerAcentos( $string ) { | |
$mapaAcentosHex = array( | |
'a'=> '/[\xE0-\xE6]/', | |
'A'=> '/[\xE0-\xE6]/', | |
'e'=> '/[\xE8-\xEB]/', | |
'E'=> '/[\xE8-\xEB]/', | |
'i'=> '/[\xEC-\xEF]/', |
This file contains 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
<?php | |
//After executing json_encode or json_decode call this function | |
function jsonError(){ | |
$errors = ""; | |
switch (json_last_error()) { | |
case JSON_ERROR_NONE: | |
$errors .= ' - No errors'; | |
break; |
This file contains 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
Show hidden characters
[ | |
{ "keys": ["f1"], "command": "goto_documentation" }, | |
{ "keys": ["f6"], "command": "expand_fqcn" }, | |
{ "keys": ["shift+f6"], "command": "expand_fqcn", "args": {"leading_separator": true} }, | |
{ "keys": ["f5"], "command": "find_use" }, | |
{ "keys": ["f4"], "command": "import_namespace" }, | |
{ "keys": ["shift+f12"], "command": "goto_definition_scope" }, | |
] |
This file contains 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 br.com.disapps.sockettest.websocket; | |
import android.arch.lifecycle.LiveData; | |
import android.arch.lifecycle.MutableLiveData; | |
import android.util.Log; | |
import com.google.gson.Gson; | |
import com.google.gson.JsonElement; | |
import com.google.gson.JsonParser; | |
import com.jakewharton.rxrelay2.PublishRelay; | |
import br.com.disapps.sockettest.Message; |
This file contains 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 br.com.diefferson; | |
import java.io.BufferedReader; | |
import java.io.FileReader; | |
import java.io.IOException; | |
import java.lang.annotation.ElementType; | |
import java.lang.annotation.Retention; | |
import java.lang.annotation.RetentionPolicy; | |
import java.lang.annotation.Target; | |
import java.lang.reflect.Field; |
This file contains 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.eventifly.core.data.prefs; | |
import android.content.Context; | |
import android.content.SharedPreferences; | |
import com.eventifly.core.data.model.Profile; | |
import com.eventifly.core.data.model.Settings; | |
import com.eventifly.core.data.model.Tag; | |
import com.eventifly.core.data.ws.RestClient; | |
import com.eventifly.core.data.ws.response.AuthLoginResponse; |
This file contains 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 okhttp3.Interceptor | |
import okhttp3.OkHttpClient | |
import okhttp3.Response | |
import retrofit2.Retrofit | |
import retrofit2.converter.gson.GsonConverterFactory | |
import javax.net.ssl.HostnameVerifier | |
object DownloadClient{ |
This file contains 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
/** | |
* Abstract class for a UseCase that returns an instance of a [T]. | |
*/ | |
abstract class UseCase<T, in Params> internal constructor( | |
private val postExecutionContext:CoroutineContext, | |
private val logException: LogException) : CoroutineScope { | |
private val executionJob: Job by lazy { Job() } | |
override val coroutineContext: CoroutineContext by lazy { |
This file contains 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
// compile "org.jetbrains.kotlinx:kotlinx-coroutines-android:0.16" | |
// compile "android.arch.lifecycle:runtime:1.0.0-alpha3" | |
// compile "android.arch.lifecycle:extensions:1.0.0-alpha3" | |
// kapt "android.arch.lifecycle:compiler:1.0.0-alpha3" | |
class AsyncLiveData<T> private constructor(private val exec: suspend () -> T) : LiveData<T>() { | |
private var observer: Observer<T>? = null | |
private var job: Job? = null |
This file contains 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 br.com.futmundi.app.util | |
import br.com.myapp.data.repository.exception.KnownError | |
import br.com.myapp.data.repository.exception.KnownException | |
import kotlinx.coroutines.CoroutineScope | |
import kotlinx.coroutines.android.Main | |
import kotlinx.coroutines.launch | |
import kotlinx.coroutines.withContext | |
fun <T> CoroutineScope.safeAsync(action: suspend () -> T, |
OlderNewer