Skip to content

Instantly share code, notes, and snippets.

Avatar

Michael Marner MichaelMarner

View GitHub Profile
View cached_image_hero.dart
import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) => MaterialApp(
title: 'CachedNetworkImage Hero',
theme: ThemeData(primarySwatch: Colors.blue),
View cached_image_problems.dart
import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) => MaterialApp(
title: 'CachedNetworkImage Demo',
theme: ThemeData(primarySwatch: Colors.blue),
View dialog.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: MyHomePage(title: 'Flutter Demo Home Page'),
View restart-and-log.ts
import { ErrorHandler, Inject } from '@angular/core';
import { AlertController } from 'ionic-angular';
import { SplashScreen } from '@ionic-native/splash-screen';
Import { RollbarService } form 'angular-rollbar';
export class MyErrorHandler implements ErrorHandler {
constructor(
private alerts: AlertController,
public splashScreen: SplashScreen,
public rollbar: RollbarService
View rollbar-init.ts
@NgModule({
imports: [
RollbarModule.forRoot({
accessToken: 'YOUR ROLLBAR CLIENT TOKEN'
})
],
});
View restart-error-handler.ts
import { ErrorHandler, Inject } from '@angular/core';
import { AlertController } from 'ionic-angular';
import { SplashScreen } from '@ionic-native/splash-screen';
export class MyErrorHandler implements ErrorHandler {
constructor(
private alerts: AlertController,
public splashScreen: SplashScreen,
) {}
View module-init-1.ts
const ERROR_HANDLER = environment.production ? MyErrorHandler : IonicErrorHandler;
@NgModule({
// the rest of your module bootstrapping
providers: [
{ provide: ErrorHandler, useClass: ERROR_HANDLER }
]
});
View gist:56be1a84cb20d0b5fcb9f0ed6fed43aa
import { ErrorHandler } from '@angular/core';
export class MyErrorHandler implements ErrorHandler {
constructor() {}
async handleError(error) {
console.error(error);
}
}
View binary-serverless.yml
service: image-resizer
plugins:
- serverless-apigw-binary
- serverless-apigwy-binary
custom:
apigwBinary:
types:
- 'image/jpeg'
View binary-serverless.yml
plugins:
- serverless-apigw-binary
custom:
apigwBinary:
types:
- 'image/jpeg'