Skip to content

Instantly share code, notes, and snippets.

View pulyaevskiy's full-sized avatar
😷

Anatoly Pulyaevskiy pulyaevskiy

😷
  • San Francisco Bay Area
View GitHub Profile
@pulyaevskiy
pulyaevskiy / article_page.dart
Created February 27, 2019 00:58
ParallaxImage with Heros
import 'package:flutter/material.dart';
import 'package:parallax_image/parallax_image.dart';
class ArticlePage extends StatefulWidget {
@override
ArticlePageState createState() {
return new ArticlePageState();
}
}
@pulyaevskiy
pulyaevskiy / main.dart
Last active December 14, 2018 05:20
Actions on Google
/// This is pseudo-code which drafts possible way of using Google's `actions-on-google` Node.js package.
/// This code has not been tested, compiled or ran anywhere.
@JS()
library actionssdk;
import 'package:firebase_functions_interop/firebase_functions_interop.dart';
import 'package:js/js.dart';
import 'package:js/js_util.dart';
import 'package:node_interop/node_interop.dart';
@pulyaevskiy
pulyaevskiy / annotated_editable.dart
Created June 28, 2018 19:39
AnnotatedEditableText
import 'package:flutter/widgets.dart';
class Annotation extends Comparable<Annotation> {
Annotation({@required this.range, this.style});
final TextRange range;
final TextStyle style;
@override
int compareTo(Annotation other) {
return range.start.compareTo(other.range.start);
@pulyaevskiy
pulyaevskiy / main.dart
Created March 26, 2018 23:24
Scale bug
class _MyHomePageState extends State<MyHomePage> {
int _counter = 0;
bool _hide = false;
FocusNode _focusNode;
@override
void initState() {
super.initState();
_focusNode = new FocusNode();
_focusNode.addListener(_handleFocusChange);
@pulyaevskiy
pulyaevskiy / FlutterEmbedderGLFW.cc
Created October 30, 2017 15:16 — forked from chinmaygarde/FlutterEmbedderGLFW.cc
Flutter Embedder API Example (GLFW with OpenGL)
#include <assert.h>
#include <chrono>
#include <embedder.h>
#include <glfw3.h>
#include <iostream>
static_assert(FLUTTER_ENGINE_VERSION == 1, "");
static const size_t kInitialWindowWidth = 800;
@pulyaevskiy
pulyaevskiy / 01_async_caching.dart
Last active March 30, 2017 04:45
Efficient Dart
import 'dart:async';
void main() {
// We retrieve boolean value 3 times in the for-loop below and print it.
for (var i = 1; i <= 3; i++) {
print('Printing "$value" $i time.');
}
}
/// Internal cache for our value.
@pulyaevskiy
pulyaevskiy / .travis.yml
Created April 10, 2016 17:30
Generate code coverage in TravisCI build and send it to Codecov
# Workaround which:
# * Starts observatory in background
# * Runs the test suite
# * Collects coverage and sends it to Codecov
#
# Someday the `test` package will support observatory and below steps
# could be simplified.
#
# Prerequisites:
# * Have Travis CI build for your repo