Skip to content

Instantly share code, notes, and snippets.

View Gazer's full-sized avatar
💭
Coding

Ricardo Markiewicz Gazer

💭
Coding
View GitHub Profile
@Gazer
Gazer / scroll_expand_container.dart
Created June 5, 2020 14:13
Widget that expand to use full height and if needed can scroll
import 'package:flutter/material.dart';
class ScrollExpandContainer extends StatelessWidget {
final List<Widget> children;
const ScrollExpandContainer({Key key, this.children}) : super(key: key);
@override
Widget build(BuildContext context) {
return LayoutBuilder(
@Gazer
Gazer / .zshrc
Created July 23, 2020 18:48
Some zsh magic to detect and change the current Flutter version needed by an app in the current directory
# Add this to your ~/.zshrc AFTER the last export PATH="" that is currenttly defined
# Change these to reflect where do you have Flutter installed
export FLUTTER_STABLE_PATH="$HOME/dev/flutter/bin"
export FLUTTER_BETA_PATH="$HOME/dev/flutter-beta/bin"
export FLUTTER_MASTER_PATH="$HOME/dev/flutter-master/bin"
export BASE_PATH=$PATH
# Using 💙 until we can get a Flutter emoji :)
function useFlutterStable() {
@Gazer
Gazer / flaky.sh
Created January 16, 2023 15:08
Run UI test 50 times and record a video only when it fails. Handy to get evidence of Flaky tests.
#!/bin/bash
silent_background() {
{ 2>&3 "$@"& } 3>&2 2>-
disown &>/dev/null # Close STD{OUT,ERR} for silence if job has already completed
}
if [ -z $1 ] ; then
echo "Pass the class name with full package name and the test method name."
echo " "
@Gazer
Gazer / RecordAudioButton.kt
Created March 20, 2023 18:19
A Composable to record audio
// In the "Data Input"/"Event Output" paradigm, where would you put the Recorder logic?
//
// Leave your comment
//
@OptIn(ExperimentalPermissionsApi::class)
@Composable
fun RecordAudioButton(
onRecordedAudio: (File) -> Unit
) {
var isRecording by remember { mutableStateOf(false) }
@Gazer
Gazer / LazyStaggeredVGrid.swift
Last active August 21, 2023 14:09
SwitftUI Lazy Staggered Vertical Grid
//
// LazyStaggedVGrid.swift
//
// Created by Ricardo Markiewicz on 20/08/2023.
// Copyright © 2023 orgName. No rights reserved.
//
// https://twitter.com/Gazeria/status/1693356336019333382
//
import SwiftUI