Skip to content

Instantly share code, notes, and snippets.

View tasaquino's full-sized avatar

Thais Aquino tasaquino

View GitHub Profile
@tasaquino
tasaquino / main.yml
Created May 21, 2023 10:48
Github action config to generate coverage report for a flutter app and upload to CodeCov
name: Parking App Workflow
on: [push]
jobs:
run:
runs-on: macos-latest
steps:
- uses: actions/checkout@master
- uses: subosito/flutter-action@v2
with:
flutter-version: '3.7.12' # same version I have on my machine 20/05/2023
@tasaquino
tasaquino / flutter_coverage_script.sh
Created May 21, 2023 10:47
Script to run flutter tests with code coverage and generate html report from lcov file
# allow the script to be executed chmod +x ./flutter_coverage_script.sh
echo '========== Executing tests...'
cd flutter test --coverage # `coverage/lcov.info` file
echo '========== Converting cov.info into html...'
genhtml coverage/lcov.info -o coverage/html # converts coverage report in html
echo '========== Opening html coverage report...'
open coverage/html/index.html
echo '========== Report is complete :)'
@tasaquino
tasaquino / work-with-multiple-github-accounts.md
Created April 24, 2023 13:35 — forked from rahularity/work-with-multiple-github-accounts.md
How To Work With Multiple Github Accounts on your PC

How To Work With Multiple Github Accounts on a single Machine

Let suppose I have two github accounts, https://github.com/rahul-office and https://github.com/rahul-personal. Now i want to setup my mac to easily talk to both the github accounts.

NOTE: This logic can be extended to more than two accounts also. :)

The setup can be done in 5 easy steps:

Steps:

  • Step 1 : Create SSH keys for all accounts
  • Step 2 : Add SSH keys to SSH Agent
@tasaquino
tasaquino / 1-react-native-simulator-and-device.md
Created November 17, 2022 14:05 — forked from almost/1-react-native-simulator-and-device.md
Test React Native on the simulator and on a device without editing the code each time!

In the default React Native app scaffolding you have to edit AppDelegate.m to change where it loads the code if you want to test on your device. I use the following snippet to detect if it's being compiled for Debug or Production and for the Simulator or a device. For Production it uses a copy of the code included in the bundle, for Debug on the simualtor it loads from a server on localhost and for Debug on a device it loads from a server on a given IP address.

NOTE: You need to edit YOUR-IP-HERE and change it to the IP to load the code from when in Debug mode on a device. You could use a service like ngrok to make this work from anywhere.

  NSURL *jsCodeLocation;

  // Loading JavaScript code
  #if DEBUG
    // For Debug build load from development server. Start the server from the repository root:
@tasaquino
tasaquino / podforceupdate.sh
Created July 14, 2022 09:41 — forked from mbinna/podforceupdate.sh
Clear CocoaPods cache, re-download and re-install all pods
#!/usr/bin/env bash
rm -rf "${HOME}/Library/Caches/CocoaPods"
rm -rf "`pwd`/Pods/"
pod update
@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"
@tasaquino
tasaquino / ScopingFunctionAlsoExternalThisExample.kt
Created December 4, 2018 17:04
ScopingFunctionAlsoExternalThisExample
error?.also {
Toast.makeText(this, it.message, Toast.LENGTH_LONG).show()
}
@tasaquino
tasaquino / ScopingFunctionApplyExternalThisExample.kt
Created December 4, 2018 16:56
ScopingFunctionApplyExternalThisExample
error?.apply {
Toast.makeText(this@AnyActivity, this.message, Toast.LENGTH_LONG).show()
}
@tasaquino
tasaquino / ScopingFunWithNullableExample.kt
Created November 30, 2018 15:26
Scoping Functions - example validating null object
val nullablePerson: Person? = attPair?.let {
mapToPerson(it)
}
@tasaquino
tasaquino / ScopingFunApplyExample2.kt
Created November 30, 2018 15:21
Scoping Functions - apply example 2
person.apply {
profession = "Iron Man"
nickname = "Tony"
}