Skip to content

Instantly share code, notes, and snippets.

View kevmoo's full-sized avatar
🤘
Crankin!

Kevin Moore kevmoo

🤘
Crankin!
View GitHub Profile
@kevmoo
kevmoo / main.dart
Last active March 8, 2023 00:00
left shift dart2js
void main() {
for (var i = 0; i < 64; i++) {
print([i, 1 << i].join('\t'));
}
}
@kevmoo
kevmoo / main.dart
Created July 29, 2022 20:49
hopeful-tundra-5900
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
Future<void> main() async {
for (var func in [goodCatch, badCatch]) {
print('Running $func');
try {
await func();
} catch (e) {
print('Why was this not caught? $e');
}
print('');
}

Keybase proof

I hereby claim:

  • I am kevmoo on github.
  • I am kevmoo (https://keybase.io/kevmoo) on keybase.
  • I have a public key whose fingerprint is 3E10 4CD0 17C0 7669 9A18 5344 C5F5 2AE0 8C6D B0DF

To claim this, I am signing this object:

@kevmoo
kevmoo / main.dart
Created October 30, 2018 17:07
Dart 2.1 example of new mixin syntax for DartPad
// Copyright (c) 2018, 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.
mixin AnswerMixin {
int get answer => 42;
@override
String toString() => '[ $runtimeType ]';
}
@kevmoo
kevmoo / main.dart
Last active October 30, 2018 17:06
Dart 2.1 int-2-double example for DartPad
// Copyright (c) 2018, 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.
import 'dart:math' as math;
class Circle {
double radius;
Circle(this.radius);
@kevmoo
kevmoo / index.html
Last active August 18, 2022 20:15 — forked from jcollins-g/index.html
Sunflower
<!-- Copyright 2011 the Dart project authors. All rights reserved.
Use of this source code is governed by a BSD-style license
that can be found in the LICENSE file. -->
<h2>Dr. Fibonacci's Sunflower Spectacular</h2>
<div>
<canvas id="canvas" width="300" height="300"></canvas>
</div>
@kevmoo
kevmoo / index.html
Created October 2, 2018 20:10 — forked from devoncarew/index.html
WebSocket test
<!-- Copyright 2015 the Dart project authors. All rights reserved.
Use of this source code is governed by a BSD-style license
that can be found in the LICENSE file. -->
<h2>A WebSocket test using echo.websocket.org</h2>
<br>
<p>Enter text to echo:</p>
diff --git a/index_2-dev-32.tree.json b/terry_chrome_fun.tree.json
index 49d9b3a..553260a 100644
--- a/index_2-dev-32.tree.json
+++ b/terry_chrome_fun.tree.json
@@ -1491,6 +1491,14 @@
"method: dart:core.Pattern.matchAsPrefix"
]
},
+ {
+ "name": "class: dart:core.pragma",
@kevmoo
kevmoo / uuidv4.dart
Created March 16, 2017 01:38
easy uuid-v4 for dart
// Ran with http://www.cryptosys.net/pki/uuid-rfc4122.html
import 'dart:math' as m;
void main() {
for (var i = 0; i < 1000000; i++) {
var thing = getThing();
print(thing);
print(thing.length);