Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Sasha Prokhorenko minikin

🎯
Focusing
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
minikin / cloudSettings
Last active Aug 12, 2019
cloudSettings
View cloudSettings
{"lastUpload":"2019-08-12T07:13:12.906Z","extensionVersion":"v3.4.1"}
@minikin
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);
}
View Good-CONTRIBUTING.md-template.md

Contributing

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
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) {
execute()
print("executed line \(line)")
}
}
@minikin
minikin / order_details_bloc.dart
Created Apr 10, 2019
Parallel networking calls in Dart 2
View order_details_bloc.dart
@override
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!');
print(text);
}
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\nhttp://www.bigbuckbunny.org",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ],
"subtitle" : "By Blender Foundation",
"thumb" : "images/BigBuckBunny.jpg",
"title" : "Big Buck Bunny"
},
{ "description" : "The first Blender Open Movie from 2006",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ],
@minikin
minikin / introrx.md
Created Jan 11, 2019 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
View introrx.md
@minikin
minikin / randomValue.dart
Created Jan 2, 2019
Random string value dart
View randomValue.dart
import 'dart:math';
main() {
final String randomString = randomValue();
print(randomString);
}
String randomValue() {
final rand = Random();
final codeUnits = List.generate(35, (index) {
You can’t perform that action at this time.