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(const MyApp()); | |
| } | |
| class MyApp extends StatelessWidget { | |
| const MyApp({super.key}); | |
| @override |
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 'dart:math' as math; | |
| void main() => runApp(MyApp()); | |
| class MyApp extends StatelessWidget { | |
| @override | |
| Widget build(BuildContext context) { | |
| return MaterialApp( | |
| home: Scaffold( |
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:riverpod/riverpod.dart'; | |
| final counter = StateProvider((_) => 0); | |
| final counter2 = StateProvider((ref) => ref.watch(counter)); | |
| Future<void> main() async { | |
| final container = ProviderContainer(); | |
| // counter2 を listen | |
| container.read(counter2.notifier).stream.listen( |
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
| # | |
| # ghq-fzf.zsh | |
| # | |
| # ABOUT: | |
| # `cd` to `ghq` repositories directory on `zsh` | |
| # You can launch this function with `Ctrl-g` | |
| # | |
| # INSTALLATION: | |
| # Requires `zsh` and `fzf` | |
| # Download this file then, append `source path/to/fzf-ghq.zsh` to your `~/.zshrc` |
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
| // Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file | |
| // for details. 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 |
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
| // Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file | |
| // for details. 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 |
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
| void main() async { | |
| final a = Future.delayed(const Duration(seconds: 1)); | |
| final b = Future.error(2); | |
| try { | |
| await Future.wait([a, b]); // Warn uncatched error if remove this line. | |
| await a; | |
| await b; | |
| } catch (e) { | |
| print(e); | |
| } |
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
| var toMarkdown = require('html2markdown'); | |
| var fm = require('front-matter'); | |
| var fs = require('fs'); | |
| var glob = require('glob'); | |
| var path = require('path'); | |
| var mkdirp = require('mkdirp'); | |
| glob.sync('./*.md').forEach(function(file) { | |
| fs.readFile(file, 'utf8', function(err, data) { | |
| var c = fm(data); |