Skip to content

Instantly share code, notes, and snippets.

View guilherme-v's full-sized avatar

Guilherme Silva guilherme-v

View GitHub Profile
@guilherme-v
guilherme-v / RetryWithExponentialBackOff
Created January 6, 2022 15:21 — forked from wotomas/RetryWithExponentialBackOff.java
Rxjava Retry With Exponential Backoff
import java.io.IOException;
import java.util.concurrent.TimeUnit;
import rx.Observable;
import rx.functions.Func1;
import rx.functions.Func2;
import rx.schedulers.Schedulers;
/**
* Created by jimmy on 30/05/2017.
@guilherme-v
guilherme-v / GenerateNewAndroidKey
Created September 27, 2021 18:59
Generate New Android Key + Files
#!/bin/bash
# This Scrip generates a common ANDROID DEV Key to be used by all develovers
# instead of using the one created by Android Studio.
# This will help when integrating with services like Firebase or when sending
# a dev apk to the team.
# ------------------------------------------------------------------------------------------------
# Example of configuration: https://coderwall.com/p/r09hoq/android-generate-release-debug-keystores
@guilherme-v
guilherme-v / MatrixCompose.kt
Created September 16, 2021 23:11 — forked from apkelly/MatrixCompose.kt
Matrix Animation
import android.graphics.Typeface
import androidx.compose.foundation.Canvas
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.BoxWithConstraints
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.RowScope
import androidx.compose.foundation.layout.fillMaxHeight
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.runtime.Composable
@guilherme-v
guilherme-v / main.dart
Last active April 6, 2021 14:26
CounterMagnification
import 'dart:math';
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: CounterMagnification(),
@guilherme-v
guilherme-v / restart android emulator in command line
Created September 14, 2020 00:11 — forked from russell-shizhen/restart android emulator in command line
restart android emulator in command line on MacOS
#!/bin/bash -ex
# NOTE: ANDROID_HOME must be configured as an environment variable.
# Kill all the existing adb servers and start over a new adb server.
function restart_adb_server() {
echo "********************* Restarting adb ... *********************"
adb kill-server
sleep 2
adb start-server
sleep 2
import 'package:flutter/material.dart';
GlobalKey _keyMyApp = GlobalKey();
GlobalKey _keyMaterialApp = GlobalKey();
GlobalKey _keyHomePage = GlobalKey();
GlobalKey _keyScaffold = GlobalKey();
GlobalKey _keyAppbar = GlobalKey();
GlobalKey _keyCenter = GlobalKey();
GlobalKey _keyFAB = GlobalKey();
GlobalKey _keyText = GlobalKey();
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
visualDensity: VisualDensity.adaptivePlatformDensity,
),
home: MyHomePage(title: 'Flutter Demo Home Page'),
import 'dart:async';
import 'dart:convert';
import 'dart:io';
import 'package:ansicolor/ansicolor.dart';
import 'package:flutter/material.dart';
import 'package:http/http.dart' as http;
void main() {
runZoned(
import 'dart:convert';
import 'dart:io';
Future<void> main() async {
// We'll create a local server that will be listening for requests at port 8082
final server = await HttpServer.bind('127.0.0.1', 8082);
await for (HttpRequest req in server) {
// All requests will be logged into a local 'logs.tmp' file
final File file = File('./logs.tmp');
void main() async {
// Do not include it when building for production
Stetho.initialize();
// Run the app
runApp(MyApp());
}