Skip to content

Instantly share code, notes, and snippets.

@chalin
chalin / index.html
Last active October 3, 2019 21:47 — forked from Sfshaza/index.html
portmanteaux
<!DOCTYPE html>
<!--
Copyright (c) 2012, 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.
-->
<html>
@chalin
chalin / index.html
Last active September 28, 2019 11:36 — forked from Sfshaza/index.html
portmanteaux_simple
<!DOCTYPE html>
<!--
Copyright (c) 2012, 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.
-->
<html>
@chalin
chalin / index.html
Last active May 18, 2021 05:57 — forked from Sfshaza/index.html
its_all_about_you
<!DOCTYPE html>
<!--
Copyright (c) 2012, 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.
-->
@chalin
chalin / main.dart
Last active April 23, 2018 15:14 — forked from Sfshaza/main.dart
streams/throw_error
// Copyright (c) 2015, 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 'dart:async';
Future<int> sumStream(Stream<int> stream) async {
var sum = 0;
try {
@chalin
chalin / main.dart
Last active August 14, 2018 00:10 — forked from Sfshaza/main.dart
futures/futures-api
// Copyright (c) 2013, 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 'dart:async';
printDailyNewsDigest() {
final future = gatherNewsReports();
future.then((news) => print(news));
}
@chalin
chalin / main.dart
Last active August 14, 2018 00:10 — forked from Sfshaza/main.dart
futures/async-await
// Copyright (c) 2013, 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 'dart:async';
printDailyNewsDigest() async {
String news = await gatherNewsReports();
print(news);
}