Skip to content

Instantly share code, notes, and snippets.

View eseidelGoogle's full-sized avatar

Eric Seidel eseidelGoogle

View GitHub Profile
@eseidelGoogle
eseidelGoogle / gist:b8c42258423b81c2af2b
Last active August 29, 2015 14:20
Painting wrapped Text in Sky?
import "dart:sky";
var inline = new RenderInline();
// We'll need a better API for looking up fonts.
inline.textStyle.fontSize = "Helvetica";
var text = new RenderText("This is a long bit of text which should wrap. ");
var text2 = new RenderText("And this bit is bold ");
text2.textStyle.weight = 900;
inline.add(text);
inline.add(text2);
@eseidelGoogle
eseidelGoogle / gist:9a578e5f073e69eba0ad
Created May 11, 2015 20:25
Sublime console output
DPI scale: 1
startup, version: 3083 linux x64 channel: stable
executable: /opt/sublime_text/sublime_text
working dir: /
packages path: /usr/local/google/home/eseidel/.config/sublime-text-3/Packages
state path: /usr/local/google/home/eseidel/.config/sublime-text-3/Local
zip path: /opt/sublime_text/Packages
zip path: /usr/local/google/home/eseidel/.config/sublime-text-3/Installed Packages
ignored_packages: ["Vintage"]
pre session restore time: 0.112585
@eseidelGoogle
eseidelGoogle / gist:56973c1495e1d256c827
Last active August 29, 2015 14:20
Painting a full-screen circle
import "dart:sky";
Screen screen = window.screen;
double width = screen.availableWidth;
double height = screen.availableHeight;
PaintingContext ctx = new PaintingContext(width, height);
double radius = min(width, height) * .9;
Paint paint;
paint.setARGB(1, 0, 1, 0);
ctx.drawCircle(width / 2, height / 2, radius, paint);
@eseidelGoogle
eseidelGoogle / gist:6f34ad00d1f906a4245c
Created June 10, 2015 17:07
GC Log from game/main.dart
E/DartVM (32156): [ GC | space | count | start | gc time | new gen (KB) | old gen (KB) | timers | data ]
E/DartVM (32156): [ (isolate)| (reason)| | (s) | (ms) | used,cap,ext | used,cap,ext | (ms) | ]
E/DartVM (32156): [ GC(714134764): Scavenge(new space), 1, 0.256, 1.848, 1022, 824, 1024, 1024, 0, 0, 1782, 1782, 2356, 2356, 0, 0, 1.416, 0.191, 0.045, 0.009, 113, 0, 0, 821, ]
E/DartVM (32156): [ GC(714134764): Scavenge(new space), 2, 0.269, 2.747, 1024, 189, 1024, 4096, 0, 0, 1782, 2605, 2356, 2840, 0, 0, 1.958, 0.144, 0.106, 0.008, 113, 0, 0, 183, ]
E/DartVM (32156): [ GC | space | count | start | gc time | new gen (KB) | old gen (KB) | timers | data ]
E/DartVM (32156): [ (isolate)| (reason)| | (s) | (ms) | used,cap,ext | used,cap,ext | (ms) | ]
E/DartVM (32156): [ GC(219670806): Scavenge(new space), 1, 0.685, 3.307, 997, 526, 1024, 1024, 15, 2, 1056, 1056, 1536, 1536, 0, 0, 0.032, 2.532, 0.036, 0.168, 188, 0, 0, 526, ]
E/DartVM (32156): [ GC(2196708
@eseidelGoogle
eseidelGoogle / gist:7c1185d642acf8c14cad
Created June 10, 2015 17:16
patch to add --verbose_gc
commit 386f1f30346674a8b965bfdb17d85957ef4de2d7
Author: Eric Seidel <eseidel@chromium.org>
Date: Wed Jun 10 09:21:18 2015 -0700
gc
diff --git a/sky/engine/core/script/dart_controller.cc b/sky/engine/core/script/dart_controller.cc
index 62665ab..3dc083c 100644
--- a/sky/engine/core/script/dart_controller.cc
+++ b/sky/engine/core/script/dart_controller.cc
@eseidelGoogle
eseidelGoogle / gist:e052715acc22de150649
Created December 7, 2015 23:02
Tracing on startup on flutter/engine@6d0c4e5 with and w/o --optimization_counter_threshold=-1
On 6d0c4e5.
diff --git a/sky/engine/core/script/dart_init.cc b/sky/engine/core/script/dart_init.cc
index e7a9d45..9d71485 100644
--- a/sky/engine/core/script/dart_init.cc
+++ b/sky/engine/core/script/dart_init.cc
@@ -64,6 +64,7 @@ void CreateEmptyRootLibraryIfNeeded() {
static const char* kDartArgs[] = {
"--enable_mirrors=false",
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
DEPS = [
'recipe_engine/path',
'recipe_engine/step',
'build/git',
'build/gclient',
]
cat packages/flutter/doc/styles.html doc/_analytics.html > /tmp/_header.html
Became:
flutter_styles = checkout.join('packages', 'flutter', 'doc',
'styles.html')
analytics = checkout.join('doc', '_analytics.html')
header_contents = '\n'.join([
api.file.read('Read styles.html', flutter_styles),
api.file.read('Read _analytics.html', analytics),
@eseidelGoogle
eseidelGoogle / gist:81595967f76fa5968298
Created February 16, 2016 17:10
I just want to serve five terrabytes
Ideally this would be easier.
eseidel@eseidel-macbookpro /src/flutter %cd examples/material_gallery [/src/flutter]
eseidel@eseidel-macbookpro /src/flutter/examples/material_gallery %flutter start [/src/flutter/examples/material_gallery]
Downloading Dart SDK 1.14.1...
######################################################################## 100.0%
Building flutter tool...
Error: incompatible sky_engine package; please run 'pub get' to get the correct one.
eseidel@eseidel-macbookpro /src/flutter/examples/material_gallery %pub get [/src/flutter/examples/material_gallery]
Erics-MacBook-Air:my_app ericseidel$ flutter start
idevice_id not found. To work with iOS devices, please install ideviceinstaller.
If you use homebrew, you can install it with "$ brew install ideviceinstaller".
Starting lib/main.dart on iPhone 5...
An error was encountered processing the command (domain=FBSOpenApplicationErrorDomain, code=1):
The operation couldn’t be completed. (FBSOpenApplicationErrorDomain error 1.)
Error code 1 returned when attempting to run command: /usr/bin/xcrun simctl launch EC33D8AF-D8E0-42BB-A56D-45847027FDBB io.flutter.runner.Runner --enable-checked-mode
Error starting application on iPhone 5.
Unable to run application.
Erics-MacBook-Air:my_app ericseidel$ flutter logs