Skip to content

Instantly share code, notes, and snippets.

View rhalff's full-sized avatar

Robbert Halff rhalff

  • Robbert Halff
  • Netherlands
View GitHub Profile
@rhalff
rhalff / main.dart
Last active August 28, 2020 19:16
Microtask
import 'package:flutter/material.dart';
void main() => runApp(App());
class App extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(home: Scaffold(body: Center(child: MicroTask())));
}
}
fuchsia git:(master) ✗ fx emu -N
sudo follows to configure the tap interface:
Creating disk image...done
+ /Volumes/Fuchsia/fuchsia/prebuilt/third_party/aemu/mac-x64/emulator -feature VirtioInput,GLDirectMem,HVF,Vulkan -window-size 1280x800 -gpu auto -fuchsia -kernel /Volumes/Fuchsia/fuchsia/out/default/multiboot.bin -initrd /var/folders/89/38yds5s56613bmsc4yrd_6zm0000gn/T/tmp.x1ru1xpD/fuchsia-ssh.zbi -m 8192 -serial stdio -vga none -device virtio-keyboard-pci -device virtio_input_multi_touch_pci_1 -smp 4,threads=2 -machine q35 -device isa-debug-exit,iobase=0xf4,iosize=0x04 -enable-hvf -cpu Haswell -netdev type=tap,ifname=tap0,id=net0,script=/Volumes/Fuchsia/fuchsia/tools/devshell/lib/emu-ifup-macos.sh -device e1000,netdev=net0,mac=52:54:00:4d:27:96 -drive file=/var/folders/89/38yds5s56613bmsc4yrd_6zm0000gn/T/tmp.x1ru1xpD/fvm.blk,format=raw,if=none,id=vdisk -device virtio-blk-pci,drive=vdisk -append 'TERM=xterm-256color kernel.serial=legacy kernel.entropy-mixin=d9ec8927ffa9b8d1344389d717cfe46ec1560a882cd
curl -s "https://fuchsia.googlesource.com/fuchsia/+/master/scripts/bootstrap?format=TEXT" | base64 --decode | bash
cipd bootstrapped to path:"/Volumes/Extra/fuchsia/.jiri_root/bin/cipd"
Please add /Volumes/Extra/fuchsia/.jiri_root/bin to your PATH
[22:40:21.603] WARN: Please opt in or out of analytics collection. You will receive this warning until an option is selected.
To check what data we collect run: jiri init -show-analytics-data
To opt-in run: jiri init -analytics-opt=true "/Volumes/Extra/fuchsia"
To opt-out run: jiri init -analytics-opt=false "/Volumes/Extra/fuchsia"
[22:40:21.608] WARN: Please opt in or out of analytics collection. You will receive this warning until an option is selected.
To check what data we collect run: jiri init -show-analytics-data
@rhalff
rhalff / equatable_annotation.dart
Created April 25, 2020 15:50
Equatable Annotation
import 'package:collection/collection.dart';
import 'package:meta/meta.dart' show immutable;
//////////////////////////////////////////////
// Public Api
//////////////////////////////////////////////
@immutable
@equatableProps
class SomeObject extends $_SomeObjectEquatable {
final int one;
@rhalff
rhalff / iPhone Model Mapping.txt
Created April 16, 2020 07:27 — forked from pgherveou/iPhone Model Mapping.txt
iPhone Model Mapping.txt
Source https://stackoverflow.com/questions/11197509/how-to-get-device-make-and-model-on-ios
@"iPhone1,1" on iPhone
@"iPhone1,2" on iPhone 3G
@"iPhone2,1" on iPhone 3GS
@"iPhone3,1" on iPhone 4 (GSM)
@"iPhone3,3" on iPhone 4 (CDMA/Verizon/Sprint)
@"iPhone4,1" on iPhone 4S
@"iPhone5,1" on iPhone 5 (model A1428, AT&T/Canada)
@"iPhone5,2" on iPhone 5 (model A1429, everything else)
@rhalff
rhalff / scan_recursive.go
Created January 5, 2020 22:55 — forked from mstfydmr/scan_recursive.go
Go Lang - Scan Folder Recursive. Find all files and folders.
package main
import (
"fmt"
"os"
"path/filepath"
"strings"
"log"
)
@rhalff
rhalff / generate_ts_interfaces_for_gogs.go
Created December 28, 2019 22:25
Generate TypeScript interfaces for Gogs Client
package main
import "github.com/tkrajina/typescriptify-golang-structs/typescriptify"
import (
"github.com/gogs/go-gogs-client"
)
func main() {
converter := typescriptify.New()
converter.CreateFromMethod = true
@rhalff
rhalff / queue_subject.dart
Created November 13, 2019 22:14
Replay subject - clear queue
import 'dart:async';
import 'dart:collection';
import 'package:rxdart/rxdart.dart';
class QueueSubject<T> extends Subject<T> implements ReplayObservable<T> {
final Queue<T> _queue;
final int _maxSize;
factory QueueSubject({
@rhalff
rhalff / singleton.dart
Created October 22, 2019 03:24 — forked from theburningmonk/singleton.dart
Using Dart's factory constructor feature to implement the singleton pattern
class MyClass {
static final MyClass _singleton = new MyClass._internal();
factory MyClass() {
return _singleton;
}
MyClass._internal() {
... // initialization logic here
}
@rhalff
rhalff / fancy-tabs-demo.html
Created August 28, 2019 21:59 — forked from ebidel/fancy-tabs-demo.html
Fancy tabs web component - shadow dom v1, custom elements v1, full a11y
<script>
function execPolyfill() {
(function(){
// CustomElementsV1.min.js v1 polyfill from https://github.com/webcomponents/webcomponentsjs/tree/v1/src/CustomElements/v1.
/*
Copyright (c) 2016 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt