Skip to content

Instantly share code, notes, and snippets.

Guilherme de Carvalho Carneiro guilhermecarvalhocarneiro

Block or report user

Report or block guilhermecarvalhocarneiro

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:477b4ec31cda9850283f618150a5682d
class FeedAdapter(private val context: Context,
private val posts: List<FeedDomain>):
RecyclerView.Adapter<FeedAdapter.ViewHolder>(), CoroutineScope {
private lateinit var job: Job
private var downloadJob: Job? = null
override val coroutineContext: CoroutineContext
get() = Dispatchers.Main + job
View gist:1607c0789af5a00d5f649ba869555998
{
"pk": 13,
"uuid": "984c0959-0b09-4d59-85c2-b9161bc41627",
...
"cellphones": [
{
"id": 3,
"country_code": "+55",
"state_code": "63",
"number": "999999999",
View gist:8b717446e2ede7403589556f4067f09c
[
{
"id": 1,
"enabled": true,
"deleted": false,
"created_on": "2019-10-02T10:52:44.743717-03:00",
"updated_on": "2019-10-02T10:52:44.743781-03:00",
"nome": "voqREPcHnmJwNKhdnyNKYLTbvdjyOTYigJYgWrpgpGHiSlLiUCKwXYVqKNMVZMArjfqFXpAdebquJhEvGvUaFYxgmmUEEkbzYPxe"
},
{
View OkHttp
val url = "${this.uri}?format=json"
val client = OkHttpClient.Builder()
.readTimeout(Config.readTimeOutAPIDefault, TimeUnit.SECONDS)
.connectTimeout(Config.connectTimeOutAPIDefault, TimeUnit.SECONDS)
.build()
val request = Request.Builder().url(url).build()
client.newCall(request).execute().use { response ->
View Dio.dart
import 'dart:convert';
import 'dart:io';
import 'package:dio/dio.dart';
import 'package:estudos/utils/config.dart';
class HttpRequestDio {
Dio _dio;
String _url;
String _errorMessage =
"Ocorreu um erro ao executar a consulta, favor tentar novamente.";
View Gradle
buildscript {
ext.kotlin_version = '1.3.41'
repositories {
google()
jcenter()
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.0'
View Gradle
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}
def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
View gist:8638b4d7d2b081a063a8c5f3a3f04127
class DataCache {
static final DataCache _dataCache = new DataCache.internal();
factory DataCache() {
return _dataCache;
}
DataCache.internal();
}
View android_app_build_gradel
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}
def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
View android_build_gradle
buildscript {
ext.kotlin_version = '1.2.71'
repositories {
google()
jcenter()
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.0'
You can’t perform that action at this time.