Skip to content

Instantly share code, notes, and snippets.

View maks's full-sized avatar

Maksim Lin maks

  • Manichord
  • Australia
View GitHub Profile
@maks
maks / firetron.sh
Last active February 23, 2022 23:51
**VERY BASIC AND LIMITED** pwa workaround for firefox from script found on: https://www.reddit.com/r/linuxquestions/comments/omsgqd/alternative_to_nativefier/
#!/bin/bash
## Usage:
# ./firetron <name> <url>
# ./firetron hulu hulu.com
firefox -CreateProfile "$1"
cd "$HOME/.local/share/icons/hicolor/32x32/apps/" || exit
wget -O $1.png $2/favicon.ico
touch "$HOME/.local/share/applications/$1.desktop"
import 'dart:async';
import 'dart:isolate';
import 'dart:typed_data';
import 'package:libao/libao.dart';
void playbackWorker(SendPort replyPort) {
final requestsPort = ReceivePort();
final player = AudioPlayer();
player.play();
@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