Skip to content

Instantly share code, notes, and snippets.

View maks's full-sized avatar

Maksim Lin maks

View GitHub Profile
@maks
maks / getcoverage
Created March 18, 2021 04:11
shell script to generate and display test coverage report for a Flutter project
#!/bin/sh
flutter test --coverage ./lib
pub global run clean_coverage clean --exclusions 'lib/**/*.freezed.dart' coverage/lcov.info
genhtml -o coverage coverage/lcov.info
xdg-open coverage/index-sort-l.html &
@maks
maks / flutter-coredump.txt
Created February 24, 2021 06:58
flutter crash inside of VSCode coredump
PID: 65946 (flutterette)
UID: 1000 (maks)
GID: 1000 (maks)
Signal: 11 (SEGV)
Timestamp: Wed 2021-02-24 17:23:08 AEDT (9min ago)
Command Line: /home/maks/work/flutterette/build/linux/x64/debug/bundle/flutterette
Executable: /home/maks/work/flutterette/build/linux/x64/debug/bundle/flutterette
Control Group: /user.slice/user-1000.slice/user@1000.service/app.slice/dbus.service
Unit: user@1000.service
User Unit: dbus.service
@maks
maks / tofiles.dart
Created February 24, 2021 03:26
very basic code for converting the export json from www.notesforandroid.com app back to folder ot text files
import 'dart:convert';
import 'dart:io';
void main() {
final f = File('data.json');
String input = f.readAsStringSync();
print("len: ${input.length}");
final json = jsonDecode(input);
final notecount = json["notes"].length;
print('notes: $notecount');
@maks
maks / repl.dart
Created January 12, 2021 08:55
Example of basic Dart REPL using vm_service package
import 'dart:developer' as dev;
import 'dart:io';
import 'package:vm_service/vm_service.dart' show InstanceRef, VmService;
import 'package:vm_service/vm_service_io.dart' as vms;
import 'package:vm_service/utils.dart' as vmutils;
// based on early version of:
// https://github.com/BlackHC/dart_repl/
// and example in:
// https://github.com/dart-lang/sdk/blob/master/pkg/vm_service/example/vm_service_tester.dart
@maks
maks / main.dart
Created November 11, 2020 23:54
dart run loop demo
// Futures are treated as events and hence go onto event queue
// while microtasks have their own queue which is dispatched
// before the event queue in the run loop
// ref: https://www.didierboelens.com/2019/01/futures-isolates-event-loop/
void main() {
Future.microtask(() {
print('doing micro');
});
Future(() {
print('doing future');
@maks
maks / main.dart
Created October 7, 2020 22:01
fruit-dartpad-demo
// 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';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
#!/bin/sh
#================================================================
# Copyright (C) 2008 QNAP Systems, Inc.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@maks
maks / dart2native-on-freebsd.md
Created September 6, 2020 08:14
getting dart2native Linux executables running on FreeBSD
@maks
maks / submit.md
Created September 6, 2020 07:43 — forked from tanaikech/submit.md
Downloading Shared Files on Google Drive Using Curl

Downloading Shared Files on Google Drive Using Curl

When the shared files on Google Drive is downloaded, it is necessary to change the download method by the file size. The boundary of file size when the method is changed is about 40MB.

File size < 40MB

CURL

filename="### filename ###"
fileid="### file ID ###"
curl -L -o ${filename} "https://drive.google.com/uc?export=download&amp;id=${fileid}"
@maks
maks / nine-slice-example.dart
Created July 1, 2020 05:39
example for 9-slice in Flutter article
// Copyright 2019 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.
import 'package:flutter/material.dart';
final Color primaryColor = Colors.orange;
final TargetPlatform platform = TargetPlatform.android;
void main() {