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
export interface IPageMetadata { | |
position: { | |
current: number, | |
max: number | |
}, | |
data: { | |
per: number, | |
total: number | |
} | |
} |
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
export class MyObjectDatasourceService implements DataSource<MyObject> { | |
private myObjectSubject = new BehaviorSubject<MyObject[]>([]); | |
constructor(private myObjectService: MyObjectService){} | |
connect(collectionViewer: CollectionViewer): Observable<MyObject[]> { | |
return this.myObjectSubject.asObservable(); | |
} |
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
// assuming a route such as /parents/Parent.parameter/children/ | |
func addChildtoParent(_ req: Request) throws -> Future<Child> { | |
return try flatMap( | |
to: Child.self, // what we will get back | |
req.parameters.next(Parent.self), // an already existing Parameter conforming instance | |
req.content.decode(Child.self)) { // a Content conforming instance | |
parent, child in | |
child.parentId = try parent.requireId() |
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
// assuming a route such as /parents/Parent.parameter/children/ | |
func addChildtoParent(_ req: Request) throws -> Future<Child> { | |
return try req.parameters.next(Parent.self).flatMap(to: Child.self) { parent in | |
return try req.content.decode(Child.self).flatMap{ child in | |
child.parentId = try parent.requireId() | |
return try child.save(on:req) | |
} | |
} | |
} |
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
#!/bin/bash | |
# | |
# Check_mk | |
# plugin for freebsd based systems that have disks on /dev/ada? | |
# | |
# This plugin produces the correct output to be parsed by the smart.temperature and the smart.stats checks | |
echo '<<<smart>>>' | |
for disk in `ls /dev/ada?`; |
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
// | |
// UIImagePickerController+RemoveStatusBar.m | |
// CarpeWorkshop | |
// With thanks to:http://stackoverflow.com/users/2797041/user2797041 | |
// Created by Charles Young on 10/9/13. | |
// Copyright (c) 2013 Charles Young. All rights reserved. | |
// | |
#import "UIImagePickerController+RemoveStatusBar.h" |