Skip to content

Instantly share code, notes, and snippets.

View marcel-ploch's full-sized avatar

Marcel Ploch marcel-ploch

View GitHub Profile
@marcel-ploch
marcel-ploch / registerListener.ts
Last active September 28, 2018 07:57
Register Listener
public listViewLoaded(args: any): void {
this.listView = this.page.getViewById('playerListView');
if (isAndroid) {
this.listAdapter = this.listView.android.getAdapter();
}
if (isAndroid) {
const that: any = this;
@marcel-ploch
marcel-ploch / UITableViewDelegate.TS
Last active September 28, 2018 07:30
Own UITableViewDelegate
import {NewUITableViewDelegateImpl as NewUITableViewDelegateImplBase} from './NewUITableViewDelegateImpl';
export class NewUITableViewDelegateImpl extends NSObject implements UITableViewDelegate {
public static ObjCProtocols: any = [ UITableViewDelegate ];
private _originalDelegate: UITableViewDelegate;
private _callback: any;
private _isLoading: Boolean = false;
public static initWithOriginalDelegate(originalDelegate: UITableViewDelegate, loadMorePlayers: any): NewUITableViewDelegateImpl {
export abstract class NewUITableViewDelegateImpl {
static initWithOriginalDelegate(originalDelegate: UITableViewDelegate, loadMorePlayers: any): any {
}
}
import {NewUITableViewDelegateImpl as NewUITableViewDelegateImplBase} from './NewUITableViewDelegateImpl';
export class NewUITableViewDelegateImpl {
initWithOriginalDelegate(): any {
}
}
@marcel-ploch
marcel-ploch / test.spec.ts
Created March 22, 2019 15:26
Test mit Selektoren und Spy's
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();
service:
name: image-optimization
# Add the serverless-webpack plugin
plugins:
provider:
name: aws
runtime: nodejs8.10
timeout: 60 # optional, in seconds, default is 6
'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,
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 {
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>{
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
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');