Skip to content

Instantly share code, notes, and snippets.

View joshuadeguzman's full-sized avatar
🏗️

Joshua de Guzman joshuadeguzman

🏗️
View GitHub Profile
@joshuadeguzman
joshuadeguzman / tictactoe_initial.dart
Last active March 20, 2023 03:34
A simple tic tac toe game for a Flutter workshop.
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
void main() {
String firstName = 'Joshua';
int age = 24;
print('Hey, I\'m $firstName and I\'m $age who loves writing software and building products. Welcome to my blog!');
}
@joshuadeguzman
joshuadeguzman / delete_workflows.sh
Created August 11, 2021 10:26
Github Actions Delete Workflows - sh delete_workflows.sh
#!/bin/bash
org=<org>
repo=<repo>
# Get workflow IDs with status "disabled_manually"
workflow_ids=($(gh api repos/$org/$repo/actions/workflows | jq '.workflows[] | select(.["state"] | contains("disabled_manually")) | .id'))
for workflow_id in "${workflow_ids[@]}"
do
@joshuadeguzman
joshuadeguzman / null_safety_overview.dart
Created July 31, 2021 05:26
Flutter Null Safety Overview
void main() {
// Example 1 - nullable is not allowed
// int count = null;
// print(count + 0);
// Example 2 - nullable is allowed, check if null
// int? count;
// if(count != null) {
// print(count + 0);
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Transition Demo',
home: FirstScreen(),
@joshuadeguzman
joshuadeguzman / flutter_web_actions.yml
Last active February 5, 2021 17:31
Flutter for Web Github Actions
name: Deploy Flutter Website
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
@joshuadeguzman
joshuadeguzman / deploy_github_actions_flutter.yml
Last active August 23, 2020 15:37
Deploy Flutter mobile apps to close beta distribution using Github Actions and Fastlane
name: Deploy Flutter Mobile Beta
on:
push:
# This is the branch where this work flow is triggered
branches:
- beta/*
# NOTE: The following jobs won't include Flutter-specific tasks such as running lint checks, tests.
# This is expected because the goal of this workflow is to "deploy" apps.
// Copyright 2020 Joshua de Guzman (https://joshuadeguzman.github.io). All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// TODO: Improve animation
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
// Copyright 2020 Joshua de Guzman (https://joshuadeguzman.github.io). All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
// Copyright 2020 Joshua de Guzman (https://joshuadeguzman.github.io). All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override