Skip to content

Instantly share code, notes, and snippets.

View devoncarew's full-sized avatar

Devon Carew devoncarew

View GitHub Profile
@devoncarew
devoncarew / grind.dart
Created February 28, 2015 02:01
variants on grinder task def annotations
// dartdoc for the description; one combined annotation
/// Compile stuff.
@Task(depends: const [init])
compile() {
...
}
// dartdoc for the description; separate task and depends annotations
This is gist.
There are many like it, but this one is mine.
It is my life.
I must master it as I must hamster my life.
Without me gist is useless.
Without gist, I am useless.
<div id="score" class="score"></div>
<canvas id="myCanvas" width="500" height="500"></canvas>
@devoncarew
devoncarew / main.dart
Last active August 29, 2015 14:17
datetime
class Person {
Date birthdate;
int get age => new DateTime.now().difference(birthdate).inYears;
}
void _main() {
var p = new Person()..birthdate = new DateTime(1978);
print(p.age);
@devoncarew
devoncarew / main.dart
Created March 30, 2015 00:03
nosuchmethod
class Person {
Date birthdate;
int get age => new DateTime.now().difference(birthdate).inYears;
noSuchMethod(i) => super.noSuchMethod(i);
}
void main() {
var p = new Person()..birthdate = new DateTime(1978);
class Foo {
int bar;
int baz() => bar;
}
void main() {
for (int i = 0; i < 5; i++) {
print('hello ${i + 1}');
}
import 'dart:html';
void main() {
DivElement div = new DivElement();
div.te
for (int i = 0; i < 5; i++) {
print('hello ${i + 1}');
}
}
@devoncarew
devoncarew / .metadata.json
Last active May 31, 2018 18:22 — forked from anonymous/.metadata.json
Spirodraw
{
"origin": "dartlab.org",
"url": "http://dartlab.org/#:gistId",
"history": []
}
@devoncarew
devoncarew / 0_reuse_code.js
Last active August 29, 2015 14:20
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@devoncarew
devoncarew / main.dart
Created May 26, 2015 18:21 — forked from anonymous/main.dart
foo foo bar
void main() {
for (int i = 0; i < 5; i++) {
print('hello ${i + 1}');
print('hello ${i + 1}');
print('hello ${i + 1}');
print('hello ${i + 1}');
print('hello ${i + 1}');
}
}