Skip to content

Instantly share code, notes, and snippets.

@pellekrogholt
pellekrogholt / AppDelegate.swift
Last active January 4, 2023 18:20
iOS notification scenario: A daily repeating local notification should fire a onetime/single local notification under some conditions. This onetime/single local notification must be shown as a banner when the app is in foreground. When user clicks the banner - the onetime/single local notification should be removed from the global/system `notifi…
import UIKit
import JCNotificationBannerPresenter
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// protractor configuration file for cucumber
exports.config = {
allScriptsTimeout: 11000,
specs: [
'features/**/*.feature'
],
capabilities: {
'browserName': 'chrome'
{
"edid": {
"dmt_found": false,
"hdmi_audio": true,
"is_monitor": true,
"model": "HDMI",
"preferred_group": "DMT",
"preferred_hz": 60.0,
"preferred_mode": 27,
"preferred_res": "1280x800p",
renderBodyContentOn: html
|modalDOMElement microphone audioDomElement audioUrl|
html button
with: 'Add message';
class: 'btn btn-primary';
onClick: [modalDOMElement asJQuery modal: 'show'].
modalDOMElement := html div class:'modal fade'; with:[
html style with: '
test("proper inserts and lookups and remove") {
val topNode = system.actorOf(Props[BinaryTreeSet])
topNode ! Contains(testActor, id = 1, 1)
expectMsg(ContainsResult(1, false))
topNode ! Insert(testActor, id = 2, 1)
expectMsg(OperationFinished(2))
topNode ! Remove(testActor, id = 4, 1)
test("Test empty tree 'Contains'") {
// behind the scene this on create a node actor - follow props: Props(classOf[BinaryTreeNode], elem, initiallyRemoved)
val testNode = system.actorOf(BinaryTreeNode.props(0, true))
testNode ! Contains(testActor, id = 1, 0)
expectMsg(ContainsResult(1, false))
}
test("Test empty tree 'Insert'") {
package week12
import akka.actor.Actor
import akka.actor.Props
import akka.event.LoggingReceive
class TransferMain extends Actor {
val accountA = context.actorOf(Props[BankAccount], "accountA")
val accountB = context.actorOf(Props[BankAccount], "accountB")
test("recovered standalone") {
val ex = new NoSuchElementException
// exception in the end
val o1 = Observable(1, 2, 3) ++ Observable(ex)
val o1Revocered = o1.recovered
assert(o1Revocered.toBlockingObservable.toList === List(Success(1), Success(2), Success(3), Failure(ex)))
[
{
"id":"1",
"title":"Plan 1 title",
"description":"Plan 1 description",
"instructions":[
{
"id":"1_1",
"title":"Instruction 1"
},
function nestCollection(model, attributeName, nestedCollection) {
//setup nested references
for (var i = 0; i < nestedCollection.length; i++) {
model.attributes[attributeName][i] = nestedCollection.at(i).attributes;
}
//create empty arrays if none
nestedCollection.bind('add', function (initiative) {
if (!model.get(attributeName)) {
model.attributes[attributeName] = [];