View cached_image_hero.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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-error-handler.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 restart-and-log.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@NgModule({ | |
imports: [ | |
RollbarModule.forRoot({ | |
accessToken: 'YOUR ROLLBAR CLIENT TOKEN' | |
}) | |
], | |
}); |
View module-init-1.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const ERROR_HANDLER = environment.production ? MyErrorHandler : IonicErrorHandler; | |
@NgModule({ | |
// the rest of your module bootstrapping | |
providers: [ | |
{ provide: ErrorHandler, useClass: ERROR_HANDLER } | |
] | |
}); |
View gist:56be1a84cb20d0b5fcb9f0ed6fed43aa
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { ErrorHandler } from '@angular/core'; | |
export class MyErrorHandler implements ErrorHandler { | |
constructor() {} | |
async handleError(error) { | |
console.error(error); | |
} | |
} |
View binary-serverless.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
service: image-resizer | |
plugins: | |
- serverless-apigw-binary | |
- serverless-apigwy-binary | |
custom: | |
apigwBinary: | |
types: | |
- 'image/jpeg' |
View lambda.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { APIGatewayEvent, Context, Callback } from 'aws-lambda'; | |
import * as Jimp from 'jimp'; | |
export async function resize( | |
event: APIGatewayEvent, | |
context: Context, | |
callback: Callback | |
) { | |
const image = await Jimp.read(event.queryStringParameters.src); | |
await image.cover(Number(event.queryStringParameters.w), Number(event.queryStringParameters.h)); |
NewerOlder