Skip to content

Instantly share code, notes, and snippets.

View jtmcdole's full-sized avatar

John "codefu" McDole jtmcdole

View GitHub Profile
@jtmcdole
jtmcdole / dolphin_decode.dart
Last active May 29, 2022 22:02
Flipper Zero Dolphin state decode
import 'dart:typed_data';
import 'dart:convert';
main() {
final foo = Uint8List.fromList(data);
final checksum = Uint8List(1);
for (int i = 8; i < foo.length; i++) {
checksum[0] += foo[i];
}
print('checksum: $checksum -> 0x${checksum[0].toRadixString(16)}');
@jtmcdole
jtmcdole / console
Last active August 24, 2023 22:45
unicode fun in dart
===[🌈]===
length: 2
codeunits: 2
runes: 1
utf16: 0xd83c 0xdf08
utf8len: 4
utf8 bytes: 0xf0 0x9f 0x8c 0x88
===[Hello🌎]===
length: 7
codeunits: 7
// Copyright (c) 2019, 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 'package:flutter/material.dart';
import 'dart:math' as math;
void main() => runApp(MyApp());
class PieChart extends CustomPainter {