Skip to content

Instantly share code, notes, and snippets.

View kwalrath's full-sized avatar

Kathy Walrath kwalrath

View GitHub Profile
@kwalrath
kwalrath / main.dart
Last active January 10, 2020 01:02 — forked from miquelbeltran/main.dart
dart where
main() {
var evenNumbers = [1, -2, 3, 42].where((number) => number.isEven);
for (var number in evenNumbers) {
print('$number is even.');
}
if (evenNumbers.any((number) => number.isNegative)) {
print('evenNumbers contains negative numbers.');
}
@kwalrath
kwalrath / main.dart
Created December 10, 2019 22:23 — forked from miquelbeltran/main.dart
takewhile
main() {
var numbers = [1, 3, -2, 0, 4, 5];
var numbersUntilZero = numbers.takeWhile((number) => number != 0);
print('Numbers until 0: $numbersUntilZero');
var numbersAfterZero = numbers.skipWhile((number) => number != 0);
print('Numbers after 0: $numbersAfterZero');
}
@kwalrath
kwalrath / hint.text
Last active January 13, 2020 21:01 — forked from miquelbeltran/hint.text
filtering
Use the `where` method to implement the filters.
main() {
var numbersByTwo = [1, -2, 3, 42].map((number) => number * 2);
print('Numbers: $numbersByTwo.');
}
@kwalrath
kwalrath / hint.txt
Last active January 13, 2020 21:08 — forked from miquelbeltran/hint.txt
Use map to create a String with the user.name and the user.age
@kwalrath
kwalrath / hint.txt
Last active January 13, 2020 21:10 — forked from miquelbeltran/hint.txt
Use the methods `map()`, `any()`, and `where()` to solve the exercise.
@kwalrath
kwalrath / hint.txt
Last active November 23, 2019 01:30 — forked from redbrogdon/hint.txt
DartPad Cheetsheet Codelab - 10 - Exceptions
This exercise looks tricky, but it's really one big `try` statement.
Just call `untrustworthy` inside the `try`, and then use `on`, `catch`,
and `finally` to catch exceptions and call methods on the logger.
@kwalrath
kwalrath / index.html
Created October 3, 2019 21:51 — forked from dhanushuUzumaki/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>
@kwalrath
kwalrath / index.html
Created October 2, 2019 20:43 — forked from smolck/index.html
todo
<!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.
-->
@kwalrath
kwalrath / index.html
Created September 30, 2019 18:08 — forked from Arun8295/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>