Skip to content

Instantly share code, notes, and snippets.

@kasperpeulen
kasperpeulen / README.md
Created July 19, 2015 10:03
Example illustrating how to remove key/value pairs from a `Map`, where the key/value pair satisfies some test. Similar as the `List.removeWhere` method.

#dart:core example

Example illustrating how to remove key/value pairs from a Map, where the key/value pair satisfies some test. Similar as the List.removeWhere method.

Main library: dart:core
Main elements: Map Map.remove
Tags:

@kasperpeulen
kasperpeulen / README.md
Last active August 29, 2015 14:25
How to make a very simple public #chatbox using firebase.
@kasperpeulen
kasperpeulen / README.md
Last active July 20, 2016 00:01
Example of setInnerHtml configured so that all nodes are allowed.
@kasperpeulen
kasperpeulen / README.md
Last active August 29, 2015 14:25
Authenticate users with GitHub by writing only client-side code.Uses the OAuth2 Flow of firebase.
@kasperpeulen
kasperpeulen / README.md
Last active August 29, 2015 14:25
How to extract the used libraries in a dart file using the `analyzer` package.

#analyzer:analyzer example

How to extract the used libraries in a dart file using the analyzer package.

Main library: analyzer:analyzer
Main elements: parseCompilationUnit CompilationUnit.directives ImportDirective.uri
Gist: https://gist.github.com/kasperpeulen/d086078ed00429d5a335
Tags: #server

@kasperpeulen
kasperpeulen / README.md
Last active August 29, 2015 14:25
How to remove a key/value pair, satisfying some test, from a `Map`.
@kasperpeulen
kasperpeulen / README.md
Last active August 29, 2015 14:25
Format some `DateTime` objects to good looking strings.

#intl:intl example

Format some DateTime objects to good looking strings.

Uses the same format as used in stackoverflow (and many other popular websites). For example, a DateTime object that was 10 seconds ago will be formatted as 10 seconds ago.

Main library: intl:intl
Main elements: DateFormat DateFormat.format DateTime
Gist: https://gist.github.com/kasperpeulen/99a0e72c084b09b969f4

@kasperpeulen
kasperpeulen / README.md
Last active February 20, 2024 02:52
How to pretty-print JSON using Dart.
@kasperpeulen
kasperpeulen / README.md
Last active July 30, 2020 13:11
How to pretty-print JSON using Dart.
@kasperpeulen
kasperpeulen / README.md
Last active October 27, 2020 12:41
How to get a timestamp in Dart.