This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>API Search</title> | |
</head> | |
<body> | |
<input id="search" type="search" /> | |
<div id="results"></div> |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<meta name="scaffolded-by" content="https://github.com/google/stagehand" /> | |
<title>webassembly_example</title> | |
<link rel="stylesheet" href="styles.css" /> |
This file contains 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
// https://wtfjs.com/wtfs/2015-04-08-array-sort | |
console.log([1, 2, 3, 15, 30, 7, 5, 45, 60].sort()); | |
// https://wtfjs.com/wtfs/2015-03-23-adding-arrays | |
console.log([1, 2, 3] + [4, 5, 6]); | |
// https://wtfjs.com/wtfs/2014-02-22-wtf_document.all | |
console.log(document.all); | |
console.log(document.all[0]); | |
console.log(typeof document.all); |
This file contains 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:html'; | |
import 'dart:math' as Math; | |
main() { | |
// 1 - Sorting arrays | |
var arr = [1, 2, 3, 15, 30, 7, 5, 45, 60]; | |
arr.sort(); | |
print(arr); | |
// 2 - Adding lists/arrays |
This file contains 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
/* Master Styles */ | |
h1 { | |
color: #369; | |
font-family: Arial, Helvetica, sans-serif; | |
font-size: 250%; | |
} | |
h2, | |
h3 { | |
color: #444; | |
font-family: Arial, Helvetica, sans-serif; |
This file contains 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
<h2>Subscribe to our Newsletter</h2> | |
<form novalidate> | |
<span id="result"></span> | |
<input type="email" name="email" id="email" placeholder="Enter your email" /> | |
<span id="validation-message"></span> | |
<button>Subscribe</button> | |
</form> |
This file contains 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'; | |
void main() { | |
var controller = StreamController<num>(); | |
// Create StreamTransformer with transformer closure | |
var streamTransformer = StreamTransformer<num, num>.fromHandlers( | |
handleData: (num data, EventSink sink) { | |
sink.add(data * 2); | |
}, |
This file contains 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'; | |
void main() { | |
var streamController = StreamController(); | |
streamController.stream.listen( | |
(data) => print('Got eem! $data'), | |
onError: (err) => print('Got an error! $err'), | |
onDone: () => print('Mission complete!'), | |
cancelOnError: false, |
This file contains 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
class CacheItem<A> { // Using the letter A | |
CacheItem(A this.itemToCache); | |
final itemToCache; | |
String get detail => ''' | |
Cached item: $itemToCache | |
The item type is $A | |
'''; | |
} |
This file contains 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() { | |
MockClient client = null; | |
test('calling initiate(client) returns a list of storylinks', () async { | |
// Arrange | |
client = MockClient((req) => Future(() => Response(''' | |
<body> | |
<table><tbody><tr> | |
<td class="title"> | |
<a class="storylink" href="https://dartlang.org">Get started with Dart</a> |