Skip to content

Instantly share code, notes, and snippets.


Sasha Prokhorenko minikin

Block or report user

Report or block minikin

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
minikin / cloudSettings
Last active Aug 12, 2019
View cloudSettings
minikin / main.dart
Last active Jul 4, 2019
Reduce boilerplates for operator == and hashCode
View main.dart
/// Generates a hash code for multiple [objects].
int hashValues(Iterable objects) => _finish(
objects.fold(0, (hash, element) => _combine(hash, element.hashCode)));
// Jenkins hash functions
int _combine(int hash, int value) {
hash = 0x1fffffff & (hash + value);
hash = 0x1fffffff & (hash + ((0x0007ffff & hash) << 10));
return hash ^ (hash >> 6);


When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change.

Please note we have a code of conduct, please follow it in all your interactions with the project.

Pull Request Process

  1. Ensure any install or build dependencies are removed before the end of the layer when doing a
minikin / main.dart
Created May 21, 2019
Switch on a Set using List literals as cases in Dart.
View main.dart
// Switch on a Set using List literals as cases in Dart.
// Can be really useful to avoid many if/else statements.
enum Direction { up, down, left, right }
class MapTile {
var directions = Set<Direction>();
String render() {
switch (directions.toList()) {
View Delay.swift
func delay(by duration: TimeInterval, line: UInt = #line, execute: @escaping () -> Void) {
print("delaying line \(line) by \(duration)")
DispatchQueue.main.asyncAfter(deadline: .now() + duration) {
print("executed line \(line)")
minikin / order_details_bloc.dart
Created Apr 10, 2019
Parallel networking calls in Dart 2
View order_details_bloc.dart
Stream<OrderDetailsState> mapEventToState(
OrderDetailsEvent event,
) async* {
if (event is ShowOrderDetails) {
yield OrderDetailsState.loading();
try {
final account = await _authRepository.refreshToken();
final results = await Future.wait(
View main.dart
main() {
final text = myText('Hi, Folks!');
String myText(String text) {
return text;
View gist:a39dc5039e539dd1b0002aa05e94d3d1
var mediaJSON = { "categories" : [ { "name" : "Movies",
"videos" : [
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\n",
"sources" : [ "" ],
"subtitle" : "By Blender Foundation",
"thumb" : "images/BigBuckBunny.jpg",
"title" : "Big Buck Bunny"
{ "description" : "The first Blender Open Movie from 2006",
"sources" : [ "" ],
minikin /
Created Jan 11, 2019 — forked from staltz/
The introduction to Reactive Programming you've been missing
minikin / randomValue.dart
Created Jan 2, 2019
Random string value dart
View randomValue.dart
import 'dart:math';
main() {
final String randomString = randomValue();
String randomValue() {
final rand = Random();
final codeUnits = List.generate(35, (index) {
You can’t perform that action at this time.