Skip to content

Instantly share code, notes, and snippets.

View sla-000's full-sized avatar

Viacheslav "Slava" Riabinin sla-000

  • EPAM
  • Georgia, Batumi
  • 14:30 (UTC +04:00)
  • Facebook embedprog
View GitHub Profile
@sla-000
sla-000 / futures_record_extension.dart
Created August 14, 2025 20:50
Extension on record of futures that executes wait on them and re-throws first error if any happens
extension FuturesRecordExtension2<T1, T2, E1, E2> on (Future<T1>, Future<T2>) {
Future<(T1, T2)> waitOrRethrowFirst() async {
try {
return await wait;
} on ParallelWaitError<(T1?, T2?), (E1?, E2?)> catch (e, s) {
final asyncError = (e.errors.$1 ?? e.errors.$2) as AsyncError?;
_throwError(asyncError, s, e);
}
}
@sla-000
sla-000 / Privacy Policy Flutter counter demo shooter.md
Created July 5, 2024 09:59
Privacy policy `Flutter counter demo shooter`

Privacy Policy

This privacy policy applies to the Flutter counter demo shooter app (hereby referred to as "Application") for mobile devices that was created by Blin23 (hereby referred to as "Service Provider") as an Ad Supported service. This service is intended for use "AS IS".

What information does the Application obtain and how is it used?

The Application does not obtain any information when you download and use it. Registration is not required to use the Application.

Does the Application collect precise real time location information of the device?

{
"openapi": "3.0.0",
"info": {
"title": "Stocks API",
"description": "Stocks API",
"contact": {
"name": "Viacheslav Riabinin",
"email": "[email protected]"
},
"version": "1.0.1"
import 'package:flutter/material.dart';
import 'package:flutter_redux/flutter_redux.dart';
import 'package:provider/provider.dart';
import 'package:redux/redux.dart';
// One simple action: Increment
enum Actions { Increment }
// The reducer, which takes the previous count and increments it in response
// to an Increment action.
Модель Project:
...
const String kProjectsCollectionName = 'projects';
class ProjectModel {
/// Create new project
ProjectModel({
this.user,
import 'package:rxdart/rxdart.dart';
class Bloc<T> {
/// Create default bloc
Bloc() : subject = BehaviorSubject<T>();
/// Create bloc with predefined value
Bloc.seeded(T seedValue) : subject = BehaviorSubject<T>.seeded(seedValue);
/// Bloc subject
@sla-000
sla-000 / preprocessor_fun.h
Created February 7, 2017 11:45 — forked from aras-p/preprocessor_fun.h
Things to commit just before leaving your job
// Just before switching jobs:
// Add one of these.
// Preferably into the same commit where you do a large merge.
//
// This started as a tweet with a joke of "C++ pro-tip: #define private public",
// and then it quickly escalated into more and more evil suggestions.
// I've tried to capture interesting suggestions here.
//
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_,
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant,