Skip to content

Instantly share code, notes, and snippets.

View ruan65's full-sized avatar
🎯
Focusing

Andrew ruan65

🎯
Focusing
View GitHub Profile
<!doctype html>
<html>
<head>
<title>TradeIt oAuth Login</title>
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no, minimal-ui"/>
<meta name="apple-mobile-web-app-capable" content="yes"/>
<style>
html {
font-family: sans-serif;
-ms-text-size-adjust: 100%;
pub global activate protoc_plugin
protoc --dart_out=. addressbook.proto /usr/local/Cellar/protobuf/3.7.1/include/google/protobuf/timestamp.proto
@ruan65
ruan65 / create_flutter_app.sh
Last active May 21, 2020 11:57
Flutter snippets
flutter run -d chrome --release --dart-define=FLUTTER_WEB_USE_SKIA=true
flutter create --org org.premiumapp -i swift -a kotlin --description 'description' app_name
flutter create --org ru.emc.flutter.qr -i swift -a kotlin --description 'flutter emc application' flutter_emc_qr
flutter create --org ru.finam -i swift -a kotlin --description 'grpc chat widget' txchatwidget
flutter create -t module --org ru.finam -i swift -a kotlin --description 'grpc chat widget library' txchatwidget
@ruan65
ruan65 / app.dart
Created April 17, 2019 22:54
Find circle road in list of roads if exists (there may be 1 or 0 occurrence of circle road)
import 'package:simple_playground/algo/find_circle_road.dart';
void main() {
print(findCircularRoad(input1));
print(findCircularRoad(input2));
print(findCircularRoad(input3));
print(findCircularRoad(input4));
}
import 'package:bloc/bloc.dart';
import 'package:tps_mobile_combined_maximo_app/claims/create_clame/bloc/export.dart';
import 'package:tps_mobile_combined_maximo_app/data/model/claims/claim_co.dart';
import 'package:tps_mobile_combined_maximo_app/data/repositories/local_storage.dart';
import 'package:tps_mobile_combined_maximo_app/global/bloc/export.dart';
class CreateClaimBloc extends Bloc<CreateClaimEvent, CreateClaimState> {
final GlobalBloc globalBloc;
CreateClaimBloc(this.globalBloc);
import 'package:meta/meta.dart';
import 'package:tps_mobile_combined_maximo_app/global/bloc/export.dart';
@immutable
abstract class GlobalState {}
class GlobalMessageState extends GlobalState{
final GlobalMessage message;
GlobalMessageState(this.message);
import 'package:bloc/bloc.dart';
import 'package:tps_mobile_combined_maximo_app/data/model/user_state/member_user_state.dart';
import 'package:tps_mobile_combined_maximo_app/data/repositories/local_storage.dart';
import 'package:tps_mobile_combined_maximo_app/global/bloc/export.dart';
class GlobalBloc extends Bloc<GlobalEvent, GlobalState> {
@override
GlobalState get initialState => GlobalStateUnauthenticated();
@override
@ruan65
ruan65 / dart_helpers.dart
Created February 27, 2019 15:10
Dart helpers
Iterable<int> range({int from = 0, int to}) sync* {
for (int i = from; i < to; ++i) {
yield i;
}
}
@ruan65
ruan65 / wiki.sh
Created February 15, 2019 10:05
linux ubuntu useful commands
# add path example
echo 'export PATH="$PATH:/usr/lib/dart/bin"' >> ~/.bashrc
source .bashrc
# install dart https://www.dartlang.org/tools/sdk#install
@ruan65
ruan65 / bloc_example.dart
Created February 12, 2019 16:37
Bloc Flutter Example
class CounterState {
final int counter;
CounterState._(this.counter);
factory CounterState.nextState(int times) => CounterState._(times);
}
class CounterBloc extends Bloc<CounterEvent, CounterState> {
@override
CounterState get initialState => CounterState.nextState(0);