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)); |
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
plugins: | |
- serverless-apigw-binary | |
custom: | |
apigwBinary: | |
types: | |
- 'image/jpeg' |
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' |
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); | |
} | |
} |
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 } | |
] | |
}); |
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, | |
) {} |
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' | |
}) | |
], | |
}); |
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 |
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'), |
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), |
OlderNewer