Skip to content

Instantly share code, notes, and snippets.

View jonahwilliams's full-sized avatar

Jonah Williams jonahwilliams

View GitHub Profile
@jonahwilliams
jonahwilliams / main.dart
Created August 9, 2021 17:43
constantly repainting RO
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter/scheduler.dart';
import 'package:flutter_svg/svg.dart';
void main() {
runApp(const MaterialApp(home: Scaffold(body: Example())));
}
class Example extends StatefulWidget {
@jonahwilliams
jonahwilliams / main.dart
Last active August 10, 2021 18:29
tabs example
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
void main() {
runApp(MaterialApp(home: Example()));
}
class Example extends StatefulWidget {
const Example({Key? key}) : super(key: key);
@jonahwilliams
jonahwilliams / main.dart
Created June 9, 2021 06:39
not even at swapchain
// @dart = 2.8
import 'package:glfw/glfw.dart';
import 'package:vulkan/vulkan.dart';
import 'dart:ffi';
import 'package:ffi/ffi.dart';
void main() {
// Init dart specific FFI libraries.
initGlfw();
/ Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter/widgets.dart';
void main() =>
runApp(Example());
class Example extends StatefulWidget {
This file has been truncated, but you can view the full file.
{"devToolsSnapshot":true,"activeScreenId":"cpu-profiler","devtoolsVersion":"2.1.1","cpu-profiler":{"type":"_CpuProfileTimeline","samplePeriod":250,"sampleCount":461,"stackDepth":128,"timeOriginMicros":60491161039,"timeExtentMicros":11407969,"stackFrames":{"isolates/4025764391815551-1":{"category":"Dart","name":"_lookupHandler","resolvedUrl":"org-dartlang-sdk:///sdk/lib/_internal/vm/lib/isolate_patch.dart"},"isolates/4025764391815551-2":{"category":"Dart","name":"[]","resolvedUrl":"org-dartlang-sdk:///sdk/lib/_internal/vm/lib/compact_hash.dart","parent":"isolates/4025764391815551-1"},"isolates/4025764391815551-3":{"category":"Dart","name":"_getValueOrData","resolvedUrl":"org-dartlang-sdk:///sdk/lib/_internal/vm/lib/compact_hash.dart","parent":"isolates/4025764391815551-2"},"isolates/4025764391815551-4":{"category":"Dart","name":"_handleMessage","resolvedUrl":"org-dartlang-sdk:///sdk/lib/_internal/vm/lib/isolate_patch.dart"},"isolates/4025764391815551-5":{"category":"Dart","name":"_runPendingImmediateCallback",
@jonahwilliams
jonahwilliams / main.dart
Created March 23, 2021 23:52
Confusing null promotion failure with while loop
import 'package:file/file.dart';
String? findProjectRoot(FileSystem fileSystem, [ String? directory ]) {
const String kProjectRootSentinel = 'pubspec.yaml';
directory ??= fileSystem.currentDirectory.path;
while (true) {
if (fileSystem.isFileSync(fileSystem.path.join(directory, kProjectRootSentinel))) {
return directory;
}
final String parent = fileSystem.path.dirname(directory);
@jonahwilliams
jonahwilliams / profile
Last active February 1, 2021 22:24
lerping
*** BEGIN CFG
After AllocateRegisters
==== package:jumpjet/src/lighting.dart_LightingSystem__smoothColors@572387241 (RegularFunction)
0: B0[graph]:0 {
v0 <- Constant(#null) T{Null?}
v1 <- Constant(#<optimized out>) T{_OneByteString}
v27 <- Constant(#95999) [95999, 95999] T{_Smi}
v28 <- Constant(#0) [0, 0] T{_Smi}
v33 <- Constant(#true) T{bool}
v38 <- Constant(#256) [256, 256] T{_Smi}
if (energy <= 0) {
return false;
}
updateVisibility();
var candidates = <Agent>[];
var friends = <Agent>[];
for (var agent in stage.agents) {
if (agent is Tombstone) {
continue;
}
(function() {
var _currentDirectory = (function () {
var _url;
var lines = new Error().stack.split('\n');
function lookupUrl() {
if (lines.length > 2) {
var match = lines[1].match(/^\s+at (.+):\d+:\d+$/);
// Chrome.
if (match) return match[1];
// Chrome nested eval case.
ClientException: Connection closed while receiving data
Thread 0 main threadClientException: Connection closed while receiving data
at IOClient.send.<anonymous closure> (io_client.dart:50)
at _invokeErrorHandler (async_error.dart:16)
at _HandleErrorStream._handleError (stream_pipe.dart:282)
at _ForwardingStreamSubscription._handleError (stream_pipe.dart:161)
at _HttpClientResponse.listen.<anonymous closure> (http_impl.dart:441)
at _rootRunBinary (zone.dart:1214)
at _CustomZone.runBinary (zone.dart:1107)
at _CustomZone.runBinaryGuarded (zone.dart:1013)