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
class Vehicle { | |
String? make; | |
String? model; | |
int? manufactureYear; | |
int? vehicleAge; | |
String? color; | |
int get age { | |
return vehicleAge ?? 0; | |
} |
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
// Erweitere die Klasse string um die NumberParsing Extension | |
extension NumberParsing on String { | |
int parseInt() { | |
return int.parse(this); | |
} | |
String parseFloat() { | |
return double.parse(this).toStringAsFixed(2); | |
} | |
String changeDirection() { | |
return this.split('').reversed.join(); |
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
class TrafficLight { | |
static String updateLight(String currentState) { | |
return "Solution"; | |
} | |
} | |
void main() { | |
assert(TrafficLight.updateLight("green") == "yellow", | |
"Not correct answer for green"); | |
print("Color is yellow"); |
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 AWS = require('aws-sdk'); | |
const path = require('path'); | |
const fs = require('fs'); | |
const mime = require('mime'); | |
const packageJSON = require('./../package.json'); | |
const crypto = require('crypto'); | |
const rqhttp = require('request-promise'); | |
console.log('\x1b[0m'); |
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
class MyApp extends StatelessWidget { | |
final materialApp = MaterialApp( | |
title: UIData.appName, | |
theme: ThemeData( | |
primaryColor: Colors.green, | |
fontFamily: UIData.quickFont, | |
primarySwatch: Colors.amber), | |
home: HomePage(), | |
initialRoute: null, | |
//routes |
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
class MyApp extends StatelessWidget { | |
final materialApp = MaterialApp( | |
title: UIData.appName, | |
theme: ThemeData( | |
primaryColor: Colors.green, | |
fontFamily: UIData.quickFont, | |
primarySwatch: Colors.amber), | |
home: HomePage(), | |
initialRoute: null, | |
routes: <String, WidgetBuilder>{ |
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 { Component } from '@angular/core'; | |
import { HttpClient } from '@angular/common/http'; | |
@Component({ | |
selector: 'app-root', | |
templateUrl: './app.component.html', | |
styleUrls: ['./app.component.css'] | |
}) | |
export class AppComponent { |
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
'use strict'; | |
const Jimp = require('jimp'); | |
const AWS = require('aws-sdk'); | |
const {GifCodec, BitmapImage, GifFrame, GifUtil} = require('gifwrap'); | |
// All Dokumentation can be found here | |
// https://github.com/oliver-moran/jimp/tree/master/packages/jimp | |
const repsonseBody = { | |
origUrl: null, |
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: | |
name: image-optimization | |
# Add the serverless-webpack plugin | |
plugins: | |
provider: | |
name: aws | |
runtime: nodejs8.10 | |
timeout: 60 # optional, in seconds, default is 6 |
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
it('should edit an element via button click', async(() => { | |
fixture.detectChanges(); | |
const compiled = fixture.debugElement.nativeElement; | |
let matCards = compiled.querySelectorAll('mat-card'); | |
expect(app.toDoList.length).toBe(matCards.length); | |
spyOn(app, 'openDialogEdit').and.callFake(() => { | |
app.editItem(1, {name: 'Edit'}); | |
}); | |
const deleteElement = compiled.querySelectorAll('button.edit'); | |
deleteElement[0].click(); |