Skip to content

Instantly share code, notes, and snippets.

@liyuqian
liyuqian / gist:a35971ce88792dc23cb3da1d3dd61e0c
Last active July 1, 2019 22:04
Run Flutter driver tests repeatedly to eliminate noise and find regressions
import 'dart:io';
import 'dart:convert';
const String kFlutterPath = '/usr/local/google/home/liyuqian/flutter/flutter';
const String kLogPath = '/var/tmp/end_driver';
const String kFlutter308 = '024eaa3fb45dc41d0e3accb422b76da2d2d16731';
const String kFlutter312 = 'e1005143ddadde4eff337d32fec5977cd162127a';
const String kFlutter315 = '439fbbe69e9eed51d8fe02774989111e420eba7e';
const String kRegression = 'a29906d5f552f2984daf9bef569b7fe1295e1c70';
@liyuqian
liyuqian / gist:06a07d5ec4c3bc1236ee8a646c7322b3
Created June 24, 2019 23:46
Flutter device lab mac setup
# Install homebrew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew doctor
# Install convenient tools
brew cask install iterm2
brew cask install visual-studio-code
brew cask install google-chrome
# Install Dart
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
home: Scaffold(
// Run this by `history > history.out && dart analyze_date.dart`.
// Or you can download and run this script by:
// ```
// curl https://gist.githubusercontent.com/liyuqian/403400fddd0e2a8687dbd6e092f21d51/raw/analyze_date.dart > analyze_dart.dart && history > history.out && dart analyze_dart.dart
// ```
import 'dart:io';
void printAnalysis(String action, Set<String> dates) {
final firstDate = DateTime.parse(dates.first);
final lastDate = DateTime.parse(dates.last);
cd c:\
powershell
curl https://aka.ms/vs/15/release/vs_community.exe -o vs_community.exe
./vs_community.exe --passive --wait --add Microsoft.VisualStudio.Workload.NativeCrossPlat --add Microsoft.VisualStudio.Workload.NativeDesktop --includeRecommended
curl https://download.microsoft.com/download/5/C/3/5C3770A3-12B4-4DB4-BAE7-99C624EB32AD/windowssdk/winsdksetup.exe -o winsdksetup.exe
./winsdksetup.exe /features OptionId.WindowsDesktopDebuggers /q
curl https://storage.googleapis.com/chrome-infra/depot_tools.zip -o depot_tools.zip
Expand-Archive -LiteralPath c:/depot_tools.zip -DestinationPath depot_tools
curl https://npm.taobao.org/mirrors/git-for-windows/v2.21.0.windows.1/MinGit-2.21.0-64-bit.zip -o MinGit.zip
Expand-Archive -LiteralPath MinGit.zip -DestinationPath MinGit
:: Tested on a "Windows Server version 1803 Datacenter Core for Containers"
:: GCE VM.
::
:: It's known that other versions such as 1809 and Windows Server 2019 won't
:: work with the Dockerfile.
::
:: Do not run this bat directly from c:\Users\<username> (default directory
:: after RDP into the VM) as Docker may not have permission. Run it inside
:: a directory like c:\Users\<username>\windows_build.
@liyuqian
liyuqian / Dockerfile
Last active May 21, 2021 16:42
Production Windows Dockerfile Test
# This is tested on a "Windows Server version 1803 Datacenter Core for Containers" VM on GCE.
# It's known that other versions such as 1809 and Windows Server 2019 won't work with this.
#
# Note that "\" is the escape character. Use "\\"" for windows path separator. In many cases,
# "/"" can also be used as the separator in windows.
FROM microsoft/windowsservercore:1803
# Restore the default Windows shell for correct batch processing.
SHELL ["cmd", "/S", "/C"]
@liyuqian
liyuqian / Dockerfile
Last active April 2, 2019 05:42
Windows docker
# escape=`
FROM mcr.microsoft.com/dotnet/framework/sdk:4.7.2
# Restore the default Windows shell for correct batch processing.
SHELL ["cmd", "/S", "/C"]
RUN NuGet install GitForWindows -Version 2.21.0
RUN setx path "%path%";C:\GitForWindows.2.21.0\tools\cmd
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
home: Scaffold(
@liyuqian
liyuqian / main.dart
Last active December 26, 2018 21:07
import 'dart:ui' as ui;
import 'dart:typed_data';
import 'package:http/http.dart' as http;
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
void main() => runApp(MyApp());