Skip to content

Instantly share code, notes, and snippets.

@balesz
balesz / stream.go
Last active March 22, 2024 09:29
Golang Generic Stream
package async
import (
"context"
"sync"
"time"
)
type Stream[T any] interface {
Sink() chan<- T
@balesz
balesz / main.dart
Last active February 24, 2023 08:30
example_route
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:go_router/go_router.dart';
void main() {
runApp(const ProviderScope(child: _Application()));
}
@balesz
balesz / main.dart
Created January 19, 2023 10:54
volcanic-charm-3879
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
void main() async {
runApp(ProviderScope(child: Application()));
}
class Application extends StatelessWidget {
@override
Widget build(BuildContext context) {
@balesz
balesz / _README.md
Created May 31, 2019 06:15 — forked from jifalops/_README.md
Headless Crostini quick setup script for Flutter, VS Code, Node/npm (via nvm), Firebase tools, and pip for Python3

Headless Crostini quick setup script for Flutter, VS Code, Node/npm (via nvm), Firebase tools, and pip for Python3

Modify lines 20 and 21 with your gist and token for the VS Code settings-sync extension.

WARNING

  • The script appends to the PATH environment variable each time it runs (at the end).
  • settings.json for VS Code will be overwritten if it exists! (The default settings are empty and it was easier to do it this way than to use jq.)
@balesz
balesz / bloc.dart
Created May 25, 2019 21:39
BLoC Base Class
import 'dart:async';
import 'package:equatable/equatable.dart';
import 'package:rxdart/rxdart.dart';
abstract class Bloc<State extends Equatable> {
static final _eventSubject = PublishSubject();
final subscriptions = CompositeSubscription();