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"> | |
<title>Addtotable</title> | |
<link rel="stylesheet" href="addtotable.css"> | |
<link rel="import" href="my_table.html"> | |
<script type="application/dart">export 'package:polymer/init.dart';</script> |
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 Person { | |
String firstName, lastName; | |
Person(List<String> raw) : firstName = raw[0], lastName = raw[1]; | |
String toString() => '$firstName $lastName'; | |
} | |
/** | |
* Expects one person per line, each line containing a first and last name | |
* separated by a single space. | |
*/ |
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
I am a null (ID: 177863854) and I am ready | |
I am a null (ID: 924578920) and I am ready | |
I am a null (ID: 394322034) and I am ready | |
I am a null (ID: 854832235) and I am ready | |
I am a null (ID: 587923908) and I am ready | |
I am a null (ID: 763736301) and I am ready |
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 'package:polymer/polymer.dart'; | |
import "package:google_oauth2_client/google_oauth2_browser.dart"; | |
import "package:js/js.dart" as js; | |
import 'dart:html'; | |
import 'package:logging/logging.dart'; | |
typedef OnSignInCallback(SimpleOAuth2 authenticationContext, [Map authResult]); | |
typedef OnSignOutCallback(); | |
final Logger log = new Logger('google-sign-in-element'); |
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"> | |
<title>Sample app</title> | |
<link rel="stylesheet" href="testme.css"> | |
<!-- import the click-counter --> | |
<link rel="import" href="clickcounter.html"> |
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"> | |
<title>Sample app</title> | |
<script src="packages/polymer/boot.js"></script> | |
</head> | |
<body> | |
<polymer-element name="x-c"> |
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
#!/bin/sh | |
DARTFILENAME=$1.dart | |
HTMLFILENAME=$1.html | |
ELEMENTNAME=$2 | |
LIBNAME=`echo $2 | sed -e "s/-/_/g"` | |
CLASSNAME=$3 | |
echo > $HTMLFILENAME | |
echo "<head>" >> $HTMLFILENAME |
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
Database db; | |
window.indexedDB.deleteDatabase('justtesting') | |
.then((_) { | |
print('opening'); | |
return window.indexedDB.open('justtesting', version: 1, | |
onUpgradeNeeded: (e) { | |
print('upgrading to v1'); | |
Database d = e.target.result as Database; | |
d.createObjectStore('store1'); |
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:mirrors'; | |
import 'dart:async'; | |
// TODO: inject the persistance storage driver | |
abstract class Persistable { | |
int _dbId; | |
static const constructor = const Symbol('fromPersistance'); | |
static Future load(int id, Type type) { |
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:io'; | |
import 'dart:async'; | |
import 'dart:math'; | |
// The following function is part of a third-party package that you can't touch. | |
Future doCoolStuff() { | |
var completer = new Completer(); | |
// Sometimes bad things happen. | |
if (new Random().nextBool()) { |