This file contains hidden or 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
| /* eslint-env mocha */ | |
| /* eslint prefer-arrow-callback: off */ | |
| const sinon = require('sinon'); | |
| const AWS = require('aws-sdk-mock'); | |
| const { utils } = require('@ucapp/unioncore-test-utils'); | |
| const expect = require('expect'); | |
| const hello = require('../hello.js'); | |
| let SNS_SPY; |
This file contains hidden or 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 utils = require('@ucapp/unioncore-utils'); | |
| const AWS = require('aws-sdk'); | |
| module.exports.helloWorld = async (event, context) => { | |
| context.callbackWaitsForEmptyEventLoop = false; | |
| try { | |
| const msgs = []; | |
| for (const r of event.Records) { | |
| const payload = _extractMessageFromPayload(r); |
This file contains hidden or 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 _ = require('lodash'); | |
| const createEvent = require('aws-event-mocks'); | |
| const expect = require('expect'); | |
| const yaml = require('js-yaml'); | |
| const fs = require('fs'); | |
| const dotenv = require('dotenv'); | |
| const diff = require('deep-diff'); | |
| const fns = {}; | |
| /** |
This file contains hidden or 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
| extension UIView { | |
| func animateTo(frame: CGRect, withDuration duration: TimeInterval, completion: ((Bool) -> Void)? = nil) { | |
| guard let _ = superview else { | |
| return | |
| } | |
| let xScale = frame.size.width / self.frame.size.width | |
| let yScale = frame.size.height / self.frame.size.height | |
| let x = frame.origin.x + (self.frame.width * xScale) * self.layer.anchorPoint.x | |
| let y = frame.origin.y + (self.frame.height * yScale) * self.layer.anchorPoint.y |
This file contains hidden or 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
| let x = frame.origin.x + (self.frame.width * xScale) * self.layer.anchorPoint.x | |
| let y = frame.origin.y + (self.frame.height * yScale) * self.layer.anchorPoint.y |
This file contains hidden or 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
| let x = frame.origin.x + (self.frame.width * xScale)/2 | |
| let y = frame.origin.y + (self.frame.height * yScale)/2 |
This file contains hidden or 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
| smallSquare.animateTo(frame: CGRect(x: 60, y: 60, width: 80, height: 80), withDuration: 1) |
This file contains hidden or 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
| func animateTo(frame: CGRect, withDuration duration: TimeInterval, completion: ((Bool) -> Void)? = nil) { | |
| guard let _ = superview else { | |
| return | |
| } | |
| let xScale = frame.size.width / self.frame.size.width | |
| let yScale = frame.size.height / self.frame.size.height | |
| let x = frame.origin.x + (self.frame.width * xScale)/2 | |
| let y = frame.origin.y + (self.frame.height * yScale)/2 | |
| UIView.animate(withDuration: duration, delay: 0, options: .curveLinear, animations: { |
This file contains hidden or 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
| UIView.animate(withDuration: 1) { | |
| smallSquare.layer.position = CGPoint(x: 60, y: 60) | |
| smallSquare.transform = CGAffineTransform.identity.scaledBy(x: 2, y: 2) | |
| } |
This file contains hidden or 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
| UIView.animate(withDuration: 1) { | |
| smallSquare.layer.position = CGPoint(x: 60, y: 60) | |
| } |
NewerOlder