Skip to content

Instantly share code, notes, and snippets.

@liyuqian
liyuqian / engine_gclient
Created July 28, 2018 05:40
Flutter engine CI gclient file
solutions = [{
"name" : "src/flutter",
"url" : "https://github.com/flutter/engine.git",
"deps_file" : "DEPS",
"managed" : False,
"safesync_url": "",
}]
@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());
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 / 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
@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"]
:: 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.
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
// 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);
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 / 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