This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
void main() => runApp(MyApp()); | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
title: 'Flutter Tutorial by Tran Duc Tam', | |
home: MyPage(), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
import 'package:flutter/scheduler.dart'; | |
void main() => runApp(MyApp()); | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
title: 'Flutter Tutorial by Tran Duc Tam', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
void main() { | |
runApp(MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
final GlobalKey<ScaffoldState> _scaffoldKey = new GlobalKey<ScaffoldState>(); | |
@override | |
Widget build(BuildContext context) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
enum SelectedColor { | |
primaryColor, | |
secondaryColor, | |
} | |
extension SelectedColorExtension on SelectedColor { | |
String get name => describeEnum(this); | |
String displayTitle(index) { | |
print(index); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
import 'package:flutter/rendering.dart'; | |
void main() { | |
runApp(App()); | |
} | |
class App extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:async'; | |
main() { | |
Future(() => print('Line 1')); | |
scheduleMicrotask(() => print('Line 2')); | |
print('Line 3'); | |
print('Line 4'); | |
Future(() { | |
Future(() => print('Line 5')); | |
scheduleMicrotask(() => print('Line 6')); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Check the commit rank and list of commiter | |
$ git config --global alias.rank "shortlog -sn --no-merges" | |
# Shortern amend | |
$ git config --global alias.amend "commit --amend --no-edit" | |
# First 10 commit from all repository | |
$ git config --global alias.head "log -n 10 --all --graph --oneline --pretty=format:'%Cred%h%Cblue%d%Creset %s %C(bold yellow)<%an> %Cgreen[%cr]%Creset' --abbrev-commit" | |
# First 10 commit from all repository with detail information |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
import 'package:flutter/rendering.dart'; | |
void main() async => | |
runApp(MaterialApp(debugShowCheckedModeBanner: false, home: DemoScreen())); | |
class DemoScreen extends StatefulWidget { | |
@override | |
_DemoScreenState createState() => _DemoScreenState(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
void main() => runApp(MyApp()); | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
title: 'Flutter Tutorial by Tran Duc Tam', | |
home: ProcessPage(), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# w = (A^T)^+b = ((X^T)X)^+(X^T)y | |
import numpy as np | |
import matplotlib.pyplot as plt | |
x = [0, 1, 2] | |
X = np.array([x]).T | |
y = [0, 1, 2] | |
Y = np.array([y]).T |