Skip to content

Instantly share code, notes, and snippets.

View brsanthiago's full-sized avatar
💻
Mobile Developer

Bruno Santiago brsanthiago

💻
Mobile Developer
View GitHub Profile
@tasaquino
tasaquino / config.yml
Last active March 1, 2023 18:21
CircleCI configuration for Flutter with flavors and schemes - Configuration to send beta and generate artifacts (prod flavor)
version: 2.1
jobs:
ios_distribute_beta:
macos:
xcode: "10.3.0"
working_directory: ~/flutter-app
steps:
- add_ssh_keys:
fingerprints:
- "ab:ab:ab:ab:ab:ab:ab:ab:ab:ab:ab:ab:ab:ab:ab:ab"
@luciofm
luciofm / DebounceLiveData.kt
Created May 13, 2019 16:11
A Debouncing LiveData helper
class DebounceLiveData<Source>(
private val source: LiveData<Source>,
private val debounceMs: Long
) : LiveData<Source>(), CoroutineScope {
private val job = SupervisorJob()
override val coroutineContext: CoroutineContext
get() = Dispatchers.Main + job
private var debounceJob: Job? = null
private val observer = Observer<Source> { source ->
@kainiklas
kainiklas / .gitlab-ci.yml
Last active March 31, 2019 04:31
GitLab CI/CD configuration for Angular 6 + Firebase deployment
image: node:10
build:
stage: build
cache:
paths:
- node_modules/
script:
- npm install --quiet
- npm run build-prod
@a-h
a-h / 01-simple.test.js
Last active January 21, 2026 05:28
Testing styled Material UI components with Enzyme
import React from 'react';
import { shallow } from 'enzyme';
const Item = text => <p>Item {text}</p>;
const Composition = ({ showB }) => (
<p>
<Item text="A" />
{showB && <Item text="B" />}
</p>);
@swat-cat
swat-cat / gist:f167151c926ea33057d20333cf1c81cd
Last active March 3, 2022 14:38
Flutter extending and generics example
abstract class LoadingBaseState<T extends StatefulWidget> extends State<T> {
bool _isLoading = false;
bool _hasUser = false;
String _title = "";
@override
Widget build(BuildContext context) => new Scaffold(
appBar: new AppBar(
title: new Text(_title),
@joshstrange
joshstrange / gitlab-ci.yaml
Created October 14, 2017 22:54
Gitlab CI Config for Fastlane
stages:
- beta
variables:
LC_ALL: "en_US.UTF-8"
LANG: "en_US.UTF-8"
test_flight_build:
dependencies: []
stage: beta
@MensObscura
MensObscura / CustomBottomNavigationView.java
Last active July 15, 2019 12:42
BottomNavigationView with shifModeDisable and Badge
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.drawable.Drawable;
import android.support.design.internal.BottomNavigationItemView;
import android.support.design.internal.BottomNavigationMenuView;
import android.support.design.widget.BottomNavigationView;
import android.util.AttributeSet;
import android.util.Log;
import android.util.SparseArray;
import android.view.Gravity;
@fgilio
fgilio / axios-catch-error.js
Last active February 11, 2026 16:18
Catch request errors with Axios
/*
* Handling Errors using async/await
* Has to be used inside an async function
*/
try {
const response = await axios.get('https://your.site/api/v1/bla/ble/bli');
// Success 🎉
console.log(response);
} catch (error) {
// Error 😨
@marciogranzotto
marciogranzotto / VIPER Android Example.kt
Last active October 5, 2025 06:22
This is an example of Android development with VIPER in Kotlin
interface LoginContracts {
interface View {
fun showError(message: String)
}
interface Presenter {
fun onDestroy()
fun onLoginButtonPressed(username: String, password: String)
}
@demixdn
demixdn / ApiModule.java
Last active November 8, 2019 16:23
Retrofit with self signed https certificate
package <you_package>.data.api;
import android.content.Context;
import android.support.annotation.NonNull;
import com.google.gson.ExclusionStrategy;
import com.google.gson.FieldAttributes;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;